/* -----------------------------------------------------------------------------
   MODERN APPLE AESTHETIC - VIDEO COURSE PAGE
   ----------------------------------------------------------------------------- */

/* 1. Design Tokens & Variables */
:root {
    /* Palette */
    --bg-body: #f5f5f7;       /* Apple Light Gray Background */
    --bg-card: #ffffff;       /* Pure White for Cards */
    --text-primary: #1d1d1f;  /* Almost Black */
    --text-secondary: #86868b;/* Gray Text */
    --accent: #0071e3;        /* Apple Electric Blue */
    --accent-hover: #0077ed;
    --accent-faint: rgba(0, 113, 227, 0.1); /* For active states */
    
    /* Spacing & Borders */
    --radius-l: 22px;
    --radius-m: 14px;
    --radius-s: 8px;
    
    /* Effects */
    --shadow-ambient: 0 4px 6px -1px rgba(0, 0, 0, 0.01), 0 10px 15px -3px rgba(0, 0, 0, 0.02);
    --shadow-deep: 0 20px 40px rgba(0, 0, 0, 0.08);
    --glass: blur(20px) saturate(180%);
    
    /* Typography */
    --font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* 2. Global Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-stack);
    -webkit-font-smoothing: antialiased;
}

body {
    background-color: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s ease;
}

/* 3. Navigation Bar (Glassmorphism) */
.navbar {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: var(--glass);
    -webkit-backdrop-filter: var(--glass);
    border-bottom: 1px solid rgba(0,0,0,0.05);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: 60px; /* Reduced height for modern feel */
}

.nav-container {
    max-width: 1400px;
    height: 100%;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.nav-brand i {
    color: var(--accent);
    font-size: 1.2rem;
    background: none;
    -webkit-text-fill-color: initial;
}

.nav-links {
    display: flex;
    gap: 32px;
    list-style: none;
    align-items: center;
}

.nav-links a {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 400;
}

.nav-links a:hover {
    color: var(--accent);
}

/* Remove the old underline effect for a cleaner look */
.nav-links a::after {
    display: none;
}

.home-btn {
    background: var(--accent) !important;
    color: white !important;
    padding: 8px 20px;
    border-radius: 980px; /* Pill shape */
    font-weight: 500;
    font-size: 0.85rem;
    box-shadow: none;
    transition: transform 0.2s, background 0.2s;
}

.home-btn:hover {
    transform: scale(1.02);
    background: var(--accent-hover) !important;
    box-shadow: 0 4px 12px rgba(0, 113, 227, 0.25);
}

/* 4. Main Layout & Container */
.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 100px 24px 40px;
}

/* Header Section */
header {
    text-align: center;
    padding: 40px 0 60px;
    animation: fadeUp 0.8s ease;
}

h1 {
    font-size: 3.5rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    margin-bottom: 16px;
    background: none;
    -webkit-text-fill-color: initial;
    text-shadow: none;
}

.subtitle {
    font-size: 1.3rem;
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto;
    font-weight: 400;
}

/* 5. Search & Filters */
.search-container {
    max-width: 600px;
    margin: 0 auto 40px;
    position: relative;
    animation: fadeUp 0.8s ease 0.1s both;
}

#searchInput {
    width: 100%;
    padding: 16px 48px 16px 24px;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 12px;
    font-size: 1rem;
    background: var(--bg-card);
    color: var(--text-primary);
    box-shadow: var(--shadow-ambient);
    transition: all 0.2s ease;
}

#searchInput:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.15);
}

#searchInput::placeholder {
    color: #a1a1a6;
}

