/* ==========================================
   Course Details Page Styles
   ========================================== */

:root {
    --primary-blue: #0284c7;
    --primary-hover: #0369a1;
    --accent-cyan: #38bdf8;
    --success-green: #16a34a;
    --success-bg: #dcfce7;
    --text-main: #0f172a;
    --text-muted: #475569;
    --bg-light: #f8fafc;
    --card-bg: #ffffff;
    --border-color: rgba(56, 189, 248, 0.25);
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 25px rgba(2, 132, 199, 0.12);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

body {
    background-color: var(--bg-light);
    color: var(--text-main);
    line-height: 1.6;
    padding: 24px 12px;
}

.container {
    max-width: 920px;
    margin: 0 auto;
}

/* ==========================================
   Course Main Hero Card
   ========================================== */
.course-hero-card {
    background: var(--card-bg);
    border-radius: 18px;
    overflow: hidden;
    border: 1.5px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    margin-bottom: 28px;
    transition: box-shadow 0.3s ease;
}

.course-hero-card:hover {
    box-shadow: var(--shadow-lg);
}

/* Image Wrapper with Ratio */
.course-image-wrapper {
    position: relative;
    width: 100%;
    height: 360px;
    background: #000;
    overflow: hidden;
}

.course-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Course Content Area */
.course-body {
    padding: 28px;
}

.course-title {
    font-size: 26px;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.35;
    margin-bottom: 14px;
}

.course-description {
    font-size: 15px;
    color: var(--text-muted);
    margin-bottom: 24px;
    white-space: pre-line;
    line-height: 1.7;
}

/* Price & Action Section */
.action-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f1f5f9;
    padding: 16px 22px;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    gap: 16px;
}

.price-box {
    display: flex;
    flex-direction: column;
}

.price-label {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.price-value {
    font-size: 24px;
    font-weight: 800;
    color: var(--success-green);
}

/* Buttons & Badges */
.btn-buy {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #0284c7, #2563eb);
    color: #ffffff !important;
    text-decoration: none;
    padding: 12px 28px;
    font-size: 15px;
    font-weight: 700;
    border-radius: 12px;
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.3);
    transition: all 0.3s ease;
}

.btn-buy:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(2, 132, 199, 0.45);
}

.enrolled-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--success-bg);
    color: var(--success-green);
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 14px;
    border: 1px solid #86efac;
}

/* ==========================================
   Lessons Section
   ========================================== */
.lessons-section {
    background: var(--card-bg);
    border-radius: 18px;
    padding: 28px;
    border: 1.5px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.lessons-header {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--primary-blue);
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 12px;
}

.lesson-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Lesson Cards */
.lesson-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    transition: all 0.25s ease;
    text-decoration: none;
    color: inherit;
    background: #ffffff;
}

.lesson-card.unlocked {
    border-left: 4px solid var(--success-green);
    cursor: pointer;
}

.lesson-card.unlocked:hover {
    background: #f0fdf4;
    border-color: #86efac;
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.lesson-card.locked {
    background: #f8fafc;
    border-left: 4px solid #cbd5e1;
    cursor: not-allowed;
    opacity: 0.85;
}

.lesson-info {
    display: flex;
    align-items: center;
    gap: 14px;
}

/* Dynamic Thumbnail with Overlay */
.lesson-thumb-box {
    position: relative;
    width: 72px;
    height: 52px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    background: #cbd5e1;
}

.lesson-thumb-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.lesson-icon-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.3s ease;
}

.unlocked .lesson-icon-overlay {
    background: rgba(22, 163, 74, 0.35);
    color: #ffffff;
}

.locked .lesson-icon-overlay {
    background: rgba(15, 23, 42, 0.55);
    color: #ffffff;
}

.lesson-title-box {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.lesson-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.35;
}

.badge-free {
    align-self: flex-start;
    background: #e0f2fe;
    color: #0284c7;
    font-size: 10px;
    padding: 2px 7px;
    border-radius: 4px;
    font-weight: 700;
    text-transform: uppercase;
}

/* ==========================================
   Responsive Breakpoints
   ========================================== */
@media (max-width: 768px) {
    body {
        padding: 16px 8px;
    }

    .course-image-wrapper {
        height: 220px;
    }

    .course-body {
        padding: 18px;
    }

    .course-title {
        font-size: 20px;
    }

    .action-box {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    .price-box {
        align-items: center;
    }

    .btn-buy, .enrolled-badge {
        justify-content: center;
        width: 100%;
    }

    .lessons-section {
        padding: 18px;
    }

    .lesson-thumb-box {
        width: 60px;
        height: 44px;
    }

    .lesson-title {
        font-size: 12px;
    }
}