/* ═══════════════════════════════════════════════════════════════
   LMS PROFESSIONAL ENHANCEMENTS
   Cisco NetAcad / Coursera / Udemy Style Upgrades
   ═══════════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────────────────────────
   LESSON SIDEBAR ENHANCEMENTS
   ───────────────────────────────────────────────────────────── */

.lesson-item {
    position: relative;
    border-left: 3px solid transparent !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.lesson-item:hover {
    padding-left: 1.25rem !important;
    border-left-color: var(--c) !important;
    background: rgba(0, 212, 255, 0.1) !important;
    transform: translateX(4px);
}

.lesson-item.active {
    background: linear-gradient(90deg, rgba(0, 212, 255, 0.2), rgba(0, 212, 255, 0.05)) !important;
    border-left-color: var(--c) !important;
    color: var(--c) !important;
    font-weight: 600 !important;
    padding-left: 1.25rem !important;
}

/* Lesson completion checkmark */
.lesson-item.completed::after {
    content: '✓';
    position: absolute;
    right: 1rem;
    color: #4caf50;
    font-weight: 700;
    font-size: 1rem;
    animation: scaleIn 0.3s ease-out;
}

/* Quiz sub-item styling */
.lesson-item.quiz-sub-item {
    padding-left: 2rem !important;
    font-size: 0.85rem !important;
    opacity: 0.9;
    border-left: 3px solid transparent !important;
}

.lesson-item.quiz-sub-item::before {
    content: '→';
    position: absolute;
    left: 1.75rem;
    color: var(--c);
    font-weight: 700;
    opacity: 0.6;
}

.lesson-item.quiz-sub-item:hover::before {
    opacity: 1;
}

.lesson-item.quiz-sub-item.active {
    background: rgba(0, 212, 255, 0.15) !important;
    border-left-color: var(--c) !important;
}

/* ─────────────────────────────────────────────────────────────
   LESSON HEADER ENHANCEMENTS
   ───────────────────────────────────────────────────────────── */

.lesson-header {
    padding: 2rem 2.5rem;
    background: linear-gradient(135deg, rgba(0, 180, 219, 0.08) 0%, rgba(0, 150, 180, 0.04) 100%);
    border-bottom: 1px solid var(--bdr);
    position: relative;
    overflow: hidden;
}

.lesson-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--c), var(--c2), var(--c));
    background-size: 200%;
    animation: shimmer 3s linear infinite;
}

.lesson-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--tw);
    margin-bottom: 0.5rem;
    font-family: 'Orbitron', monospace;
}

.lesson-subtitle {
    color: var(--tm);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.lesson-progress-bar {
    height: 4px;
    background: var(--bg3);
    border-radius: 2px;
    margin-top: 1.5rem;
    overflow: hidden;
}

.lesson-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--c), var(--c2));
    border-radius: 2px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─────────────────────────────────────────────────────────────
   QUIZ CARD ENHANCEMENTS
   ───────────────────────────────────────────────────────────── */

.quiz-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    border: 1px solid var(--bdr) !important;
    position: relative;
    overflow: hidden;
}

.quiz-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 212, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.quiz-card:hover {
    border-color: var(--c) !important;
    box-shadow: 0 8px 24px rgba(0, 212, 255, 0.15) !important;
    transform: translateY(-4px);
}

.quiz-card:hover::before {
    left: 100%;
}

.quiz-card.has-attempt {
    border-left: 4px solid var(--c) !important;
}

/* ─────────────────────────────────────────────────────────────
   QUIZ QUESTION ENHANCEMENTS
   ───────────────────────────────────────────────────────────── */

.quiz-question {
    transition: all 0.3s ease !important;
    border: 1px solid var(--input-border) !important;
    position: relative;
}

.quiz-question:focus-within {
    border-color: var(--c) !important;
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1) !important;
}

.quiz-question-number {
    background: linear-gradient(135deg, var(--c), var(--c2)) !important;
    box-shadow: 0 4px 12px rgba(0, 212, 255, 0.3) !important;
    animation: fadeInScale 0.4s ease-out;
}

/* Answer choice styling */
.quiz-option {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    margin: 0.75rem 0;
    border: 2px solid var(--bdr);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--bg2);
    position: relative;
    overflow: hidden;
}