.search-icon {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.categories {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 60px;
    animation: fadeUp 0.8s ease 0.2s both;
}

.category-btn {
    padding: 10px 24px;
    background: transparent;
    border: 1px solid #d2d2d7;
    border-radius: 980px;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.category-btn:hover {
    background: #eaeaec;
    border-color: #d2d2d7;
    transform: none;
    box-shadow: none;
}

.category-btn.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    box-shadow: 0 4px 10px rgba(0, 113, 227, 0.3);
}

/* 6. Content Grid (Player + List) */
.main-content {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 40px;
    margin-bottom: 60px;
    animation: fadeUp 0.8s ease 0.3s both;
}

/* Video Player Styling */
.video-player-container {
    background: var(--bg-card);
    border-radius: var(--radius-l);
    padding: 0; /* Removing padding for a cleaner look */
    overflow: hidden;
    box-shadow: var(--shadow-deep);
    border: 1px solid rgba(0,0,0,0.02);
}

.video-player {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
    background: #000;
    margin-bottom: 0;
    border-radius: var(--radius-l) var(--radius-l) 0 0; /* Only top rounded */
    box-shadow: none;
}

.video-player iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.video-info {
    padding: 32px;
}

.video-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.video-meta {
    display: inline-flex;
    gap: 24px;
    padding: 12px 20px;
    background: #f5f5f7;
    border-radius: 12px;
    margin-bottom: 24px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

.video-meta span {
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.video-meta i {
    color: var(--accent);
}

.video-desc {
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.7;
}

/* Video Playlist (Sidebar) */
.video-list-container {
    background: var(--bg-card);
    border-radius: var(--radius-l);
    padding: 24px;
    box-shadow: var(--shadow-ambient);
    border: 1px solid rgba(0,0,0,0.02);
    height: fit-content;
    max-height: 800px;
    overflow-y: auto;
}

/* Custom Scrollbar for list */
.video-list-container::-webkit-scrollbar {
    width: 6px;
}
.video-list-container::-webkit-scrollbar-track {
    background: transparent;
}
.video-list-container::-webkit-scrollbar-thumb {
    background: #d2d2d7;
    border-radius: 10px;
}

.video-list-title {
    font-size: 1.2rem;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    color: var(--text-primary);
    font-weight: 600;
}

.video-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.video-item {
    display: flex;
    gap: 16px;
    padding: 12px;
    background: transparent;
    border-radius: var(--radius-m);
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.video-item:hover {
    background: #f5f5f7;
    transform: none;
    box-shadow: none;
}

.video-item.active {
    background: var(--accent-faint); /* Light Blue Background */
    border-color: rgba(0, 113, 227, 0.2);
}

.video-item.active .video-item-title {
    color: var(--accent); /* Blue Text */
}

/* Removed green border, used a subtle dot or icon change instead if needed */
.video-item.watched {
    border-left: none; 
    opacity: 0.7;
}

.video-thumb {
    width: 100px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    background: #f0f0f0;
    flex-shrink: 0;
    position: relative;
}

.video-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.video-item-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-primary);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-item-meta {
    display: flex;
    justify-content: space-between;
    color: #98989d;
    font-size: 0.8rem;
}

/* 7. Footer */
footer {
    background: #111;
    color: #f5f5f7;
    padding: 60px 0 40px;
    margin-top: 80px;
    border-top: none;
    backdrop-filter: none;
}

footer p {
    color: #86868b;
    font-size: 0.9rem;
    margin-bottom: 24px;
}

.footer-links {
    gap: 32px;
}

.footer-links a {
    color: #d2d2d7;
    font-weight: 400;
    font-size: 0.85rem;
}

.footer-links a:hover {
    color: white;
    text-decoration: underline;
    transform: none;
}

/* 8. Animations */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 9. Responsive */
@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr; /* Stack vertically on tablets */
    }
    
    .video-list-container {
        max-height: 500px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 80px 20px 40px;
    }

    h1 {
        font-size: 2.2rem;
    }
    
    .subtitle {
        font-size: 1.1rem;
    }

    .video-title {
        font-size: 1.5rem;
    }
    
    .video-info {
        padding: 20px;
    }
    
    .video-item {
        align-items: center;
    }

    .nav-container {
        padding: 0 16px;
    }
    
    /* Hide nav links on mobile (assuming JS handles a toggle menu if needed, 
       otherwise simplified stack) */
    .nav-links {
        display: none; 
    }
}