/* =============================================
   COURSE PLAYER - Premium Design
   AHDA Brand Colors: #8B0000, #5A0000, #FFD700
   ============================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: #f0f2f5;
}

/* ===== PREMIUM TOP BAR ===== */
.premium-topbar {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    padding: 0.8rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sidebar-toggle {
    background: rgba(255,255,255,0.1);
    border: none;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s;
}

.sidebar-toggle:hover {
    background: rgba(255,255,255,0.2);
    transform: scale(1.05);
}

.course-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    text-decoration: none;
}

.course-badge i {
    font-size: 1.3rem;
    color: #FFD700;
}

.course-badge span {
    font-weight: 600;
    font-size: 0.95rem;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.progress-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(255,255,255,0.1);
    padding: 0.4rem 1rem;
    border-radius: 40px;
}

.progress-label {
    color: white;
    font-size: 0.8rem;
    font-weight: 500;
}

.progress-track {
    width: 100px;
    height: 5px;
    background: rgba(255,255,255,0.2);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #FFD700, #FFA500);
    border-radius: 3px;
    transition: width 0.3s;
}

.close-player {
    background: rgba(255,255,255,0.1);
    border: none;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    color: white;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-player:hover {
    background: rgba(255,255,255,0.2);
    transform: scale(1.05);
}

/* ===== LAYOUT ===== */
.player-layout {
    display: flex;
    min-height: calc(100vh - 70px);
}

/* ===== SIDEBAR ===== */
.premium-sidebar {
    width: 300px;
    background: white;
    border-right: 1px solid #e9ecef;
    height: calc(100vh - 70px);
    position: sticky;
    top: 70px;
    overflow-y: auto;
    transition: all 0.3s;
    box-shadow: 2px 0 10px rgba(0,0,0,0.02);
}

.premium-sidebar::-webkit-scrollbar {
    width: 4px;
}

.premium-sidebar::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.premium-sidebar::-webkit-scrollbar-thumb {
    background: #8B0000;
    border-radius: 4px;
}

.sidebar-head {
    padding: 1.2rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    position: sticky;
    top: 0;
}

.sidebar-head h3 {
    font-size: 1rem;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0;
}

.sidebar-head h3 i {
    color: #8B0000;
    margin-right: 8px;
}

.close-sidebar {
    display: none;
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #999;
}

.sidebar-menu {
    padding: 1rem;
}

.module-item {
    margin-bottom: 1.2rem;
}

.module-title {
    padding: 0.6rem 0.8rem;
    background: #f8f9fa;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #1a1a2e;
}

.module-title i {
    color: #FFD700;
}

.lesson-items {
    padding-left: 1.5rem;
    margin-top: 0.3rem;
}

.lesson-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.5rem 0.8rem;
    text-decoration: none;
    color: #666;
    font-size: 0.75rem;
    border-radius: 8px;
    transition: all 0.2s;
}

.lesson-link:hover {
    background: #f8f9fa;
    color: #8B0000;
}

.lesson-link.active {
    background: rgba(139,0,0,0.08);
    color: #8B0000;
}

.lesson-link.completed {
    color: #28a745;
}

.lesson-icon {
    width: 20px;
    font-size: 0.85rem;
}

.lesson-name {
    flex: 1;
}

.lesson-time {
    font-size: 0.65rem;
    color: #bbb;
}

.quiz-section {
    margin-top: 1rem;
    border-top: 1px solid #e9ecef;
    padding-top: 1rem;
}

