/* StudyBuddy — Custom styles (Bootstrap utility classes used in HTML for the rest) */

:root {
    --bs-primary: #4361ee;
    --bs-primary-rgb: 67, 97, 238;
    --bs-secondary: #7209b7;
    --bs-secondary-rgb: 114, 9, 183;
    --bs-body-bg: #f8f9ff;
    --bs-body-font-family: 'Nunito', sans-serif;
    --bs-body-color: #333;
    --sb-primary-dark: #3a0ca3;
    --sb-accent: #f72585;
    --sb-success: #4cc9f0;
}

html { font-size: 14px; }
@media (min-width: 768px) { html { font-size: 16px; } }

/* Gradients */
.bg-gradient-primary {
    background: linear-gradient(135deg, var(--bs-primary), var(--bs-secondary)) !important;
}

.hero-gradient {
    background: linear-gradient(135deg, var(--bs-primary), var(--bs-secondary));
}

.topic-hero {
    background: linear-gradient(135deg, var(--bs-primary), var(--sb-primary-dark));
}

.section-header-gradient {
    background: linear-gradient(135deg, var(--bs-primary), var(--bs-secondary));
}

/* Hover lift — shared by subject-card and topic-card */
.hover-lift {
    transition: transform 0.3s, box-shadow 0.3s;
}
.hover-lift:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(var(--bs-primary-rgb), 0.2) !important;
}

/* Language toggle pill */
.lang-toggle {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 4px 16px !important;
    font-weight: 600;
    transition: background 0.3s;
}
.lang-toggle:hover {
    background: rgba(255, 255, 255, 0.35);
}

/* Section number badge */
.section-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    font-weight: 800;
    margin-right: 10px;
    font-size: 1rem;
}

/* Section nav — sticky sidebar */
.section-nav {
    position: sticky;
    top: 80px;
}
.section-nav .nav-link {
    color: #666;
    padding: 8px 16px;
    border-left: 3px solid transparent;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s;
}
.section-nav .nav-link:hover,
.section-nav .nav-link.active {
    color: var(--bs-primary);
    border-left-color: var(--bs-primary);
    background: rgba(var(--bs-primary-rgb), 0.05);
}

/* Quiz nav link in sidebar */
.quiz-nav-link {
    color: var(--bs-primary) !important;
    font-weight: 700 !important;
    border-left-color: var(--sb-accent) !important;
}

/* Section image */
.section-img {
    max-height: 350px;
    object-fit: contain;
}

/* Breadcrumb on dark bg */
.breadcrumb-item a { color: rgba(255, 255, 255, 0.8); text-decoration: none; }
.breadcrumb-item.active { color: white; }
.breadcrumb-item + .breadcrumb-item::before { color: rgba(255, 255, 255, 0.6); }

/* Vocabulary table */
.vocab-table thead th {
    background: var(--bs-primary);
    color: white;
    font-weight: 700;
    border: none;
}
.vocab-table tbody tr:hover {
    background-color: rgba(var(--bs-primary-rgb), 0.05);
}

/* Quiz option buttons */
.quiz-option {
    display: block;
    width: 100%;
    text-align: left;
    padding: 10px 16px;
    margin: 6px 0;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 600;
}
.quiz-option:hover:not(.disabled) {
    border-color: var(--bs-primary);
    background: rgba(var(--bs-primary-rgb), 0.05);
}
.quiz-option.correct {
    border-color: #28a745;
    background: #d4edda;
    color: #155724;
}
.quiz-option.incorrect {
    border-color: #dc3545;
    background: #f8d7da;
    color: #721c24;
}
.quiz-option.disabled {
    pointer-events: none;
    opacity: 0.7;
}

/* Quiz explanation */
.quiz-explanation {
    display: none;
    margin-top: 10px;
    padding: 12px;
    border-radius: 8px;
    background: #e8f4fd;
    border-left: 3px solid var(--sb-success);
}
.quiz-explanation.show {
    display: block;
}

/* Quiz score card */
.quiz-score {
    background: linear-gradient(135deg, var(--bs-primary), var(--bs-secondary));
    color: white;
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    display: none;
    margin-top: 1.5rem;
}
.quiz-score.show {
    display: block;
}
.quiz-score h3 {
    font-weight: 800;
    font-size: 2rem;
}

/* Print */
@media print {
    body { background: white; }
    .section-card {
        break-inside: avoid;
        box-shadow: none !important;
        border: 1px solid #ddd;
    }
}