.quiz-option::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 212, 255, 0.05);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.quiz-option:hover {
    border-color: var(--c);
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.08), rgba(0, 212, 255, 0.02));
    transform: translateX(8px);
}

.quiz-option input[type="radio"]:checked + * {
    color: var(--c);
}

.quiz-option input[type="radio"]:checked ~ * {
    font-weight: 600;
}

.quiz-option.selected {
    border-color: var(--c) !important;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.15), rgba(0, 212, 255, 0.05)) !important;
    box-shadow: inset 0 0 12px rgba(0, 212, 255, 0.1);
}

/* ─────────────────────────────────────────────────────────────
   PROGRESS INDICATOR
   ───────────────────────────────────────────────────────────── */

.quiz-progress-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1rem;
    background: var(--bg2);
    border-radius: 8px;
    border: 1px solid var(--bdr);
}

.quiz-progress-bar {
    flex: 1;
    height: 6px;
    background: var(--bg3);
    border-radius: 3px;
    overflow: hidden;
}

.quiz-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--c), var(--c2));
    border-radius: 3px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 8px rgba(0, 212, 255, 0.4);
}

.quiz-progress-text {
    font-size: 0.85rem;
    color: var(--tm);
    font-weight: 600;
    min-width: 60px;
    text-align: right;
}

/* ─────────────────────────────────────────────────────────────
   QUIZ RESULT ENHANCEMENTS
   ───────────────────────────────────────────────────────────── */

.score-circle {
    animation: slideInScale 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
    box-shadow: 0 8px 32px rgba(0, 212, 255, 0.2) !important;
    position: relative;
}

.score-circle::after {
    content: '';
    position: absolute;
    inset: -3px;
    border: 2px solid var(--c);
    border-radius: 50%;
    opacity: 0;
    animation: pulse-ring 2s ease-out infinite;
}

.score-text {
    animation: countUp 1s ease-out;
}

/* Pass/Fail Badge */
.result-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    animation: slideInUp 0.5s ease-out 0.2s both;
}

.result-badge.passed {
    background: rgba(76, 175, 80, 0.15);
    border: 2px solid #4caf50;
    color: #4caf50;
}

.result-badge.failed {
    background: rgba(244, 67, 54, 0.15);
    border: 2px solid #f44336;
    color: #f44336;
}

/* Stats cards */
.stat-card {
    background: var(--bg2) !important;
    border: 1px solid var(--bdr) !important;
    border-radius: 12px !important;
    padding: 1.5rem !important;
    text-align: center !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--c), var(--c2));
    transform: scaleX(0);
    transform-origin: left;
    animation: slideIn 0.5s ease-out forwards;
}

.stat-card:hover {
    border-color: var(--c) !important;
    box-shadow: 0 12px 32px rgba(0, 212, 255, 0.15) !important;
    transform: translateY(-8px);
}

.stat-label {
    font-size: 0.75rem !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    color: var(--tm) !important;
    margin-bottom: 1rem !important;
    font-weight: 700 !important;
}

.stat-value {
    font-size: 2.2rem !important;
    color: var(--c) !important;
    font-weight: 800 !important;
    font-family: 'Orbitron', monospace;
    animation: fadeInScale 0.6s ease-out 0.3s both;
}

/* ─────────────────────────────────────────────────────────────
   RESULT HERO SECTION
   ───────────────────────────────────────────────────────────── */

.result-hero {
    background: linear-gradient(135deg, rgba(0, 180, 219, 0.15) 0%, rgba(0, 150, 180, 0.08) 100%) !important;
    position: relative;
    overflow: hidden;
}

.result-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--c), transparent);
}

.result-title {
    animation: fadeInUp 0.6s ease-out;
}

/* ─────────────────────────────────────────────────────────────
   BUTTON ENHANCEMENTS
   ───────────────────────────────────────────────────────────── */

.quiz-button,
.action-btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.quiz-button::before,
.action-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.quiz-button:hover::before,
.action-btn:hover::before {
    width: 300px;
    height: 300px;
}

.quiz-button--primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 24px rgba(0, 212, 255, 0.3) !important;
}

.action-btn.primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 24px rgba(0, 212, 255, 0.3) !important;
}

.action-btn.secondary:hover {
    border-color: var(--c) !important;
    background: rgba(0, 212, 255, 0.08) !important;
    color: var(--c) !important;
}

/* ─────────────────────────────────────────────────────────────
   ANIMATIONS
   ───────────────────────────────────────────────────────────── */

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

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

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

