/* Modern Premium Dark CSS for DSA Study Platform */
:root {
    --bg-dark: #0a0b10;
    --bg-card: #12131a;
    --bg-card-hover: #1b1c26;
    --border-color: #232533;
    
    --primary: #8a2be2;
    --primary-glow: rgba(138, 43, 226, 0.4);
    --accent: #00f0ff;
    --accent-glow: rgba(0, 240, 255, 0.3);
    
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --text-dark: #6b7280;
    
    --success: #10b981;
    --success-glow: rgba(16, 185, 129, 0.2);
    
    --sidebar-width: 360px;
    --header-height: 80px;
    --font-outfit: 'Outfit', sans-serif;
    
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-outfit);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

/* App Layout */
.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* Sidebar Styling */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-card);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    z-index: 10;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-header h2 {
    font-size: 22px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--text-main), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 4px;
}

.sidebar-header .subtitle {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 400;
    display: block;
    margin-bottom: 16px;
}

.search-container {
    position: relative;
    width: 100%;
}

.search-container input {
    width: 100%;
    background-color: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 14px 10px 40px;
    color: var(--text-main);
    font-family: var(--font-outfit);
    font-size: 14px;
    transition: var(--transition-fast);
}

.search-container input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 10px var(--primary-glow);
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    fill: var(--text-dark);
    pointer-events: none;
}

/* Video List */
.video-list {
    flex-grow: 1;
    overflow-y: auto;
    padding: 12px;
}

/* Custom Scrollbar for list and code panels */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-dark);
}

.video-item {
    display: flex;
    gap: 12px;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    margin-bottom: 8px;
    transition: var(--transition-fast);
    border: 1px solid transparent;
}

.video-item:hover {
    background-color: var(--bg-card-hover);
    transform: translateY(-1px);
}

.video-item.active {
    background-color: rgba(138, 43, 226, 0.08);
    border-color: var(--primary);
    box-shadow: inset 0 0 10px rgba(138, 43, 226, 0.05);
}

.thumb-container {
    position: relative;
    width: 90px;
    height: 50px;
    border-radius: 4px;
    overflow: hidden;
    flex-shrink: 0;
    background-color: var(--bg-dark);
}

.thumb-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-badge-completed {
    position: absolute;
    top: 4px;
    right: 4px;
    background-color: var(--success);
    color: white;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.video-badge-completed svg {
    width: 10px;
    height: 10px;
    fill: currentColor;
}

.duration-tag {
    position: absolute;
    bottom: 2px;
    right: 2px;
    background-color: rgba(0, 0, 0, 0.8);
    color: #fff;
    font-size: 10px;
    padding: 1px 4px;
    border-radius: 2px;
}

.video-info-brief {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex-grow: 1;
    overflow: hidden;
}

.video-title-brief {
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.3;
    color: var(--text-main);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-meta-brief {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 4px;
}

.video-index {
    font-size: 11px;
    color: var(--text-dark);
}

.video-progress-mini {
    font-size: 11px;
    color: var(--accent);
    font-weight: 600;
}

/* Loader */
.loader {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100px;
    color: var(--text-muted);
    font-size: 14px;
}

/* Main Content Area */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background-color: var(--bg-dark);
}

/* Dashboard Header */
.dashboard-header {
    height: var(--header-height);
    border-bottom: 1px solid var(--border-color);
    padding: 0 32px;
    display: flex;
    align-items: center;
    background-color: rgba(18, 19, 26, 0.5);
    backdrop-filter: blur(10px);
}

.stats-container {
    display: grid;
    grid-template-columns: 240px 180px 180px;
    gap: 24px;
    width: 100%;
}

.stat-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.stat-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.stat-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-main);
}

.progress-bar-container {
    width: 100%;
    height: 6px;
    background-color: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    margin: 4px 0;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 4px;
    transition: width var(--transition-slow);
    box-shadow: 0 0 8px var(--primary-glow);
}

/* Player Grid Layout */
.player-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    flex-grow: 1;
    overflow: hidden;
}

.player-section {
    display: flex;
    flex-direction: column;
    padding: 24px 32px;
    overflow-y: auto;
    border-right: 1px solid var(--border-color);
}

.video-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: 12px;
    overflow: hidden;
    background-color: #000;
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

#player {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

.player-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-card);
    z-index: 5;
    text-align: center;
    padding: 20px;
}

.placeholder-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.play-icon-big {
    width: 64px;
    height: 64px;
    fill: var(--primary);
    filter: drop-shadow(0 0 12px var(--primary-glow));
    transition: var(--transition-fast);
}

.player-placeholder:hover .play-icon-big {
    transform: scale(1.1);
    fill: var(--accent);
    filter: drop-shadow(0 0 16px var(--accent-glow));
}

.placeholder-content h3 {
    font-size: 18px;
    color: var(--text-muted);
    font-weight: 500;
    max-width: 320px;
}

.video-details {
    margin-top: 24px;
}

.video-details h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-main);
    line-height: 1.25;
}

.video-details p {
    font-size: 14.5px;
    color: var(--text-muted);
    line-height: 1.6;
}

/* Chapters Section */
.chapters-section {
    display: flex;
    flex-direction: column;
    background-color: rgba(18, 19, 26, 0.2);
    overflow: hidden;
}

.section-title {
    padding: 24px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-title h3 {
    font-size: 16px;
    font-weight: 600;
}

.badge {
    background-color: var(--bg-card-hover);
    border: 1px solid var(--border-color);
    color: var(--accent);
    padding: 4px 8px;
    font-size: 11px;
    border-radius: 20px;
    font-weight: 600;
}

.chapters-list {
    flex-grow: 1;
    overflow-y: auto;
    padding: 12px;
}

.chapter-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition-fast);
    margin-bottom: 6px;
    border: 1px solid transparent;
}

.chapter-item:hover {
    background-color: var(--bg-card-hover);
}

.chapter-item.active {
    background-color: rgba(0, 240, 255, 0.05);
    border-color: var(--accent);
}

.chapter-time {
    background-color: var(--bg-dark);
    color: var(--accent);
    border: 1px solid var(--border-color);
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    font-family: monospace;
    flex-shrink: 0;
}

.chapter-title {
    font-size: 13.5px;
    color: var(--text-main);
    line-height: 1.4;
    font-weight: 500;
}

.chapter-item.active .chapter-title {
    color: var(--accent);
}

.empty-state {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-dark);
    font-size: 13.5px;
    line-height: 1.5;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .app-container {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        height: 350px;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    .player-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto;
    }
    .chapters-section {
        border-top: 1px solid var(--border-color);
        max-height: 300px;
    }
    body {
        overflow: auto;
        height: auto;
    }
}
