/* ==========================================
        ★  ÖZEL CSS KODLARI  ★
========================================== */

:root {

  /* --- FONTLAR --- */
  --font-main:    'Inter', sans-serif;
  --font-display: 'Sora', sans-serif;

  /* -----------------------------------------------
     METİN BOYUTLARI
     ----------------------------------------------- */
  --text-base:        16px;     /* Gövde metni */
  --text-sm:          0.875rem; /* Küçük etiketler */
  --text-xs:          0.75rem;  /* Çok küçük metinler */
  --text-nav:         0.875rem; /* Navbar linkleri */
  --text-section:     0.9rem;   /* Bölüm başlıkları */
  --text-table-th:    0.8rem;   /* Tablo başlık hücresi */
  --text-table-td:    0.9rem;   /* Tablo veri hücresi */

  /* Sayfa Başlığı */
  --text-page-title:       1.5rem;  /* Masaüstü */
  --text-page-title-mobile: 1.2rem; /* Mobil */
  --text-page-title-sub:   0.8rem;  /* Alt başlık (small) */

  /* Menü Kartları */
  --text-card-label: 0.80rem;  /* Kart ana yazısı */
  --text-card-sub:   0.65rem;  /* Kart alt yazısı (small) */

  /* -----------------------------------------------
     MOBİL NAVİGASYON BOYUTLARI
     ----------------------------------------------- */
  --mobile-nav-height: 60px;    /* Alt nav yüksekliği */
  --mobile-nav-icon:   1.15rem; /* Alt nav ikon boyutu */
  --mobile-nav-label:  0.6rem;  /* Alt nav yazı boyutu */
  --menu-card-icon:    1.7rem;  /* Ana sayfa menü kartı ikonu */

  /* -----------------------------------------------
     VURGU RENKLERİ (her iki temada ortak)
     ----------------------------------------------- */
  --accent-red:    #ef4444;
  --accent-blue:   #0ea5e9;
  --accent-purple: #8b5cf6;
  --accent-green:  #059669;
  --accent-error:  #dc2626;

  /* ===============================================
     AÇIK TEMA (LIGHT) RENKLERİ
     =============================================== */

  /* Sayfa geneli */
  --light-bg:           #f0f2f5; /* Sayfa arka planı */
  --light-text:         #0f1117; /* Ana metin */
  --light-text-muted:   #475569; /* İkincil / soluk metin */

  /* Sayfa başlığı (.page-title) */
  --light-page-title:       #0f172a; /* Başlık rengi */
  --light-page-title-sub:   #64748b; /* Alt başlık (small) rengi */

  /* Menü kartı (.menu-card) */
  --light-card-bg:          #ffffff; /* Kart arka planı */
  --light-card-border:      #e2e8f0; /* Kart kenarlığı */
  --light-card-text:        #1e293b; /* Kart ana yazı rengi */
  --light-card-sub:         #64748b; /* Kart small rengi — daha koyu = daha okunur */
  --light-card-icon:        #475569; /* Kart ikon rengi */
  --light-card-hover-bg:    #111827; /* Hover arka plan */
  --light-card-hover-text:  #f1f5f9; /* Hover yazı rengi */
  --light-card-hover-border:#ef4444; /* Hover kenarlık rengi */

  /* Tablo */
  --light-td-border:    #e2e8f0; /* Hücre kenarlığı */
  --light-row-even:     #fafafa; /* Çift satır */
  --light-row-hover:    #f0f4f8; /* Satır hover */

  /* ===============================================
     KOYU TEMA (DARK) RENKLERİ
     =============================================== */

  /* Sayfa geneli */
  --dark-bg:            #0f1117; /* Sayfa arka planı */
  --dark-text:          #e2e8f0; /* Ana metin */
  --dark-text-muted:    #94a3b8; /* İkincil / soluk metin */

  /* Navbar */
  --dark-navbar-bg:     #0a0e14;

  /* Sayfa başlığı (.page-title) */
  --dark-page-title:        #f1f5f9; /* Başlık rengi */
  --dark-page-title-sub:    #64748b; /* Alt başlık (small) rengi */

  /* Menü kartı (.menu-card) */
  --dark-card-bg:           #1e293b; /* Kart arka planı */
  --dark-card-border:       #334155; /* Kart kenarlığı */
  --dark-card-text:         #e2e8f0; /* Kart ana yazı rengi */
  --dark-card-sub:          #94a3b8; /* Kart small rengi */
  --dark-card-icon:         #64748b; /* Kart ikon rengi */
  --dark-card-hover-bg:     #111827; /* Hover arka plan */
  --dark-card-hover-text:   #f1f5f9; /* Hover yazı rengi */
  --dark-card-hover-border: #e11d48; /* Hover kenarlık rengi */

  /* Tablo */
  --dark-td-border:     #1e293b;             /* Hücre kenarlığı */
  --dark-row-even:      rgba(255,255,255,0.02); /* Çift satır */
  --dark-row-hover:     #273344;             /* Satır hover */

}

