:root {
    --primary-dark: #003366;
    --primary-medium: #336699;
    --accent-green: #4CAF50;
    --accent-yellow: #FFEB3B;
    --accent-orange: #FF9800;
    --neutral-light: #F8FAFC;
    --white: #FFFFFF;
    --text-primary: #1a202c;
    --text-secondary: #718096;
    --text-light: #9E9E9E;
    --border-color: #e2e8f0;
    --error-color: #ef4444;
    --success-color: #10b981;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}


.lesson-container {
    /* max-width: 1200px; */
    margin: 2rem auto;
    padding: 0 1rem;

    background: #f8fafc;
    min-height: 100vh;
}

.lesson-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 51, 102, 0.06);
    border: 1px solid rgba(51, 102, 153, 0.08);
    overflow: hidden;
    margin-bottom: 2rem;
}

.lesson-header {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-medium) 100%);
    color: white;
    padding: 2rem;
    position: relative;
}

.lesson-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 20"><defs><radialGradient id="a" cx="50%25" cy="0%25" r="100%25"><stop offset="0%25" stop-color="%23fff" stop-opacity=".05"/><stop offset="100%25" stop-color="%23fff" stop-opacity="0"/></radialGradient></defs><rect width="100" height="20" fill="url(%23a)"/></svg>') repeat-x;
    opacity: 0.3;
}

.breadcrumb-nav {
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 2;
}

.breadcrumb-nav a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumb-nav a:hover {
    color: white;
    text-decoration: underline;
}

.breadcrumb-nav .separator {
    margin: 0 0.5rem;
    opacity: 0.6;
}

.course-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    position: relative;
    z-index: 2;
}

.instructor-avatar {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    object-fit: cover;
}

.instructor-details h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.instructor-details .college {
    font-size: 0.875rem;
    opacity: 0.8;
    margin: 0;
}

.lesson-actions {
    position: absolute;
    top: 2rem;
    right: 2rem;
    display: flex;
    gap: 0.5rem;
    z-index: 3;
}

.action-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    text-decoration: none;
    transform: translateY(-2px);
}

.lesson-title {
    font-size: 2.25rem;
    font-weight: bold;
    margin-bottom: 0.75rem;
    line-height: 1.2;
    position: relative;
    z-index: 2;
}

.lesson-subtitle {
    font-size: 1.125rem;
    opacity: 0.9;
    margin-bottom: 1.5rem;
    line-height: 1.5;
    position: relative;
    z-index: 2;
}

.lesson-metadata {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: center;
    position: relative;
    z-index: 2;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    opacity: 0.9;
}

.meta-icon {
    font-size: 0.875rem;
}

.lesson-badge {
    background: var(--accent-green);
    color: white;
    padding: 0.375rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.video-section {
    background: #000;
    position: relative;
    aspect-ratio: 16/9;
    border-radius: 0;
    overflow: hidden;
}

.video-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    position: relative;
}

.video-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.video-overlay:hover {
    background: rgba(0, 0, 0, 0.2);
}

.play-button {
    width: 80px;
    height: 80px;
    background: var(--accent-green);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(76, 175, 80, 0.3);
    margin-left: 4px;
}

.play-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(76, 175, 80, 0.4);
}

.video-controls {
    position: absolute;
    bottom: 1rem;
    left: 1rem;
    right: 1rem;
    display: flex;
    justify-content: between;
    align-items: center;
    color: white;
}

.lesson-content {
    padding: 2rem;
}

.content-section {
    margin-bottom: 3rem;
}

.content-section:last-child {
    margin-bottom: 0;
}

