:root {
            --primary: #2c3e50;
            --accent: #3498db;
            --accent-hover: #2980b9;
            --light: #ecf0f1;
            --success: #27ae60;
            --danger: #c0392b;
            
            --font-ui: 'Rubik', sans-serif;
            --font-arabic: 'Noto Naskh Arabic', serif; 
            
            --sidebar-width: 280px;
        }

        body {
            font-family: var(--font-ui);
            margin: 0;
            padding: 0;
            background-color: #f0f2f5;
            color: #333;
            min-height: 100vh;
            display: flex;
            flex-direction: column;
            line-height: 1.4; /* Genel satır aralığı */
        }

     header {
    background-color: var(--primary);
    color: white;
    padding: 0.8rem 2rem;
    display: flex;
    justify-content: space-between; 
    align-items: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    z-index: 2000; /* En üst katmanda olması için */
    position: fixed; /* Sayfaya sabitler */
    top: 0;
    left: 0;
    right: 0;
    height: 40px; /* Sabit yükseklik */
}

        h1 { margin: 0; font-size: 1.6rem; font-weight: 600; letter-spacing: -0.5px; }

        .year-selector select {
            padding: 10px 18px;
            border-radius: 8px;
            border: 2px solid rgba(255,255,255,0.2);
            font-size: 1rem;
            font-weight: 500;
            cursor: pointer;
            background-color: rgba(255,255,255,0.1);
            color: white;
            font-family: var(--font-ui);
            outline: none;
        }
        .year-selector select option { color: #333; background: white; }

        /* --- ANA YERLEŞİM --- */
    .app-container {
    display: block;
    margin-top: 70px; /* Header'ın kapladığı alanı boş bırakır */
}
        /* --- SOL PANEL (Sidebar) --- */
        .sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width); /* Daralmayı engellemek için eklendi */
    background: white;
    padding: 20px;
    box-shadow: 2px 0 5px rgba(0,0,0,0.05);
    
    /* Sticky ve Kaydırma Özellikleri */
    position: sticky;
    top: 20px;
    align-self: flex-start; /* Sticky'nin çalışması için kritik */
    height: calc(100vh - 40px);
    overflow-y: auto;
    
    /* İçeriklerin dışarı taşmaması için */
    box-sizing: border-box; 
}

        .sidebar-title {
            font-size: 1rem;
            font-weight: 700;
            color: #95a5a6;
            margin-bottom: 15px;
            text-transform: uppercase;
            letter-spacing: 1px;
        }

        /* --- SEKMELER (2 Sütun) --- */
        .tabs {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 12px;
            margin-bottom: 25px;
        }

        /* Sekme Butonları */
.tab-btn {
    white-space: nowrap; /* Yazıların alt alta gelmesini önler */
    padding: 8px 18px;
    border-radius: 25px;
    border: 1px solid #cbd5e1;
    background: white;
    color: #64748b;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s;
}

        .tab-btn:hover {
    background: #f1f5f9;
}

        .tab-btn.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    box-shadow: 0 2px 6px rgba(52, 152, 219, 0.3);
}

        /* --- SINAV KONTROLLERİ --- */
        .exam-controls {
            display: flex;
            flex-direction: column;
            gap: 12px;
            margin-top: 25px;
            padding-top: 25px;
            border-top: 2px dashed #eee;
        }

        .action-btn {
            width: 100%;
            padding: 15px;
            background: var(--success);
            color: white;
            border: none;
            border-radius: 10px;
            cursor: pointer;
            font-weight: 600;
            font-size: 1.2rem;
            transition: filter 0.3s;
            font-family: var(--font-ui);
        }
        .action-btn:hover { filter: brightness(1.1); }

        .timer-display {
            font-size: 2.2rem;
            font-family: 'Rubik', sans-serif;
            font-variant-numeric: tabular-nums;
            font-weight: 700;
            color: var(--danger);
            text-align: center;
            display: none;
            background: #fff5f5;
            padding: 15px;
            border-radius: 12px;
            border: 2px solid #fed7d7;
            margin-bottom: 10px;
        }



        .content-area {
    margin-left: 0 !important;
    padding: 0 !important;
    width: 100% !important;
}
.tabs-scroll-container::-webkit-scrollbar {
    display: none; /* Chrome/Safari için scroll gizle */
}