/* ==========================================
   01. GENEL AYARLAR
   ========================================== */
  html[lang="ar"] body,
  html[lang="ar"] *:not(i, [class*="fa-"], [class*="bi-"], [class*="fi-"], .fa, .fab, .fas, .far, .bi, .fi) {
    font-family: 'Noto Sans Arabic', sans-serif !important;
  }

  * { box-sizing: border-box; margin: 0; padding: 0; }

  html, body {
    font-family: var(--font-main);
    font-size: var(--text-base);
    min-height: 100%;
  }

  /* ==========================================
     02. AÇIK TEMA (LIGHT THEME)
     ========================================== */
  body {
    background-color: var(--light-bg);
    color: var(--light-text);
  }

  /* ==========================================
     03. KOYU TEMA (DARK THEME)
     FOUC önleme: html.dark class HEAD'deki
     inline script ile anında ekleniyor.
     ========================================== */
  html.dark body {
    background-color: var(--dark-bg);
    color: var(--dark-text);
  }

  /* Tema geçiş animasyonu — sadece kullanıcı tıklayınca */
  body.theme-transition,
  body.theme-transition * {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease !important;
  }

  /* ==========================================
     04. KAYDIRMA ÇUBUĞU (SCROLLBAR)
     ========================================== */
  ::-webkit-scrollbar { width: 8px; }
  ::-webkit-scrollbar-track { background: #1e293b; }
  ::-webkit-scrollbar-thumb { background: #475569; border-radius: 4px; }
  html.dark ::-webkit-scrollbar-track { background: var(--dark-bg); }
  html.dark ::-webkit-scrollbar-thumb { background: var(--dark-card-border); }

  /* ==========================================
     05. NEON LOGO
     ========================================== */
  .neon-text {
    color: #fff;
    font-size: 0.8rem;
    padding: 2px 7px;
    border-radius: 4px;
    background: var(--accent-red);
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: 1px;
    box-shadow: 0 0 8px rgba(225,29,72,0.8), 0 0 20px rgba(225,29,72,0.4);
    animation: pulse-glow 2s infinite alternate;
  }

  @keyframes pulse-glow {
    0%   { box-shadow: 0 0 6px rgba(225,29,72,0.8), 0 0 16px rgba(225,29,72,0.3); }
    100% { box-shadow: 0 0 12px rgba(56,189,248,0.8), 0 0 30px rgba(56,189,248,0.3); background: #0284c7; }
  }

  /* ==========================================
     06. MASAÜSTÜ NAVBAR
     ========================================== */
  .main-navbar {
    background: linear-gradient(135deg, #111827 0%, #1e293b 100%);
    border-bottom: 2px solid var(--accent-red);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(12px);
  }

  html.dark .main-navbar {
    background: linear-gradient(135deg, var(--dark-navbar-bg) 0%, #111827 100%);
  }

  .navbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
    height: 60px;
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .nav-brand {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.1rem;
    color: #f1f5f9;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
  }

  .nav-links {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-left: auto;
  }

  html[dir="rtl"] .nav-links { margin-left: 0; margin-right: auto; }

  .nav-link {
    color: #94a3b8;
    font-weight: 500;
    font-size: var(--text-nav);
    padding: 8px 12px;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
    cursor: pointer;
    border: none;
    background: transparent;
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .nav-link:hover  { color: #f1f5f9; background: rgba(255,255,255,0.07); }
  .nav-link.active { color: var(--accent-red); background: rgba(225,29,72,0.1) !important; }

  /* ==========================================
     07. DROPDOWN
     ========================================== */
  .dropdown { position: relative; }

  .dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 160px;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 10px;
    padding: 6px;
    z-index: 9999;
    box-shadow: 0 8px 30px rgba(0,0,0,0.4);
    animation: dropdown-in 0.15s ease;
  }

  html[dir="rtl"] .dropdown-menu { right: auto; left: 0; }

  @keyframes dropdown-in {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  .dropdown.open .dropdown-menu { display: block; }

  .dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    color: #cbd5e1;
    text-decoration: none;
    border-radius: 7px;
    font-size: var(--text-sm);
    transition: all 0.15s ease;
  }

  .dropdown-item:hover  { background: rgba(255,255,255,0.07); color: #fff; }
  .dropdown-item.active { background: rgba(225,29,72,0.15); color: #f87171; }

  /* ==========================================
     08. TEMA BUTONU
     ========================================== */
  .theme-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid #334155;
    background: rgba(255,255,255,0.05);
    color: #94a3b8;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
  }

  .theme-btn:hover { background: rgba(255,255,255,0.1); color: #f1f5f9; border-color: #475569; }

  /* ==========================================
     09. MOBİL ALT NAVİGASYON
     ========================================== */
  .mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: #111827;
    border-top: 1px solid #1e293b;
    padding: 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    box-shadow: 0 -4px 20px rgba(0,0,0,0.4);
  }

  html.dark .mobile-nav {
    background: #080c12;
    border-top-color: var(--dark-card-bg);
  }

  .mobile-nav-inner {
    display: flex;
    align-items: stretch;
    height: var(--mobile-nav-height);
  }

  .mobile-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: #475569;
    text-decoration: none;
    font-size: var(--mobile-nav-label);
    font-weight: 600;
    letter-spacing: 0.3px;
    transition: all 0.2s ease;
    position: relative;
    cursor: pointer;
    background: transparent;
    border: none;
  }

  .mobile-nav-item i { font-size: var(--mobile-nav-icon); }
  .mobile-nav-item:hover,
  .mobile-nav-item.active { color: var(--accent-red); }

  .mobile-nav-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 20%;
    right: 20%;
    height: 2px;
    background: var(--accent-red);
    border-radius: 0 0 3px 3px;
  }

  /* ==========================================
     10. MOBİL DİL ÇEKMECESİ
     ========================================== */
  .lang-drawer-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 1100;
    backdrop-filter: blur(3px);
  }

  .lang-drawer-overlay.open { display: block; }

  .lang-drawer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #1e293b;
    border-radius: 20px 20px 0 0;
    padding: 20px 16px;
    padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
    z-index: 1200;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.32,0.72,0,1);
  }

  html.dark .lang-drawer { background: #111827; }

  .lang-drawer.open { transform: translateY(0); }

  .lang-drawer-handle {
    width: 40px;
    height: 4px;
    background: #334155;
    border-radius: 2px;
    margin: 0 auto 20px;
  }

  .lang-drawer h3 {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    color: #f1f5f9;
    margin-bottom: 16px;
  }

  .lang-drawer-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .lang-drawer-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 10px;
    background: rgba(255,255,255,0.04);
    color: #cbd5e1;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    border: 1px solid #334155;
  }

  .lang-drawer-item:hover,
  .lang-drawer-item.active {
    background: rgba(225,29,72,0.1);
    border-color: var(--accent-red);
    color: #fff;
  }

  .lang-drawer-item .fi { font-size: 1.3rem; border-radius: 3px; }

  /* ==========================================
     11. ANA İÇERİK ALANI
     ========================================== */
  .page-content {
    padding-bottom: 20px;
  }

  /* ==========================================
     12. SÖZLÜK TABLOSU
     ========================================== */
  .dict-table-wrapper {
    background: var(--light-card-bg);
    border-radius: 0;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    margin-bottom: 20px;
    border: 1px solid var(--light-card-border);
  }

  html.dark .dict-table-wrapper {
    background: var(--dark-card-bg);
    border-color: var(--dark-card-border);
    box-shadow: 0 2px 12px rgba(0,0,0,0.3);
  }

  .dict-table {
    width: 100%;
    border-collapse: collapse;
  }

  .dict-table th {
    background: #111827;
    color: #f1f5f9;
    padding: 12px 16px;
    text-align: center;
    font-family: var(--font-display);
    font-size: var(--text-table-th);
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    border-left: 1px solid #334155;
    border-right: 1px solid #334155;
  }

  .dict-table th:first-child { border-left: none; }
  .dict-table th:last-child  { border-right: none; }

  html[dir="rtl"] .dict-table th { text-align: right; }
  html.dark .dict-table th { background: var(--dark-bg); }

  .dict-table td {
    padding: 10px 16px;
    border-bottom: 1px solid var(--light-td-border);
    font-size: var(--text-table-td);
    vertical-align: middle;
    border-left: 1px solid var(--light-td-border);
    border-right: 1px solid var(--light-td-border);
  }

  .dict-table td:first-child { border-left: none; }
  .dict-table td:last-child  { border-right: none; }

  html.dark .dict-table td {
    border-bottom-color: var(--dark-td-border);
    border-left-color:   var(--dark-td-border);
    border-right-color:  var(--dark-td-border);
    color: #cbd5e1;
  }

  .dict-table tbody tr:last-child td { border-bottom: none; }

  .dict-table tbody tr:hover        { background: var(--light-row-hover); transition: background 0.15s ease; }
  html.dark .dict-table tbody tr:hover { background: var(--dark-row-hover); }

  .dict-table tbody tr:nth-child(even)       { background: var(--light-row-even); }
  html.dark .dict-table tbody tr:nth-child(even) { background: var(--dark-row-even); }

  .text-green { color: var(--accent-green); font-weight: 700; }
  .text-red   { color: var(--accent-error); font-weight: 700; }
  .text-bold  { font-weight: 700; }
  html.dark .text-green { color: #34d399; }
  html.dark .text-red   { color: #f87171; }

  /* ==========================================
     13. SESLENDİRME BUTONU
     ========================================== */
  .btn-speak {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(14,165,233,0.1);
    color: var(--accent-blue);
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid rgba(14,165,233,0.2);
  }

  .btn-speak:hover {
    background: var(--accent-blue);
    color: #fff;
    transform: scale(1.05);
    box-shadow: 0 0 12px rgba(14,165,233,0.4);
  }

  /* ==========================================
     14. SAYFA BAŞLIĞI (.page-title)
     ========================================== */
  .page-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    gap: 12px;
    flex-wrap: wrap;
  }

  .page-title {
    font-family: var(--font-display);
    font-size: var(--text-page-title);
    font-weight: 800;
    color: var(--light-page-title);
  }

  html.dark .page-title { color: var(--dark-page-title); }

  .page-title small {
    display: block;
    font-size: var(--text-page-title-sub);
    font-weight: 400;
    color: var(--light-page-title-sub);
    font-family: var(--font-main);
  }

  html.dark .page-title small { color: var(--dark-page-title-sub); }

  .page-actions {
    margin-left: auto;
    display: flex;
    gap: 6px;
  }

  html[dir="rtl"] .page-actions { margin-left: 0; margin-right: auto; }

  .action-btn {
    width: 36px;
    height: 36px;
    border-radius: 0;
    background: #1e293b;
    color: #94a3b8;
    border: 1px solid #334155;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: var(--text-sm);
  }

  .action-btn:hover { background: #273344; color: #f1f5f9; }
  html.dark .action-btn { background: var(--dark-bg); border-color: #1e293b; }

  /* ==========================================
     15. CAROUSEL NAVİGASYON
     ========================================== */
  .carousel-wrapper { position: relative; }

  .carousel-nav-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    padding: 0 4px;
  }

  .carousel-counter {
    font-size: var(--text-xs);
    color: #64748b;
    font-weight: 600;
  }

  /* ==========================================
     16. MENÜ KARTLARI (.menu-card)
     ========================================== */
  .menu-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 110px;
    border-radius: 12px;
    border: 1px solid var(--light-card-border);
    background: var(--light-card-bg);
    text-decoration: none;
    color: var(--light-card-text);
    transition: all 0.2s ease;
    padding: 16px;
    text-align: center;
  }

  html.dark .menu-card {
    background: var(--dark-card-bg);
    border-color: var(--dark-card-border);
    color: var(--dark-card-text);
  }

  /* İkon */
  .menu-card i {
    font-size: var(--menu-card-icon);
    margin-bottom: 6px;
    display: block;
    transition: transform 0.3s ease;
    color: var(--light-card-icon);
  }

  html.dark .menu-card i { color: var(--dark-card-icon); }

  /* Ana yazı (span) */
  .menu-card span {
    font-weight: 700;
    font-size: var(--text-card-label);
    font-family: var(--font-display);
  }

  /* Alt yazı (small) */
  .menu-card small {
    font-size: var(--text-card-sub);
    color: var(--light-card-sub);
    margin-top: 2px;
  }

  html.dark .menu-card small { color: var(--dark-card-sub); }

  /* Hover durumu */
  .menu-card:hover {
    background: var(--light-card-hover-bg);
    color: var(--light-card-hover-text);
    border-color: var(--light-card-hover-border);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(225,29,72,0.2);
  }

  html.dark .menu-card:hover {
    background: var(--dark-card-hover-bg);
    color: var(--dark-card-hover-text);
    border-color: var(--dark-card-hover-border);
  }

  .menu-card:hover i     { color: #f1f5f9 !important; animation: shake 0.5s 1; }
  .menu-card:hover small { color: #94a3b8; }

  @keyframes shake {
    0%   { transform: rotate(0deg); }
    25%  { transform: rotate(-12deg); }
    50%  { transform: rotate(12deg); }
    75%  { transform: rotate(-12deg); }
    100% { transform: rotate(0deg); }
  }

  /* ==========================================
     17. FOOTER
     ========================================== */
  footer {
    text-align: center;
    padding: 20px 16px;
    color: #64748b;
    font-size: var(--text-sm);
  }
  
  footer small {
  display: block;
  font-size: var(--text-xs);       /* 0.75rem */
  color: var(--light-text-muted);  /* açık temada #475569 */
  line-height: 1.6;
  opacity: 0.8;
}

html.dark footer small {
  color: var(--dark-text-muted);   /* koyu temada #94a3b8 */
}

  /* ==========================================
     18. RESPONSIVE
     ========================================== */
  @media (max-width: 767px) {
    .nav-links   { display: none; }
    .mobile-nav  { display: block; }
    .page-content { padding-bottom: calc(var(--mobile-nav-height) + 20px); }
    .page-title  { font-size: var(--text-page-title-mobile); }
    .dict-table-wrapper {
      overflow-x: auto;
      -webkit-overflow-scrolling: touch;
    }
  }

  @media (min-width: 768px) and (max-width: 1023px) {
    .mobile-nav  { display: none; }
    .main-navbar { display: block; }
  }

  /* ==========================================
     19. TABLO ÖZEL DÜZENLEMELER
     ========================================== */
  .dict-table th small {
    display: block !important;
    font-size: 0.65rem !important;
    font-weight: 400 !important;
    opacity: 0.6 !important;
    text-transform: none !important;
    margin-top: 2px;
  }

  .dict-table th:first-child,
  .dict-table td:first-child {
    width: 56px !important;
    text-align: center !important;
  }

  /* ==========================================
     20. ANA SAYFA BLOKLARI
     ========================================== */
  .section-block { margin-bottom: 32px; }

  .section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--accent-red);
  }

  .section-header.blue   { border-bottom-color: var(--accent-blue); }
  .section-header.purple { border-bottom-color: var(--accent-purple); }

  .section-header-icon { font-size: 1.1rem; color: var(--accent-red); }
  .section-header.blue   .section-header-icon { color: var(--accent-blue); }
  .section-header.purple .section-header-icon { color: var(--accent-purple); }

  .section-header-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: var(--text-section);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
  }

  .section-header-link {
    margin-left: auto;
    font-size: var(--text-xs);
    color: var(--accent-purple);
    text-decoration: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
  }

  .section-header-link i { font-size: 0.65rem; }

  .menu-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
  }

  /* ==========================================
     21. MOBİL TAŞMA ÖNLEMLERİ
     ========================================== */
  @media (max-width: 767px) {
    .menu-grid {
      grid-template-columns: repeat(3, 1fr);
    }
    .menu-card span,
    .menu-card small {
      word-break: break-word !important;
      white-space: normal !important;
    }
  }