.section-title {
    color: var(--primary-dark);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section-icon {
    color: var(--primary-medium);
    font-size: 1.25rem;
}

.lesson-description {
    font-size: 1.1rem;
    line-height: 1.7;
    color: #374151;
    margin-bottom: 2rem;
}

.lesson-body {
    font-size: 1rem;
    line-height: 1.7;
    color: #374151;
}

.lesson-body h1,
.lesson-body h2,
.lesson-body h3,
.lesson-body h4,
.lesson-body h5,
.lesson-body h6 {
    color: var(--primary-dark);
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.lesson-body h1 {
    font-size: 2rem;
}

.lesson-body h2 {
    font-size: 1.75rem;
}

.lesson-body h3 {
    font-size: 1.5rem;
}

.lesson-body h4 {
    font-size: 1.25rem;
}

.lesson-body ul,
.lesson-body ol {
    margin: 1rem 0;
    padding-left: 2rem;
}

.lesson-body li {
    margin: 0.5rem 0;
}

.lesson-body blockquote {
    border-left: 4px solid var(--primary-medium);
    background: rgba(51, 102, 153, 0.05);
    margin: 1.5rem 0;
    padding: 1rem 1.5rem;
    border-radius: 8px;
}

.tags-section {
    padding: 1.5rem 2.5rem;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.tags-label {
    color: var(--primary-dark);
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tag-item {
    background: rgba(51, 102, 153, 0.1);
    color: var(--primary-medium);
    padding: 0.375rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.tag-item:hover {
    background: var(--primary-medium);
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
}

.navigation-section {
    padding: 2rem 2.5rem;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

.lesson-navigation {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.nav-button {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    border-radius: 12px;
    border: 2px solid #e2e8f0;
    background: white;
    text-decoration: none;
    color: var(--primary-dark);
    transition: all 0.3s ease;
}

.nav-button:hover {
    border-color: var(--primary-medium);
    background: rgba(51, 102, 153, 0.02);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(51, 102, 153, 0.1);
    text-decoration: none;
    color: var(--primary-dark);
}

.nav-button.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: #f1f5f9;
    background: #f8fafc;
}

.nav-button.disabled:hover {
    transform: none;
    box-shadow: none;
    border-color: #f1f5f9;
    background: #f8fafc;
}

.nav-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary-medium) 0%, var(--primary-dark) 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.nav-button.disabled .nav-icon {
    background: #cbd5e1;
}

.nav-content {
    flex-grow: 1;
    min-width: 0;
}

.nav-title {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.25rem;
    color: var(--primary-dark);
}

.nav-subtitle {
    color: #64748b;
    font-size: 0.9rem;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.engagement-section {
    padding: 1.5rem 2.5rem;
    background: white;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.engagement-buttons {
    display: flex;
    gap: 1rem;
}

.engagement-btn {
    background: var(--primary-medium);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.engagement-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(51, 102, 153, 0.3);
}

.engagement-btn.complete {
    background: var(--accent-green);
}

.engagement-btn.complete:hover {
    background: #45a049;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.author-details {
    
    font-weight: 600;
    margin-bottom: 0.25rem;
}



.author-link {
    text-decoration: none;
    color: inherit;
    position: relative;
    display: inline-block;
    transition: color 0.3s ease;
}

.author-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -2px;
    left: 0;
    background-color: var(--accent-green);
    transition: width 0.3s ease;
}

.author-link:hover {
    text-decoration: none;
}

.author-link:hover::after {
    width: 100%;
}

.author-link  {
    margin: 0;
    transition: all 0.3s ease;
}

.progress-indicator {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #64748b;
    font-size: 0.9rem;
}

.progress-bar {
    width: 150px;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--accent-green);
    border-radius: 3px;
    transition: width 0.6s ease;
}

/* Code styling similar to post detail */
/* .code-container {
    position: relative;
    margin: 1rem 0;
}

.code-container pre {
    background: #1e1e1e;
    border-radius: 12px;
    padding: 1rem;
    overflow-x: auto;
    font-family: 'Fira Code', 'Monaco', 'Consolas', monospace;
    font-size: 0.9rem;
    line-height: 1.6;

    margin-left: -1rem;   /* cancel parent padding-left .lesson-content */
    /* margin-right: -1rem;  cancel parent padding-right .lesson-content */
/* }  */


/* Enhanced Code Block Styling */
.code-container {
    position: relative;
    margin: 24px 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    margin-left: -0.9rem;  /* cancel parent padding-right .lesson-content * */
    margin-right: -0.9rem; /* cancel parent padding-right .lesson-content * */
}
.code-container pre {
        max-height: 300px;
        padding: 16px;
        font-size: 13px;
}

pre {
    background: #0d1117 !important;
    /* Dark theme for better contrast */
    color: #e2e8f0 !important;
    border: none;
    border-radius: 0;
    padding: 20px;
    margin: 0;
    font-family: 'Fira Code', 'Monaco', 'Cascadia Code', 'Consolas', monospace;
    font-size: 14px;
    line-height: 1.5;
    position: relative;

    /* Fixed height with scrolling */
    max-height: 400px;
    overflow-y: auto;
    overflow-x: scroll;
}

pre code {
    background: transparent !important;
    color: inherit !important;
    padding: 0;
    border: none;
    white-space: pre;
    font-family: inherit;
    font-size: inherit;
}

.copy-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.copy-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.copy-btn.copied {
    background: var(--accent-green);
    border-color: var(--accent-green);
}


/* Enhanced Scrollbar */
pre::-webkit-scrollbar {
    height: 8px;
    width: 8px;
}

pre::-webkit-scrollbar-track {
    background: #1a202c;
    border-radius: 4px;
}

pre::-webkit-scrollbar-thumb {
    border-radius: 4px;
}

pre::-webkit-scrollbar-thumb:hover {
    background: #718096;
}

pre::-webkit-scrollbar-corner {
    background: #1a202c;
}



@media (max-width: 768px) {
    .lesson-container {
        margin: 1rem auto;
        padding: 0 0.5rem;
    }

    .lesson-header {
        padding: 1.5rem;
    }

    .lesson-title {
        font-size: 1.75rem;
    }

    .lesson-content {
        padding: 1rem;
    }

    .tags-section,
    .navigation-section,
    .engagement-section {
        padding: 1.5rem;
    }

    .lesson-navigation {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .nav-button {
        padding: 1rem;
    }

    .engagement-section {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .progress-indicator {
        justify-content: center;
    }

    .lesson-actions {
        top: 1.5rem;
        right: 1.5rem;
    }

    .play-button {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
}



/* ByLearning Table Styles */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 51, 102, 0.08);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
}

/* Table Container - Each Table Gets Individual Scroll */
.table-container {
    position: relative;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 51, 102, 0.08);
    margin: 1rem 0;
}

.table-container table {
    margin: 0;
    box-shadow: none;
    min-width: 600px; /* Ensures table doesn't get too compressed */
}

/* Headers - ByLearning Primary Colors */
table thead th {
    background: linear-gradient(135deg, #003366 0%, #336699 100%);
    color: #ffffff;
    font-weight: 600;
    padding: 12px 16px;
    text-align: left;
    border: none;
    position: sticky;
    top: 0;
    z-index: 10;
    font-size: 14px;
}

/* Table Cells */
table tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid #e1e5e9;
    vertical-align: top;
    background: #ffffff;
    font-weight: normal; /* Normal weight for all cells */
}

/* First Row (after header) - Bold and Special Styling */
table tbody tr:first-child td {
    font-weight: 600; /* Bold first row */
    background: rgba(0, 51, 102, 0.05) !important;
    border-top: 2px solid #003366;
}

/* Alternating Rows - Light Gray (starting from second row) */
table tbody tr:nth-child(even) td {
    background: #f8f9fa;
}

/* Override for first row to maintain its special background */
table tbody tr:first-child td {
    background: rgba(0, 51, 102, 0.05) !important;
}

/* Hover Effect - ByLearning Light Blue */
table tbody tr:hover td {
    background: #e8f4f8 !important;
    transition: background-color 0.2s ease;
}

/* First row hover should maintain its distinct appearance */
table tbody tr:first-child:hover td {
    background: rgba(0, 51, 102, 0.12) !important;
}

/* Remove first column special styling */
table td:first-child {
    /* Remove the previous first column styling */
    font-weight: inherit;
    background: inherit !important;
    border-left: none;
}

/* Last Column */
table td:last-child,
table th:last-child {
    border-right: none;
}

/* Custom Scrollbar for Webkit Browsers */
.table-container::-webkit-scrollbar {
    height: 8px;
}

.table-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb {
    background: #336699;
    border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb:hover {
    background: #003366;
}

/* Mobile Scroll Indicator */
.scroll-indicator {
    display: none;
    text-align: center;
    font-size: 12px;
    color: #666666;
    margin-bottom: 8px;
    font-style: italic;
}

/* Mobile Styles */
@media (max-width: 768px) {
    .table-container {
        margin: 0.5rem 0;
        min-width: 90vw;
        /* border-radius: 0; */
    }
    
    .table-container table {
         /* min-width: 100vw; */
        /* min-width: 500px; */
        font-size: 13px;
    }
    
    table thead th,
    table tbody td {
        padding: 8px 12px;
        min-width: 100px;
    }
    
    table thead th {
        font-size: 12px;
    }
    
    .scroll-indicator {
        display: block;
    }
}

@media (max-width: 480px) {
    .table-container table {
        min-width: 450px;
        font-size: 12px;
    }
    
    table thead th,
    table tbody td {
        padding: 6px 10px;
        min-width: 80px;
    }
}

/* Loading State */
.table-container.loading {
    position: relative;
    opacity: 0.7;
}

.table-container.loading::before {
    content: 'Loading...';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.9);
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    color: #003366;
    z-index: 100;
}