.tabs-scroll-container {
    max-width: 1200px;
    justify-content: center;
    margin: 0 auto;
    display: flex;
    gap: 8px;
    padding: 0 15px;
    overflow-x: auto; /* Mobilde butonlar sağa kaysın */
    scrollbar-width: none; /* Firefox için scroll gizle */
}
.horizontal-tabs-nav {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    padding: 10px 0;
    position: sticky;
    top: 70px; /* Header'ın hemen bitiminde sabitlenir */
    z-index: 1001; /* Header'ın bir alt katmanı */
}
        /* --- SORU KARTI --- */
        .question-card {
            background: white;
            border-radius: 16px;
            padding: 35px;
            margin-bottom: 30px;
            box-shadow: 0 4px 25px rgba(0,0,0,0.03);
            border: 1px solid #fff;
border-left: 6px solid #ccc; /* Varsayılan */
        }

        .q-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px; /* Başlık ile metin arası azaltıldı */
            color: #94a3b8;
            font-weight: 600;
            font-size: 0.9rem;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        /* TÜRKÇE SORU KÖKÜ (LTR ve SOLA YASLI) */
        .q-text-tr {
            direction: ltr !important; /* LTR Zorunlu */
            text-align: left !important; /* Sola Yaslı Zorunlu */
            font-family: var(--font-ui);
            font-size: 1.0rem;
            margin-bottom: 15px;
            color: #334155;
            font-weight: 500;
            border-left: 5px solid var(--accent);
            padding: 10px 20px;
            background: #f8fafc;
            border-radius: 0 8px 8px 0;
            line-height: 1.5;
        }

        /* ARAPÇA METİN STİLİ (SATIR ARALIĞI DÜZENLENDİ) */
        .q-text {
            font-family: var(--font-arabic);
            font-size: 1.8rem;
            font-weight: 500;
            direction: rtl;
            line-height: 1.6; /* 2.2'den 1.6'ya düşürüldü */
            margin-bottom: 25px; /* Alt boşluk azaltıldı */
            text-align: right;
            color: #1e293b;
            padding: 0 5px;
        }

        /* --- SEÇENEKLER (Options) --- */
        .options {
            display: flex;
            flex-direction: column;
            gap: 12px;
        }

        /* Şıkların genel kutusu */
.options.grid-layout {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* Masaüstünde 2 sütun */
    gap: 12px;
    width: 100%;
    box-sizing: border-box;
}

/* Tüm şıklar için esneklik ayarı */
.option {
    display: flex;
    align-items: center;
    width: 100%; /* Kendi sütununa tam sığsın */
    box-sizing: border-box;
    word-break: break-word; /* Uzun kelimeleri böl */
    overflow-wrap: break-word; /* Taşmayı engelle */
    white-space: normal; /* Metnin alt satıra geçmesine izin ver */
}

/* 5. Şık (E) Ayarı - Masaüstünde ortalı, mobilde tam genişlik */
.options.grid-layout .option:last-child:nth-child(odd) {
    grid-column: 1 / span 2;
    justify-self: center;
    width: 50%; /* Masaüstünde diğerleriyle aynı boyda */
}

