/* ============================================
   MARKDOWN Ä°ÃERÄ°K STÄ°LLERÄ°
   Hem Public (.article-content) hem Admin (.preview-content) iÃ§in
   
   KullanÄ±m:
   - Public: _HelpLayout.cshtml ve Article.cshtml
   - Admin: Preview.cshtml ve Edit.cshtml
   
   Not: CSS Variables kullanÄ±lÄ±yor, her layout kendi
   tema renklerini tanÄ±mlar (--primary-color, --text-color vb.)
   ============================================ */

/* ============================================
   BASE STYLES - Temel Ä°Ã§erik Stilleri
   ============================================ */
.article-content,
.preview-content {
    line-height: 1.8;
    font-size: 1.0625rem; /* 17px - Optimal okuma boyutu */
    color: var(--text-color, #374151);
    overflow-x: hidden;
    box-sizing: border-box;
}

/* Ä°Ã§erikteki tÃ¼m elemanlar iÃ§in box-sizing */
.article-content *,
.preview-content * {
    box-sizing: border-box;
}

/* ============================================
   HEADING HIERARCHY - BaÅlÄ±k HiyerarÅisi
   H1: En vurgulu (gradient primary)
   H2: Ä°kinci seviye (primary + alt Ã§izgi)
   H3: Orta ton (mavi)
   H4: Daha nÃ¶tr (gri)
   H5-H6: Normal text rengine yakÄ±n
   ============================================ */

/* Ortak baÅlÄ±k stilleri */
.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4,
.article-content h5,
.article-content h6,
.preview-content h1,
.preview-content h2,
.preview-content h3,
.preview-content h4,
.preview-content h5,
.preview-content h6 {
    margin-top: 2.5rem;
    margin-bottom: 1.25rem;
    font-weight: 600;
    line-height: 1.3;
    scroll-margin-top: 100px; /* Header yÃ¼ksekliÄi iÃ§in */
}

/* H1: En vurgulu - Primary gradient efekti */
.article-content h1,
.preview-content h1 {
    font-size: 2.25rem; /* 36px */
    margin-top: 0;
    color: var(--primary-color, #2563eb);
    background: linear-gradient(135deg, var(--primary-color, #2563eb) 0%, var(--primary-hover, #1d4ed8) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* H2: Ä°kinci seviye - Primary color + alt Ã§izgi */
.article-content h2,
.preview-content h2 {
    font-size: 1.75rem; /* 28px */
    border-bottom: 2px solid var(--primary-color, #2563eb);
    padding-bottom: 0.75rem;
    margin-top: 2rem;
    color: var(--primary-color, #2563eb);
}

/* H3: ÃÃ§Ã¼ncÃ¼ seviye - Orta ton (mavi) */
.article-content h3,
.preview-content h3 {
    font-size: 1.375rem; /* 22px */
    color: #1e40af; /* Koyu mavi - Light mode */
}

/* H3 Dark mode */
[data-theme="dark"] .article-content h3,
[data-theme="dark"] .preview-content h3 {
    color: #60a5fa; /* AÃ§Ä±k mavi - Dark mode */
}

/* H4: DÃ¶rdÃ¼ncÃ¼ seviye - Daha nÃ¶tr (gri) */
.article-content h4,
.preview-content h4 {
    font-size: 1.125rem; /* 18px */
    color: #4b5563; /* Koyu gri - Light mode */
}

/* H4 Dark mode */
[data-theme="dark"] .article-content h4,
[data-theme="dark"] .preview-content h4 {
    color: #9ca3af; /* AÃ§Ä±k gri - Dark mode */
}

/* H5, H6: En alt seviye - Normal text rengine yakÄ±n */
.article-content h5,
.article-content h6,
.preview-content h5,
.preview-content h6 {
    font-size: 1rem; /* 16px */
    color: var(--text-color, #374151);
    opacity: 0.9;
}

/* ============================================
   PARAGRAPHS & TEXT - Paragraf ve Metin
   ============================================ */
.article-content p,
.preview-content p {
    margin-bottom: 1.25rem;
    line-height: 1.8;
}

/* ============================================
   LISTS - Listeler (ul, ol, li)
   ============================================ */
.article-content ul,
.article-content ol,
.preview-content ul,
.preview-content ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.article-content li,
.preview-content li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

/* Ä°Ã§ iÃ§e listeler iÃ§in daha az margin */
.article-content li ul,
.article-content li ol,
.preview-content li ul,
.preview-content li ol {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

/* ============================================
   CODE BLOCKS - Kod BloklarÄ±
   Inline code: `kod`
   Block code: ```kod bloku```
   ============================================ */

/* Inline code (kÃ¼Ã§Ã¼k kod parÃ§acÄ±klarÄ±) */
.article-content code,
.preview-content code {
    background: var(--code-bg, #f3f4f6);
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
    font-size: 0.875em; /* 14px */
    font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
    color: var(--text-color, #374151);
    border: 1px solid var(--border-color, #e5e7eb);
}

/* Code block (bÃ¼yÃ¼k kod bloklarÄ±) */
.article-content pre,
.preview-content pre {
    background: var(--code-bg, #f3f4f6);
    color: var(--text-color, #374151);
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin: 1rem 0;
    border: 1px solid var(--border-color, #e5e7eb);
    line-height: 1.5;
}

/* Pre iÃ§indeki code'un ekstra styling'i kaldÄ±r */
.article-content pre code,
.preview-content pre code {
    background: none;
    padding: 0;
    color: inherit;
    border: none;
    font-size: 0.875rem; /* 14px */
}

/* ============================================
   BLOCKQUOTES - AlÄ±ntÄ±lar
   ============================================ */
.article-content blockquote,
.preview-content blockquote {
    border-left: 4px solid var(--primary-color, #2563eb);
    padding: 1rem;
    margin: 1rem 0;
    background: var(--hover-bg, #f3f4f6);
    border-radius: 0 0.5rem 0.5rem 0;
    color: var(--text-color, #374151);
    font-style: italic;
}

/* Blockquote iÃ§indeki paragraf margin'ini azalt */
.article-content blockquote p,
.preview-content blockquote p {
    margin-bottom: 0.5rem;
}

.article-content blockquote p:last-child,
.preview-content blockquote p:last-child {
    margin-bottom: 0;
}

/* ============================================
   IMAGES - Resimler
   ============================================ */
.article-content img,
.preview-content img {
    max-width: 100% !important;
    height: auto !important;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    margin: 1rem 0;
    display: block;
}

/* ============================================
   TABLES - Tablolar
   Responsive: Mobilde yatay scroll
   ============================================ */
.article-content table,
.preview-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    table-layout: fixed; /* Firefox iÃ§in sabit tablo geniÅliÄi */
    word-wrap: break-word; /* Uzun kelimeleri bÃ¶l */
    border: 1px solid var(--border-color, #e5e7eb);
}

.article-content table td,
.article-content table th,
.preview-content table td,
.preview-content table th {
    padding: 0.75rem;
    border: 1px solid var(--border-color, #e5e7eb);
    overflow-wrap: break-word; /* Firefox iÃ§in kelime bÃ¶lme */
    word-break: break-word; /* Uzun kelimeleri bÃ¶l */
    text-align: left;
}

.article-content table th,
.preview-content table th {
    background: var(--hover-bg, #f3f4f6);
    font-weight: 600;
    color: var(--text-color, #374151);
}

/* Zebra striping (alternatif satÄ±r renkleri) */
.article-content table tbody tr:nth-child(even),
.preview-content table tbody tr:nth-child(even) {
    background: var(--hover-bg, #f9fafb);
}

/* ============================================
   HORIZONTAL RULE - Yatay Ãizgi (---)
   ============================================ */
.article-content hr,
.preview-content hr {
    border: none;
    border-top: 2px solid var(--border-color, #e5e7eb);
    margin: 2rem 0;
}

/* ============================================
   LINKS - BaÄlantÄ±lar
   ============================================ */
.article-content a,
.preview-content a {
    color: var(--primary-color, #2563eb);
    text-decoration: none;
    transition: all 0.2s ease;
    border-bottom: 1px solid transparent;
}

.article-content a:hover,
.preview-content a:hover {
    color: var(--primary-hover, #1d4ed8);
    border-bottom-color: var(--primary-hover, #1d4ed8);
}

/* BaÅlÄ±k iÃ§indeki linkler (anchor links) farklÄ± stil */
.article-content h1 a,
.article-content h2 a,
.article-content h3 a,
.article-content h4 a,
.article-content h5 a,
.article-content h6 a,
.preview-content h1 a,
.preview-content h2 a,
.preview-content h3 a,
.preview-content h4 a,
.preview-content h5 a,
.preview-content h6 a {
    color: inherit;
    border: none;
}

/* ============================================
   STRONG & EMPHASIS - KalÄ±n ve Ä°talik
   ============================================ */
.article-content strong,
.preview-content strong {
    font-weight: 600;
    color: var(--text-color, #374151);
}

.article-content em,
.preview-content em {
    font-style: italic;
}

/* ============================================
   KEYBOARD & INLINE ELEMENTS - Klavye ve Inline
   ============================================ */
.article-content kbd,
.preview-content kbd {
    background: var(--code-bg, #f3f4f6);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 0.25rem;
    padding: 0.125rem 0.5rem;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.875em;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.article-content mark,
.preview-content mark {
    background: #fef3c7;
    color: #92400e;
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
}

/* ============================================
   TASK LISTS - GÃ¶rev Listeleri (GitHub style)
   ============================================ */
.article-content input[type="checkbox"],
.preview-content input[type="checkbox"] {
    margin-right: 0.5rem;
}

.article-content li.task-list-item,
.preview-content li.task-list-item {
    list-style: none;
}

/* ============================================
   DEFINITION LISTS - TanÄ±m Listeleri
   ============================================ */
.article-content dl,
.preview-content dl {
    margin: 1rem 0;
}

.article-content dt,
.preview-content dt {
    font-weight: 600;
    margin-top: 0.5rem;
}

.article-content dd,
.preview-content dd {
    margin-left: 2rem;
    margin-bottom: 0.5rem;
}

/* ============================================
   RESPONSIVE DESIGN - Mobil Uyum
   ============================================ */
@media (max-width: 768px) {
    /* Font boyutlarÄ±nÄ± kÃ¼Ã§Ã¼lt */
    .article-content,
    .preview-content {
        font-size: 1rem; /* 16px */
    }

    .article-content h1,
    .preview-content h1 {
        font-size: 1.75rem; /* 28px */
    }

    .article-content h2,
    .preview-content h2 {
        font-size: 1.5rem; /* 24px */
    }

    .article-content h3,
    .preview-content h3 {
        font-size: 1.25rem; /* 20px */
    }

    .article-content h4,
    .preview-content h4 {
        font-size: 1.125rem; /* 18px */
    }

    /* Tablolar mobilde yatay scroll */
    .article-content table,
    .preview-content table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    /* GÃ¶rseller mobilde tam geniÅlikte */
    .article-content img,
    .preview-content img {
        width: 100%;
        height: auto;
    }

    /* Code bloklarÄ± mobilde scroll */
    .article-content pre,
    .preview-content pre {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Padding'leri kÃ¼Ã§Ã¼lt */
    .article-content ul,
    .article-content ol,
    .preview-content ul,
    .preview-content ol {
        padding-left: 1.5rem;
    }
}

/* ============================================
   PRINT STYLES - YazdÄ±rma Stilleri
   ============================================ */
@media print {
    .article-content,
    .preview-content {
        color: #000;
        font-size: 12pt;
    }

    .article-content a,
    .preview-content a {
        text-decoration: underline;
        color: #000;
    }

    .article-content pre,
    .article-content code,
    .preview-content pre,
    .preview-content code {
        border: 1px solid #000;
        page-break-inside: avoid;
    }

    .article-content img,
    .preview-content img {
        max-width: 100%;
        page-break-inside: avoid;
    }

    .article-content h1,
    .article-content h2,
    .article-content h3,
    .preview-content h1,
    .preview-content h2,
    .preview-content h3 {
        page-break-after: avoid;
        color: #000;
    }
}

/* ============================================
   ACCESSIBILITY - EriÅilebilirlik
   Klavye navigasyonu ve screen reader desteÄi
   ============================================ */
.article-content :focus,
.preview-content :focus {
    outline: 2px solid var(--primary-color, #2563eb);
    outline-offset: 2px;
}

/* Skip to content iÃ§in */
.article-content :target,
.preview-content :target {
    scroll-margin-top: 100px;
}

/* ============================================
   UTILITIES - YardÄ±mcÄ± SÄ±nÄ±flar
   Manuel olarak eklenebilir Ã¶zel durumlar iÃ§in
   ============================================ */

/* Metin hizalama */
.article-content .text-center,
.preview-content .text-center {
    text-align: center;
}

.article-content .text-right,
.preview-content .text-right {
    text-align: right;
}

/* GÃ¶rsel float'larÄ± */
.article-content .float-left,
.preview-content .float-left {
    float: left;
    margin-right: 1rem;
    margin-bottom: 1rem;
}

.article-content .float-right,
.preview-content .float-right {
    float: right;
    margin-left: 1rem;
    margin-bottom: 1rem;
}

/* Clear float */
.article-content::after,
.preview-content::after {
    content: "";
    display: table;
    clear: both;
}

/* ============================================
   HEADING ANCHOR LINKS - BaÅlÄ±k Ãapa Linkleri
   BaÅlÄ±klara tÄ±klanabilir anchor (Ã§apa) linkleri ekler
   ============================================ */

/* Anchor link iÃ§eren baÅlÄ±klar iÃ§in scroll margin */
.article-content .has-anchor,
#articleContent .has-anchor,
.preview-content .has-anchor {
    position: relative;
    scroll-margin-top: 100px; /* Header yÃ¼ksekliÄi iÃ§in */
}

/* Anchor link simgesi (# karakteri) */
.heading-anchor {
    margin-left: 0.5em;
    opacity: 0;
    transition: opacity 0.2s ease;
    color: #6c757d;
    text-decoration: none;
    font-size: 0.8em;
    display: inline-flex;
    align-items: center;
    padding: 0.25em;
}

/* BaÅlÄ±Äa hover edildiÄinde anchor linkini gÃ¶ster */
.has-anchor:hover .heading-anchor {
    opacity: 1;
}

/* Anchor linke hover edildiÄinde renk deÄiÅtir */
.heading-anchor:hover {
    color: var(--primary-color, #2563eb);
}

/* Dark mode iÃ§in anchor link rengi */
[data-theme="dark"] .heading-anchor {
    color: #9ca3af;
}

[data-theme="dark"] .heading-anchor:hover {
    color: var(--primary-color, #60a5fa);
}

/* Kopyalama bildirimi (anchor link kopyalandÄ±ÄÄ±nda) */
.copy-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #10b981;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    display: flex;
    align-items: center;
    animation: slideIn 0.3s ease;
    font-weight: 500;
}

.copy-notification.fade-out {
    animation: slideOut 0.3s ease;
}

.copy-notification i {
    margin-right: 8px;
    font-size: 1.1em;
}

/* Bildirim animasyonlarÄ± */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