.quiz-title {
    background: linear-gradient(135deg, #8B0000, #5A0000);
    color: white;
    padding: 0.6rem 0.8rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.quiz-title i {
    color: #FFD700;
}

/* ===== MAIN CONTENT ===== */
.premium-main {
    flex: 1;
    padding: 2rem;
    max-width: 950px;
    margin: 0 auto;
    width: 100%;
}

.lesson-card {
    background: white;
    border-radius: 24px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}

.lesson-breadcrumb {
    font-size: 0.75rem;
    color: #8B0000;
    margin-bottom: 0.5rem;
}

.lesson-breadcrumb i {
    margin: 0 6px;
    font-size: 0.65rem;
    color: #ccc;
}

.lesson-heading {
    font-size: 1.8rem;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0.5rem 0;
}

.lesson-meta-info {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e9ecef;
}

.meta-item {
    font-size: 0.75rem;
    color: #888;
}

.meta-item i {
    margin-right: 5px;
}

.lesson-body {
    line-height: 1.8;
    color: #444;
    font-size: 0.95rem;
}

.lesson-body h2 {
    font-size: 1.3rem;
    margin: 1.5rem 0 1rem;
    color: #8B0000;
}

.lesson-body h3 {
    font-size: 1.1rem;
    margin: 1rem 0 0.5rem;
}

.lesson-body p {
    margin-bottom: 1rem;
}

.lesson-body ul, .lesson-body ol {
    margin: 1rem 0;
    padding-left: 2rem;
}

.lesson-body li {
    margin-bottom: 0.5rem;
}

/* ===== NAVIGATION ===== */
.lesson-nav {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.nav-prev, .nav-next {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0.6rem 1.3rem;
    background: #f0f0f0;
    color: #333;
    text-decoration: none;
    border-radius: 40px;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.2s;
}

.nav-prev:hover, .nav-next:hover {
    background: #e0e0e0;
    transform: translateY(-2px);
}

.btn-complete {
    background: linear-gradient(135deg, #28a745, #20c997);
    border: none;
    padding: 0.6rem 1.3rem;
    border-radius: 40px;
    color: white;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-complete:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(40,167,69,0.3);
}

.completed-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0.6rem 1.3rem;
    background: #28a745;
    color: white;
    border-radius: 40px;
    font-size: 0.8rem;
    font-weight: 500;
}

.btn-quiz {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #5A0000;
    border: none;
    padding: 0.6rem 1.3rem;
    border-radius: 40px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-quiz:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255,215,0,0.3);
}

.btn-certificate {
    background: linear-gradient(135deg, #8B0000, #5A0000);
    color: white;
    padding: 0.6rem 1.3rem;
    border-radius: 40px;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-certificate:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(139,0,0,0.3);
}

/* ===== QUIZ MODAL ===== */
.quiz-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(5px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.quiz-overlay.show {
    display: flex;
}

.quiz-container {
    background: white;
    border-radius: 28px;
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.quiz-head {
    background: linear-gradient(135deg, #8B0000, #5A0000);
    color: white;
    padding: 1.5rem;
    text-align: center;
    border-radius: 28px 28px 0 0;
}

.quiz-head h2 {
    font-size: 1.5rem;
    margin-bottom: 0.3rem;
}

.quiz-head h2 i {
    color: #FFD700;
    margin-right: 10px;
}

.quiz-body {
    padding: 1.5rem;
}

.question-box {
    background: #f8f9fa;
    border-radius: 16px;
    padding: 1.2rem;
    margin-bottom: 1rem;
    border: 1px solid #e9ecef;
    transition: all 0.2s;
}

.question-text {
    font-weight: 700;
    margin-bottom: 1rem;
    color: #1a1a2e;
}

.question-num {
    color: #8B0000;
    margin-right: 8px;
}

.options-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-left: 1rem;
}

.option-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.option-item:hover {
    border-color: #8B0000;
    background: #fff5f5;
}

.option-item input {
    accent-color: #8B0000;
}

.quiz-submit {
    text-align: center;
    margin-top: 1.5rem;
}

.quiz-submit-btn {
    background: linear-gradient(135deg, #28a745, #20c997);
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 50px;
    color: white;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.quiz-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(40,167,69,0.4);
}

/* ===== ALERT TOAST ===== */
.alert-toast {
    position: fixed;
    top: 90px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    color: white;
    font-weight: 500;
    z-index: 1100;
    animation: slideIn 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-toast.success {
    background: linear-gradient(135deg, #28a745, #20c997);
}

.alert-toast.error {
    background: linear-gradient(135deg, #dc3545, #c82333);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ===== OVERLAY ===== */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 99;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 992px) {
    .premium-sidebar {
        position: fixed;
        left: -300px;
        top: 0;
        height: 100vh;
        z-index: 200;
    }
    .premium-sidebar.open {
        left: 0;
    }
    .close-sidebar {
        display: block;
    }
    .sidebar-overlay.active {
        display: block;
    }
    .premium-main {
        padding: 1rem;
    }
    .lesson-card {
        padding: 1.2rem;
    }
    .lesson-heading {
        font-size: 1.3rem;
    }
}

@media (max-width: 768px) {
    .premium-topbar {
        padding: 0.6rem 1rem;
    }
    .course-badge span {
        display: none;
    }
    .progress-wrapper {
        display: none;
    }
    .lesson-nav {
        flex-direction: column;
    }
    .nav-prev, .nav-next, .btn-complete, .completed-label, .btn-quiz, .btn-certificate {
        width: 100%;
        justify-content: center;
    }
    .quiz-container {
        margin: 0 1rem;
    }
    .quiz-head h2 {
        font-size: 1.2rem;
    }
}