/* TABLET VE MOBİL AYARI (Taşmayı bitiren kısım) */
@media (max-width: 768px) {
    .options.grid-layout {
        display: flex; /* Grid'i kapat, esnek yapıya geç */
        flex-direction: column; /* Her şeyi alt alta diz */
        gap: 10px;
    }

    .options.grid-layout .option, 
    .options.grid-layout .option:last-child:nth-child(odd) {
        width: 100% !important; /* Mobilde istisnasız hepsi tam genişlik */
        min-width: 0 !important; /* Minimum genişlik engelini kaldır */
        margin: 0;
    } 

.q-text {
        font-size: 1.1rem !important; /* Masaüstünde genelde 1.2rem veya daha fazladır */
        line-height: 1.5;
        margin-bottom: 12px;
    }

.opt-label {
    font-size: 0.9rem !important; /* Harflerin boyutu */
    font-weight: 600;            /* Biraz kalın durması okunaklılığı artırır */
    color: #64748b;              /* Çok baskın olmaması için hafif gri ton */
    min-width: 25px;             /* Harflerin genişliği */
}
    
    .opt-text {
        font-size: 1rem !important; /* Mobilde yazıyı biraz küçült ki taşmasın */
        line-height: 1.4;
    }
}
        /* ŞIK KUTUSU (LTR Çerçeve) */
        .option {
            padding: 10px 20px;
            border: 2px solid #e2e8f0;
            border-radius: 12px;
            cursor: pointer;
            
            /* LTR Flexbox Düzeni: Etiket Solda, Metin Sağda */
            display: flex;
            flex-direction: row; 
            align-items: center;
            justify-content: space-between;
            gap: 15px;
            
            direction: ltr; 
            background: #fff;
            transition: all 0.2s;
        }

        .option:hover {
            background-color: #f8fafc;
            border-color: #cbd5e1;
            transform: translateY(-2px);
        }

        .option.selected {
            border-color: var(--accent);
            background-color: #f0f9ff;
            box-shadow: 0 4px 12px rgba(52, 152, 219, 0.15);
        }

        .option.correct {
            border-color: var(--success) !important;
            background-color: #dcfce7 !important;
            color: #14532d;
        }

        .option.wrong {
            border-color: var(--danger) !important;
            background-color: #fee2e2 !important;
            color: #7f1d1d;
        }
        
        /* ŞIK ETİKETİ (SOLDA) */
        .opt-label {
            font-weight: 700;
            color: var(--primary);
            font-family: var(--font-ui);
            font-size: 1.2rem;
            min-width: 30px;
            text-align: left;
        }
        
        /* ŞIK METNİ (SAĞDA ve RTL) */
        .opt-text {
            font-family: var(--font-arabic);
            font-size: 1.8rem;
            font-weight: 500;
            flex-grow: 1; 
            text-align: right; /* Sağa Yasla */
            direction: rtl; /* İçerik Yönü RTL */
            line-height: 1.5;
        }

        /* --- MOBİL --- */
        @media (max-width: 900px) {
            .app-container { flex-direction: column; padding: 15px; }
            .sidebar { width: 100%; position: relative; top: 0; margin-bottom: 20px; }
            .tabs { grid-template-columns: repeat(4, 1fr); }
            .options.grid-layout .option:nth-child(5) { width: 100%; }
        }
        @media (max-width: 600px) {
            .tabs { grid-template-columns: repeat(2, 1fr); }
            header { flex-direction: column; gap: 10px; text-align: center; }
            .options.grid-layout { display: flex; } 
            .options.grid-layout .option:nth-child(5) { width: auto; margin: 0; }
        }

        /* --- DİĞER PENCERELER --- */
        #result-screen {
            display: none; text-align: center; padding: 40px; background: white; border-radius: 16px;
            box-shadow: 0 10px 30px rgba(0,0,0,0.05);
        }
        .score-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin: 30px 0; }
        .score-card { padding: 20px; border-radius: 12px; background: #f8fafc; border: 1px solid #f1f5f9; }
        .score-num { font-size: 2.2rem; font-weight: 700; display: block; margin-bottom: 5px; font-family: 'Rubik', sans-serif; }
        .score-label { font-size: 0.85rem; color: #64748b; text-transform: uppercase; font-weight: 600; letter-spacing: 1px; }

        .modal {
            display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%;
            background-color: rgba(44, 62, 80, 0.7); backdrop-filter: blur(4px);
        }
        .modal-content {
            background-color: white; margin: 10% auto; width: 90%; max-width: 600px;
            border-radius: 16px; animation: slideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);
            box-shadow: 0 20px 50px rgba(0,0,0,0.2);
        }
        @keyframes slideDown { from { transform: translateY(50px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
        .modal-header { background: var(--primary); color: white; padding: 20px 25px; display: flex; justify-content: space-between; align-items: center; }
        .modal-body { padding: 30px; font-size: 1.1rem; line-height: 1.7; color: #334155; }
        .close-btn { font-size: 24px; cursor: pointer; color: rgba(255,255,255,0.8); }
        .explanation-btn { 
            margin-top: 15px; background: #f1f5f9; border: none; color: var(--accent); padding: 10px 20px; border-radius: 30px;
            cursor: pointer; font-size: 0.95rem; font-weight: 600; display: inline-flex; align-items: center; gap: 8px; transition: all 0.2s;
        }
        .explanation-btn:hover { background: #e2e8f0; color: var(--accent-hover); }

        body.exam-mode .tabs, body.exam-mode .sidebar-title, body.exam-mode .explanation-btn { display: none; }
        body.exam-mode .year-selector { visibility: hidden; }
        body.exam-mode .option.correct, body.exam-mode .option.wrong { background-color: #fff !important; border-color: #e2e8f0 !important; color: inherit !important; }
        body.exam-mode .option.selected { border-color: var(--accent) !important; background-color: #f0f9ff !important; }
/* --- Geri Tuşu Tasarımı --- */
.back-button-container {
    flex: 1; /* Sol tarafın genişliğini ayarlar */
    display: flex;
    justify-content: flex-start;
}

/* Yıl Seçici Konumu */
.year-selector-container {
    flex: 1; /* Sağ tarafın genişliğini ayarlar */
    display: flex;
    justify-content: flex-end;
}
.header-title-group {
    flex: 2; /* Orta kısmın daha geniş olmasını sağlar */
    display: flex;
    flex-direction: column;
    align-items: center; /* İçeriği yatayda ortalar */
    text-align: center;
}
.back-button {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    cursor: pointer;
    width: 42px;
    height: 42px;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.back-button:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05); /* Sağa kayma yerine hafif büyüme daha şık durur */
}

.back-button svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

/* Mobilde başlığın düzenini korumak için */
@media (max-width: 600px) {
    @media (max-width: 600px) {
    header {
        flex-direction: row !important; /* Yan yana dizilim */
        height: 50px;
        padding: 0 10px;
    }
    h1 { font-size: 1.2rem; }
    .back-button {
        width: 32px !important;
        height: 32px !important;
        min-width: 32px;
        order: 1; /* En solda */
    }
    .back-button svg { width: 18px; height: 18px; }
/* 2. Başlık (Ortada ve Küçük) */
    header div[style*="flex-direction: column"] {
        order: 2; /* Ortada */
        flex-grow: 1;
    }
    header span[style*="font-size: 2.2rem"] { display: none; } /* Emoji gizle (yer kazanmak için) */
    
    h1 { 
        font-size: 1rem !important; 
        white-space: nowrap;
    }
    header small { font-size: 0.7rem !important; }

    /* 3. Yıl Seçici (Sağda ve Küçük) */
    .year-selector {
        order: 3; /* En sağda */
    }
    .year-selector select {
        padding: 5px 8px !important;
        font-size: 0.8rem !important;
        height: 32px;
    }
    
    /* Sticky Pozisyonlarını Mobilde Güncelleme */
    .horizontal-tabs-nav { top: 60px; }
    #sticky-instruction { top: 110px !important; }
}
}
/* Kategori Renk Tanımlamaları */
.q-card-kelime { border-left: 8px solid #f39c12 !important; }    /* Turuncu */
.q-card-dilbilgisi { border-left: 8px solid #27ae60 !important; } /* Yeşil */
.q-card-ceviri { border-left: 8px solid #9b59b6 !important; }     /* Mor */
.q-card-paragraf { border-left: 8px solid #2980b9 !important; }   /* Mavi */
.q-card-diyalog { border-left: 8px solid #e74c3c !important; }    /* Kırmızı */

.progress-container {
    width: 100%;
    height: 12px;
    background-color: #dfe6e9;
    border-radius: 10px;
    overflow: hidden; /* İçteki barın köşelerden taşmaması için */
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

#progress-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #4facfe);
    border-radius: 10px;
    transition: width 0.4s ease; /* Çubuğun kayarak ilerlemesi için */
}
#progress-wrapper {
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 9999;
    background-color: #f0f2f5;
    padding: 15px 0;
    margin-bottom: 20px;
    border-bottom: 2px solid #ddd;
}

/* Arapça ve Türkçe karışık metinlerin olduğu sınıfa ekleyin */
.q-text, .opt-text, #modalText {
    unicode-bidi: plaintext; /* Metin içeriğine göre yönü otomatik seçer */
    text-align: start;       /* Dile göre otomatik sağa veya sola yaslar */
    direction: ltr;          /* Varsayılanı LTR yapın, Arapça gelince kendi dönecektir */
}

/* Eğer aynı satırda ikisi de olacaksa kapsayıcıya bu özelliği verin */
.mixed-content {
    unicode-bidi: isolate; 
}
#sticky-instruction {
    position: sticky !important; 
    top: 130px !important; /* Header + Kategori Menüsü toplam yüksekliği */
    z-index: 1000;
    background: #ffffff;
    border-bottom: 3px solid var(--accent);
    padding: 15px 25px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    display: block; /* Görünür olduğundan emin olun */
}

/* Sidebar'ı iptal et ve ana içeriği tam genişlik yap */
.sidebar {
    display: none; /* Eskisini gizle */
}

.main-content {
    margin-left: 0 !important; /* Soldaki boşluğu kaldır */
    padding: 20px;
    width: 100%;
}

/* Yeni Yatay Menü Stili */
.horizontal-menu {
    background: white;
    border-bottom: 1px solid #e2e8f0;
    padding: 10px 0;
    position: sticky;
    top: 60px; /* Header yüksekliğine göre ayarla */
    z-index: 100;
    overflow-x: auto; /* Çok buton varsa kaydırılabilir olsun */
    white-space: nowrap;
}

.menu-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    gap: 10px;
    padding: 0 20px;
}

.filter-btn {
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid #cbd5e1;
    background: white;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.filter-btn.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}
#sticky-instruction > div {
    max-width: 1000px;      /* Soruların genişliği ile aynı yapın */
    margin: 0 auto;         /* Paneli ortalar */
    display: flex;
    justify-content: center; /* İçindeki metni ortalar */
    align-items: center;
    gap: 15px;
    text-align: center;      /* Çok satırlı metinlerde merkezi hizalama yapar */
}