:root {
    --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    --card-bg: rgba(30, 41, 59, 0.7);
    --card-border: rgba(255, 255, 255, 0.1);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --danger: #ef4444;
    --success: #10b981;
    --glass-blur: 12px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
}

body {
    background: var(--bg-gradient);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    overflow: hidden;
}

.app-container {
    display: flex;
    width: 100vw;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background: var(--card-bg);
    border-right: 1px solid var(--card-border);
    backdrop-filter: blur(var(--glass-blur));
    padding: 2rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    z-index: 10;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-primary);
    padding: 0 1rem;
}

.logo-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: linear-gradient(45deg, var(--accent), #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 12px 1rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    font-weight: 500;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.nav-btn.active {
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent);
    border-right: 3px solid var(--accent);
    border-radius: 8px 0 0 8px;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.top-bar {
    padding: 1.5rem 3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--card-border);
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(var(--glass-blur));
}

#section-title {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.controls {
    display: flex;
    gap: 1rem;
}

.action-btn {
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.action-btn.primary {
    background: var(--accent);
    color: white;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.action-btn.primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.action-btn.secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid var(--card-border);
}

.action-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

/* Quiz Wrapper */
.quiz-container {
    flex: 1;
    overflow-y: auto;
    padding: 2rem 3rem;
    scroll-behavior: smooth;
}

.quiz-container::-webkit-scrollbar {
    width: 8px;
}

.quiz-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.quiz-wrapper {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding-bottom: 4rem;
}

/* Question Card */
.question-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 24px;
    backdrop-filter: blur(var(--glass-blur));
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, border-color 0.3s ease;
    animation: fadeIn 0.5s ease backwards;
}

.question-card:hover {
    border-color: rgba(59, 130, 246, 0.5);
    transform: translateY(-2px);
}

.question-header {
    margin-bottom: 20px;
}

.question-text {
    font-size: 1.15rem;
    line-height: 1.6;
    color: var(--text-primary);
}

.options-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.option-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 16px;
    color: var(--text-secondary);
    text-align: left;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1rem;
    display: flex;
    align-items: center;
}

.option-btn .option-key {
    font-weight: 700;
    margin-right: 12px;
    background: rgba(255, 255, 255, 0.1);
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
}

.option-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
}

.option-btn.selected {
    background: rgba(59, 130, 246, 0.15);
    border-color: var(--accent);
    color: white;
}

.option-btn.selected .option-key {
    background: var(--accent);
}

.option-btn.correct {
    background: rgba(16, 185, 129, 0.15) !important;
    border-color: var(--success) !important;
    color: white !important;
}

.option-btn.correct .option-key {
    background: var(--success) !important;
}

.option-btn.wrong {
    background: rgba(239, 68, 68, 0.15) !important;
    border-color: var(--danger) !important;
    color: white !important;
}

.option-btn.wrong .option-key {
    background: var(--danger) !important;
}

.feedback {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    display: none;
    animation: slideDown 0.3s ease;
}

.feedback.show {
    display: block;
}

.feedback.correct-feedback {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.feedback.wrong-feedback {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   Expert Mode CSS
   ========================================================================== */
.expert-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.05);
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid var(--card-border);
    cursor: help;
}

.toggle-label {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.2);
    transition: .4s;
}

.slider.round {
    border-radius: 24px;
}

.slider.round:before {
    border-radius: 50%;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
}

input:checked + .slider {
    background-color: var(--accent);
}

input:checked + .slider:before {
    transform: translateX(20px);
}

/* Submit Button & Wrapper */
.submit-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 1rem;
    margin-bottom: 3rem;
}

.submit-btn {
    padding: 15px 40px;
    font-size: 1.1rem;
    border-radius: 12px;
}

/* Expert Summary Box */
.expert-summary {
    background: var(--card-bg);
    border: 2px solid var(--accent);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 2rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    backdrop-filter: blur(var(--glass-blur));
    box-shadow: 0 8px 32px rgba(59, 130, 246, 0.15);
    animation: fadeIn 0.4s ease;
}

.summary-title {
    font-size: 1.4rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    text-align: center;
}

.summary-stats {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.stat-box {
    text-align: center;
    padding: 15px 25px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    min-width: 120px;
}

.stat-box .count {
    font-size: 2rem;
    font-weight: 700;
    display: block;
    margin-bottom: 5px;
}

.stat-box.st-correct .count { color: var(--success); }
.stat-box.st-wrong .count { color: var(--danger); }
.stat-box.st-unanswered .count { color: var(--text-secondary); }

.incorrect-list {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.incorrect-item {
    background: rgba(239, 68, 68, 0.1);
    border-left: 4px solid var(--danger);
    padding: 12px 16px;
    border-radius: 4px;
}

.incorrect-item h4 {
    margin-bottom: 8px;
    color: var(--text-primary);
    font-size: 1.05rem;
}

.incorrect-item p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}
.incorrect-item .correct-ans {
    color: var(--success);
    font-weight: 600;
    margin-top: 4px;
    display: inline-block;
}

/* ==========================================================================
   Responsive Design / Mobil Uyumluluk
   ========================================================================== */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }

    /* Sidebar becomes a top header */
    .sidebar {
        width: 100%;
        padding: 1rem;
        flex-direction: column;
        border-right: none;
        border-bottom: 1px solid var(--card-border);
        gap: 1rem;
        z-index: 20;
    }

    .logo {
        padding: 0;
        align-self: flex-start;
    }

    .nav-menu {
        flex-direction: row;
        width: 100%;
        gap: 0.5rem;
    }

    .nav-btn {
        flex: 1;
        justify-content: center;
        padding: 10px 5px;
        font-size: 0.9rem;
        text-align: center;
    }

    .nav-btn.active {
        border-right: none;
        border-bottom: 3px solid var(--accent);
        border-radius: 8px 8px 0 0;
        background: rgba(59, 130, 246, 0.15);
    }

    /* Top bar adjustments */
    .top-bar {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
    }

    #section-title {
        align-self: flex-start;
        font-size: 1.25rem;
    }

    .controls {
        width: 100%;
        gap: 0.5rem;
    }

    .action-btn {
        flex: 1;
        justify-content: center;
        padding: 10px 5px;
        font-size: 0.85rem;
    }

    /* Quiz Container adjustments */
    .quiz-container {
        padding: 1rem;
    }

    .quiz-wrapper {
        gap: 1.25rem;
        padding-bottom: 2rem;
    }

    .question-card {
        padding: 16px;
    }

    .question-text {
        font-size: 1.05rem;
    }

    .option-btn {
        padding: 12px;
        font-size: 0.95rem;
    }
}