@keyframes slideIn {
    from {
        transform: scaleX(0);
    }
    to {
        transform: scaleX(1);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulse-ring {
    from {
        transform: scale(1);
        opacity: 1;
    }
    to {
        transform: scale(1.3);
        opacity: 0;
    }
}

@keyframes shimmer {
    from {
        background-position: 0% 0%;
    }
    to {
        background-position: 200% 0%;
    }
}

@keyframes countUp {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ═════════════════════════════════════════════════════════════
   LIGHT MODE OVERRIDES FOR LMS ENHANCEMENTS
   ═════════════════════════════════════════════════════════════ */

/* Lesson sidebar items: hover & active states */
[data-theme="light"] .lesson-item:hover {
    background: rgba(0, 98, 204, 0.08) !important;
    border-left-color: #0062cc !important;
}

[data-theme="light"] .lesson-item.active {
    background: linear-gradient(90deg, rgba(0, 98, 204, 0.12), rgba(0, 98, 204, 0.04)) !important;
    border-left-color: #0062cc !important;
    color: #0062cc !important;
}

[data-theme="light"] .lesson-item.quiz-sub-item.active {
    background: rgba(0, 98, 204, 0.10) !important;
    border-left-color: #0062cc !important;
}

/* Lesson header: remove cyan gradient, use subtle blue */
[data-theme="light"] .lesson-header {
    background: linear-gradient(135deg, rgba(0, 98, 204, 0.05) 0%, rgba(0, 98, 204, 0.02) 100%) !important;
}

[data-theme="light"] .lesson-header::before {
    background: linear-gradient(90deg, #0062cc, #004fa3, #0062cc) !important;
}

/* Quiz cards: hover shimmer effect */
[data-theme="light"] .quiz-card::before {
    background: linear-gradient(90deg, transparent, rgba(0, 98, 204, 0.06), transparent) !important;
}

[data-theme="light"] .quiz-card:hover {
    border-color: #0062cc !important;
    box-shadow: 0 8px 24px rgba(0, 98, 204, 0.12) !important;
}

/* Quiz question focus state */
[data-theme="light"] .quiz-question:focus-within {
    border-color: #0062cc !important;
    box-shadow: 0 0 0 3px rgba(0, 98, 204, 0.12) !important;
}

[data-theme="light"] .quiz-question-number {
    box-shadow: 0 4px 12px rgba(0, 98, 204, 0.2) !important;
}

/* Quiz options: hover and selected states */
[data-theme="light"] .quiz-option {
    background: #ffffff !important;
}

[data-theme="light"] .quiz-option:hover {
    background: linear-gradient(135deg, rgba(0, 98, 204, 0.06), rgba(0, 98, 204, 0.01)) !important;
    border-color: rgba(0, 98, 204, 0.2) !important;
}

[data-theme="light"] .quiz-option::before {
    background: rgba(0, 98, 204, 0.04) !important;
}

[data-theme="light"] .quiz-option.selected {
    background: linear-gradient(135deg, rgba(0, 98, 204, 0.10), rgba(0, 98, 204, 0.03)) !important;
    border-color: #0062cc !important;
}

[data-theme="light"] .quiz-option.selected::before {
    background: rgba(0, 98, 204, 0.08) !important;
}

/* Quiz progress bar */
[data-theme="light"] .quiz-progress-fill {
    box-shadow: 0 0 8px rgba(0, 98, 204, 0.25) !important;
}

/* Correct/Incorrect feedback styling */
[data-theme="light"] .quiz-option.correct {
    background: linear-gradient(135deg, rgba(22, 163, 74, 0.08), rgba(22, 163, 74, 0.02)) !important;
    border-color: #16a34a !important;
}

[data-theme="light"] .quiz-option.incorrect {
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.08), rgba(220, 38, 38, 0.02)) !important;
    border-color: #dc2626 !important;
}

/* ─────────────────────────────────────────────────────────────
   RESPONSIVE ADJUSTMENTS
   ───────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
    .lesson-title {
        font-size: 1.4rem;
    }

    .stat-value {
        font-size: 1.8rem !important;
    }

    .quiz-button,
    .action-btn {
        width: 100%;
    }

    .lesson-item:hover {
        transform: none;
    }

    .quiz-option:hover {
        transform: none;
    }
}
