/* Base Styles & Variables */
:root {
    --primary: #5A4BDA;
    --primary-dark: #4A3BC8;
    --accent: #F972B9;
    
    --text: #1a1a1a;
    --text-light: #666;
    --text-lighter: #999;
    
    --bg: #ffffff;
    --bg-light: #f8f9fa;
    --bg-dark: #f0f2f5;
    
    --border: #e5e7eb;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.12);
    
    --radius: 12px;
    --radius-sm: 8px;
    
    --header-height: 64px;
}

.dark-mode {
    --primary: #6D62EE;
    --primary-dark: #7C72F5;
    
    --text: #ffffff;
    --text-light: #d0d0d0;
    --text-lighter: #a0a0a0;
    
    --bg: #000000;
    --bg-light: #0a0a0a;
    --bg-dark: #141414;
    
    --border: #1a1a1a;
    --shadow: 0 4px 16px rgba(0,0,0,0.9);
    --shadow-lg: 0 8px 32px rgba(109,98,238,0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-light);
    color: var(--text);
    line-height: 1.6;
    transition: background 0.3s, color 0.3s;
    -webkit-tap-highlight-color: transparent;
}

a {
    color: inherit;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

img {
    max-width: 100%;
    height: auto;
    user-select: none;
    -webkit-user-drag: none;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
    font-size: inherit;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: var(--bg);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
    height: var(--header-height);
}

.header-content {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    height: var(--header-height);
    gap: 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
    white-space: nowrap;
}

.logo i {
    font-size: 24px;
}

.search-wrapper {
    max-width: 500px;
    width: 100%;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav {
    display: flex;
    gap: 8px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    color: var(--text-light);
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s;
}

.nav-link:hover,
.nav-link.active {
    background: var(--bg-light);
    color: var(--primary);
}

.nav-link i {
    font-size: 16px;
}

.theme-toggle {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--bg-light);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.theme-toggle:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.1);
}

.theme-toggle i {
    font-size: 18px;
}

/* Main Content */
.main-content {
    min-height: calc(100vh - var(--header-height) - 80px);
    padding: 16px 0;
}

/* Search Bar */
.search-container {
    margin-bottom: 24px;
}

.search-wrapper {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

.search-input {
    width: 100%;
    padding: 12px 48px 12px 48px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    transition: all 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(90, 75, 218, 0.1);
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    pointer-events: none;
}

.clear-search {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 4px;
    display: none;
}

.clear-search.visible {
    display: block;
}

.clear-search:hover {
    color: var(--text);
}

/* Favorite Button */
.favorite-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.2s;
}

.favorite-btn:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

.favorite-btn.active {
    background: var(--accent);
}

.favorite-btn.active:hover {
    background: var(--accent);
}

.favorite-btn i {
    font-size: 16px;
}

/* Course Grid */
.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.course-card {
    background: var(--bg);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: transform 0.3s;
    border: 1px solid var(--border);
    position: relative;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.course-card:hover {
    transform: translateY(-2px);
}

.course-card:active {
    transform: translateY(0);
}

.course-thumbnail {
    width: 100%;
    height: auto;
    object-fit: cover;
    background: var(--bg-dark);
}

.course-content {
    padding: 16px;
}

.course-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.course-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.course-price-wrapper {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.course-price-old {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-lighter);
    text-decoration: line-through;
}

.course-price-free {
    font-size: 24px;
    font-weight: 800;
    color: var(--primary);
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.course-price {
    font-size: 24px;
    font-weight: 800;
    color: var(--primary);
}

.course-dates {
    font-size: 12px;
    color: var(--text-lighter);
    text-align: right;
}

/* Course Detail */
.course-detail {
    max-width: 1200px;
    margin: 0 auto;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
    font-size: 14px;
    flex-wrap: wrap;
    background: var(--bg);
    padding: 12px 16px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.breadcrumb a {
    color: var(--text-light);
    text-decoration: none;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    background: var(--bg-light);
    -webkit-tap-highlight-color: transparent;
    white-space: nowrap;
    font-size: 14px;
}

.breadcrumb a:hover {
    color: var(--primary);
    background: var(--bg-dark);
}

.breadcrumb-separator {
    color: var(--text-lighter);
    font-size: 12px;
    flex-shrink: 0;
}

.breadcrumb span:not(.breadcrumb-separator) {
    display: flex;
    align-items: center;
    gap: 6px;
    color: white;
    font-weight: 600;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    background: var(--primary);
    white-space: nowrap;
    font-size: 14px;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.breadcrumb span:not(.breadcrumb-separator) i {
    flex-shrink: 0;
}

.course-header {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}

.course-header-content {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 24px;
    align-items: start;
}

.course-header-image {
    width: 100%;
    border-radius: var(--radius-sm);
}

.course-info h1 {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 16px;
}

.course-info-meta {
    display: flex;
    gap: 32px;
    flex-wrap: wrap;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.info-label {
    font-size: 12px;
    color: var(--text-lighter);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

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

.price-large {
    font-size: 32px;
    color: var(--primary);
}

/* Content Section */
.content-section {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
}

.section-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Folder Grid */
.folder-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

.folder-item,
.file-item {
    background: var(--bg-light);
    padding: 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.2s;
    border: 1px solid var(--border);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.folder-item:hover,
.file-item:hover {
    background: var(--bg-dark);
}

.folder-item:active,
.file-item:active {
    background: var(--bg-dark);
}

.folder-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.folder-icon {
    font-size: 24px;
    color: var(--primary);
}

.folder-title {
    font-weight: 700;
    font-size: 15px;
    color: var(--text);
    flex: 1;
}

.content-counts {
    display: flex;
    gap: 12px;
    font-size: 13px;
    color: var(--text-light);
    flex-wrap: wrap;
}

.content-counts span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.content-counts i {
    font-size: 14px;
}

/* File List */
.file-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--bg-light);
    padding: 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid var(--border);
}

.file-item:hover {
    background: var(--bg-dark);
    transform: translateX(4px);
}

.file-thumbnail-wrapper {
    position: relative;
    width: 120px;
    height: 68px;
    flex-shrink: 0;
}

.file-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    border-radius: var(--radius-sm);
    background: var(--bg-dark);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: block;
}

.file-thumbnail.loaded {
    opacity: 1;
}

.image-loading-spinner {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-dark);
    border-radius: var(--radius-sm);
}

.image-loading-spinner .spinner {
    width: 30px;
    height: 30px;
    border-width: 3px;
}

.file-icon {
    width: 120px;
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-dark);
    border-radius: var(--radius-sm);
    font-size: 32px;
    color: var(--primary);
    flex-shrink: 0;
}

.file-info {
    flex: 1;
    min-width: 0;
}

.file-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.file-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--text-light);
    flex-wrap: wrap;
    align-items: center;
}

.file-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.file-meta i {
    font-size: 12px;
}

.locked-badge,
.unlocked-badge,
.count-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.locked-badge {
    background: var(--accent);
    color: white;
}

.unlocked-badge {
    background: #10b981;
    color: white;
}

.count-badge {
    background: var(--primary);
    color: white;
}

/* Video Modal */
.video-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.video-modal.active {
    display: flex;
}

.video-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
}

.video-modal-content {
    position: relative;
    width: 100%;
    max-width: 1200px;
    background: var(--bg);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    z-index: 1;
}

.video-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    font-size: 20px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.video-modal-close:hover {
    background: var(--primary);
    transform: rotate(90deg);
}

.video-modal-header {
    padding: 20px 60px 20px 20px;
    background: var(--bg-light);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
}

.video-modal-header i {
    font-size: 24px;
    color: var(--primary);
}

.video-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
}

.video-player-container {
    position: relative;
    background: #000;
    aspect-ratio: 16 / 9;
}

#player {
    width: 100%;
    height: 100%;
}

/* Full Page Video Player */
.video-player-page {
    min-height: 100vh;
    background: var(--bg);
}

.video-player-header {
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 12px 16px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.back-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.back-button:hover {
    background: var(--bg-dark);
    color: var(--primary);
}

.back-button i {
    font-size: 16px;
}

.video-player-wrapper {
    background: #000;
}

.video-player-wrapper .video-player-container {
    position: relative;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    background: #000;
    aspect-ratio: 16 / 9;
}

#videoPlayer {
    width: 100%;
    height: 100%;
}

.video-info-section {
    padding: 24px 0;
}

.video-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text);
    line-height: 1.3;
}

.video-description {
    font-size: 15px;
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 16px;
}

.video-meta-info {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    font-size: 14px;
    color: var(--text-light);
}

.video-meta-info span {
    display: flex;
    align-items: center;
    gap: 6px;
}

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

.plyr {
    --plyr-color-main: var(--primary);
}

/* Plyr Speed Menu Overflow Fix */
.plyr__menu__container {
    max-height: 400px;
    overflow-y: auto;
    overflow-x: hidden;
}

.plyr__menu__container::-webkit-scrollbar {
    width: 6px;
}

.plyr__menu__container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
}

.plyr__menu__container::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 3px;
}

.plyr__menu__container::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* Ensure duration is visible in landscape/fullscreen */
.plyr__time {
    display: inline-block !important;
}

.plyr__time--duration {
    display: inline-block !important;
}

/* Mobile landscape optimization */
@media (max-height: 500px) and (orientation: landscape) {
    .plyr__controls {
        padding: 5px 10px;
    }
    
    .plyr__time {
        font-size: 13px;
    }
    
    .plyr__menu__container {
        max-height: 250px;
    }
}

/* Loading */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-overlay.active {
    display: flex;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 6px solid var(--bg-dark);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Initial Loading Screen */
.initial-loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100000;
    transition: opacity 0.3s ease;
}

.initial-loading.hidden {
    opacity: 0;
    pointer-events: none;
}

.initial-loading-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.loading-status {
    font-size: 15px;
    color: var(--text-light);
    font-weight: 500;
    margin: 0;
    min-height: 24px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.loading-status i {
    font-size: 16px;
}

@media (max-width: 480px) {
    .loading-status {
        font-size: 14px;
    }
    
    .initial-loading-content .spinner {
        width: 50px;
        height: 50px;
        border-width: 5px;
    }
}

@keyframes heartBeat {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.3); }
    50% { transform: scale(1.1); }
    75% { transform: scale(1.2); }
}

@keyframes fadeOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-10px); }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--bg);
    color: var(--text);
    padding: 16px 20px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 10001;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    border: 1px solid var(--border);
    min-width: 250px;
}

.toast.toast-show {
    opacity: 1;
    transform: translateY(0);
}

.toast.toast-success {
    border-left: 4px solid #10b981;
}

.toast.toast-success i {
    color: #10b981;
    font-size: 20px;
}

.toast.toast-info {
    border-left: 4px solid var(--primary);
}

.toast.toast-info i {
    color: var(--primary);
    font-size: 20px;
}

.toast span {
    font-size: 14px;
    font-weight: 500;
}

/* Footer */
.footer {
    background: var(--bg);
    padding: 24px 0;
    text-align: center;
    color: var(--text-light);
    margin-top: 48px;
    font-size: 14px;
}

/* Responsive */
@media (max-width: 1024px) {
    .header-content {
        gap: 12px;
    }
    
    .logo span {
        display: none;
    }
    
    .search-wrapper {
        max-width: 400px;
    }
    
    .courses-grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        gap: 16px;
    }
}

@media (max-width: 768px) {
    .header {
        height: auto;
        padding: 0;
    }
    
    .header-content {
        grid-template-columns: 1fr;
        gap: 0;
        padding: 0;
        height: auto;
    }
    
    .logo {
        justify-content: space-between;
        font-size: 18px;
        padding: 12px 16px;
        border-bottom: 1px solid var(--border);
    }
    
    .logo i {
        font-size: 20px;
    }
    
    .logo span {
        display: inline;
        flex: 1;
        text-align: left;
        margin-left: 8px;
    }
    
    .search-wrapper {
        max-width: 100%;
        order: 3;
        padding: 12px 16px;
        border-bottom: 1px solid var(--border);
    }
    
    .search-input {
        font-size: 14px;
        padding: 10px 40px;
    }
    
    .header-actions {
        order: 2;
        justify-content: space-between;
        width: 100%;
        padding: 10px 16px;
        border-bottom: 1px solid var(--border);
    }
    
    .nav {
        flex: 1;
        justify-content: flex-start;
        gap: 4px;
    }
    
    .nav-link {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .nav-link span {
        display: none;
    }
    
    .nav-link i {
        font-size: 18px;
    }
    
    .theme-toggle {
        width: 38px;
        height: 38px;
    }
    
    .main-content {
        padding: 16px 12px;
    }
    
    .container {
        padding: 0 12px;
    }
    
    .courses-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 12px;
    }
    
    .course-header-content {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .course-header {
        padding: 16px;
    }
    
    .course-info h1 {
        font-size: 22px;
    }
    
    .course-info-meta {
        gap: 16px;
    }
    
    .info-value {
        font-size: 16px;
    }
    
    .price-large {
        font-size: 28px;
    }
    
    .folder-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .content-section {
        padding: 16px;
    }
    
    .section-title {
        font-size: 18px;
    }
    
    .breadcrumb {
        font-size: 12px;
        padding: 10px 12px;
        gap: 6px;
        margin-bottom: 20px;
    }
    
    .breadcrumb a {
        padding: 5px 8px;
        font-size: 12px;
        gap: 5px;
    }
    
    .breadcrumb a span {
        display: none;
    }
    
    .breadcrumb span:not(.breadcrumb-separator) {
        padding: 5px 8px;
        font-size: 12px;
        gap: 5px;
        max-width: 200px;
    }
    
    .breadcrumb-separator {
        font-size: 10px;
    }
    
    .breadcrumb i {
        font-size: 11px;
    }
    
    /* Mobile Playlist Design */
    .file-list {
        gap: 8px;
    }
    
    .file-item {
        padding: 8px;
        gap: 10px;
    }
    
    .file-thumbnail-wrapper {
        width: 100px;
        height: 56px;
        border-radius: var(--radius-sm);
        overflow: hidden;
    }
    
    .file-thumbnail {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center;
    }
    
    .file-icon {
        width: 100px;
        height: 56px;
        font-size: 24px;
    }
    
    .image-loading-spinner .spinner {
        width: 24px;
        height: 24px;
        border-width: 2px;
    }
    
    .file-title {
        font-size: 13px;
        -webkit-line-clamp: 1;
        line-clamp: 1;
    }
    
    .file-meta {
        font-size: 11px;
    }
    
    .video-modal-header h3 {
        font-size: 14px;
    }
    
    .video-modal-close {
        width: 36px;
        height: 36px;
        top: 12px;
        right: 12px;
    }
    
    .video-title {
        font-size: 20px;
    }
    
    .video-description {
        font-size: 14px;
    }
    
    .video-meta-info {
        font-size: 13px;
        gap: 16px;
    }
    
    .video-info-section {
        padding: 20px 0;
    }
    
    .toast {
        bottom: 16px;
        right: 16px;
        left: 16px;
        min-width: auto;
        padding: 12px 16px;
    }
    
    .toast span {
        font-size: 13px;
    }
    
    .toast i {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 8px;
    }
    
    .logo {
        font-size: 16px;
        padding: 10px 12px;
    }
    
    .logo i {
        font-size: 18px;
    }
    
    .search-wrapper {
        padding: 10px 12px;
    }
    
    .search-input {
        padding: 9px 38px 9px 38px;
        font-size: 13px;
        border-radius: var(--radius-sm);
    }
    
    .search-icon {
        left: 12px;
        font-size: 14px;
    }
    
    .clear-search {
        right: 12px;
        font-size: 14px;
    }
    
    .header-actions {
        padding: 8px 12px;
    }
    
    .nav {
        gap: 2px;
    }
    
    .nav-link {
        padding: 8px 10px;
        font-size: 12px;
    }
    
    .nav-link i {
        font-size: 16px;
    }
    
    .theme-toggle {
        width: 36px;
        height: 36px;
    }
    
    .theme-toggle i {
        font-size: 16px;
    }
    
    .main-content {
        padding: 16px 8px;
    }
    
    .courses-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .course-card {
        margin: 0;
    }
    
    .course-content {
        padding: 12px;
    }
    
    .course-title {
        font-size: 15px;
    }
    
    .course-price-old {
        font-size: 14px;
    }
    
    .course-price-free {
        font-size: 20px;
    }
    
    .course-dates {
        font-size: 11px;
    }
    
    .course-header {
        padding: 12px;
    }
    
    .course-info h1 {
        font-size: 18px;
    }
    
    .course-info-meta {
        gap: 12px;
    }
    
    .info-label {
        font-size: 10px;
    }
    
    .info-value {
        font-size: 14px;
    }
    
    .price-large {
        font-size: 24px;
    }
    
    .content-section {
        padding: 12px;
    }
    
    .section-title {
        font-size: 16px;
    }
    
    .breadcrumb {
        font-size: 11px;
        padding: 8px 10px;
        gap: 4px;
        margin-bottom: 16px;
    }
    
    .breadcrumb a {
        padding: 4px 6px;
        font-size: 11px;
        gap: 4px;
    }
    
    .breadcrumb a span {
        display: none;
    }
    
    .breadcrumb span:not(.breadcrumb-separator) {
        padding: 4px 6px;
        font-size: 11px;
        gap: 4px;
        max-width: 150px;
    }
    
    .breadcrumb-separator {
        font-size: 9px;
    }
    
    .breadcrumb i {
        font-size: 10px;
    }
    
    .folder-item {
        padding: 12px;
    }
    
    .folder-title {
        font-size: 14px;
    }
    
    .content-counts {
        font-size: 11px;
    }
    
    /* Compact Playlist Design for Small Devices */
    .file-list {
        gap: 6px;
    }
    
    .file-item {
        padding: 8px;
        gap: 10px;
    }
    
    .file-thumbnail-wrapper {
        width: 80px;
        height: 45px;
        border-radius: var(--radius-sm);
        overflow: hidden;
    }
    
    .file-thumbnail {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center;
    }
    
    .file-icon {
        width: 80px;
        height: 45px;
        font-size: 20px;
    }
    
    .image-loading-spinner .spinner {
        width: 20px;
        height: 20px;
        border-width: 2px;
    }
    
    .file-title {
        font-size: 12px;
        -webkit-line-clamp: 1;
        line-clamp: 1;
        margin-bottom: 4px;
    }
    
    .file-meta {
        font-size: 10px;
        gap: 6px;
    }
    
    .locked-badge,
    .unlocked-badge,
    .count-badge {
        padding: 2px 6px;
        font-size: 9px;
    }
    
    .favorite-btn {
        width: 32px;
        height: 32px;
        top: 8px;
        right: 8px;
    }
    
    .favorite-btn i {
        font-size: 14px;
    }
    
    .video-modal-content {
        margin: 0;
        border-radius: 0;
    }
    
    .video-modal-header {
        padding: 12px 48px 12px 12px;
    }
    
    .video-modal-header h3 {
        font-size: 13px;
    }
    
    .video-modal-header i {
        font-size: 18px;
    }
    
    .video-modal-close {
        width: 32px;
        height: 32px;
        top: 10px;
        right: 10px;
        font-size: 16px;
    }
    
    .back-button {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .back-button i {
        font-size: 14px;
    }
    
    .video-title {
        font-size: 18px;
    }
    
    .video-description {
        font-size: 13px;
    }
    
    .video-meta-info {
        font-size: 12px;
        gap: 12px;
    }
    
    .video-info-section {
        padding: 16px 0;
    }
    
    .toast {
        bottom: 12px;
        right: 12px;
        left: 12px;
        padding: 10px 14px;
    }
    
    .toast span {
        font-size: 12px;
    }
    
    .toast i {
        font-size: 16px;
    }
}

@media (max-width: 360px) {
    .courses-grid {
        grid-template-columns: 1fr;
    }
    
    .course-title {
        font-size: 14px;
    }
    
    .course-price-free {
        font-size: 18px;
    }
    
    .breadcrumb {
        font-size: 10px;
        padding: 6px 8px;
        gap: 3px;
        margin-bottom: 12px;
    }
    
    .breadcrumb a {
        padding: 3px 5px;
        font-size: 10px;
        gap: 3px;
    }
    
    .breadcrumb a span {
        display: none;
    }
    
    .breadcrumb span:not(.breadcrumb-separator) {
        padding: 3px 5px;
        font-size: 10px;
        gap: 3px;
        max-width: 120px;
    }
    
    .breadcrumb-separator {
        font-size: 8px;
    }
    
    .breadcrumb i {
        font-size: 9px;
    }
    
    /* Ultra Compact Playlist for Very Small Devices */
    .file-thumbnail-wrapper {
        width: 70px;
        height: 40px;
        border-radius: var(--radius-sm);
        overflow: hidden;
    }
    
    .file-thumbnail {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center;
    }
    
    .file-icon {
        width: 70px;
        height: 40px;
        font-size: 18px;
    }
    
    .image-loading-spinner .spinner {
        width: 16px;
        height: 16px;
        border-width: 2px;
    }
    
    .file-title {
        font-size: 11px;
    }
    
    .file-meta {
        font-size: 9px;
        gap: 4px;
    }
    
    .locked-badge,
    .unlocked-badge,
    .count-badge {
        padding: 2px 4px;
        font-size: 8px;
    }
}

/* Video Player Page Responsive */
@media (max-width: 768px) {
    .video-title {
        font-size: 20px;
    }
    
    .video-description {
        font-size: 14px;
    }
    
    .video-meta-info {
        font-size: 13px;
        gap: 16px;
    }
    
    .video-info-section {
        padding: 20px 0;
    }
}

@media (max-width: 480px) {
    .back-button {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .back-button i {
        font-size: 14px;
    }
    
    .video-title {
        font-size: 18px;
    }
    
    .video-description {
        font-size: 13px;
    }
    
    .video-meta-info {
        font-size: 12px;
        gap: 12px;
    }
    
    .video-info-section {
        padding: 16px 0;
    }
}

@media (max-width: 360px) {
    .video-title {
        font-size: 16px;
    }
    
    .video-description {
        font-size: 12px;
    }
    
    .video-meta-info {
        font-size: 11px;
        gap: 10px;
    }
    
    .video-info-section {
        padding: 12px 0;
    }
    
    .back-button span {
        display: none;
    }
}

/* Security Verification Modal */
.security-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 99999;
}

.security-modal-content {
    text-align: center;
    max-width: 400px;
    width: 100%;
    padding: 40px 20px;
}

.security-header {
    margin-bottom: 32px;
}

.security-header i {
    font-size: 56px;
    color: var(--primary);
    margin-bottom: 20px;
    display: block;
}

.security-header h2 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text);
}

.security-header p {
    font-size: 14px;
    color: var(--text-light);
    margin: 0;
}

.security-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

#turnstile-widget {
    display: flex;
    justify-content: center;
}

.security-status {
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    width: 100%;
    max-width: 300px;
}

.security-status.verifying {
    background: var(--bg-light);
    color: var(--text);
    border: 1px solid var(--border);
}

.security-status.success {
    background: #10b98115;
    color: #10b981;
    border: 1px solid #10b98130;
}

.dark-mode .security-status.success {
    background: #10b98125;
    color: #34d399;
}

.security-status.error {
    background: #ef444415;
    color: #ef4444;
    border: 1px solid #ef444430;
}

.dark-mode .security-status.error {
    background: #ef444425;
    color: #f87171;
}

.security-status i {
    font-size: 16px;
}

@media (max-width: 480px) {
    .security-modal-content {
        padding: 32px 16px;
    }
    
    .security-header i {
        font-size: 48px;
        margin-bottom: 16px;
    }
    
    .security-header h2 {
        font-size: 20px;
    }
    
    .security-header p {
        font-size: 13px;
    }
    
    .security-status {
        font-size: 13px;
        padding: 10px 16px;
    }
}

/* Error States */
.error-state {
    text-align: center;
    padding: 60px 20px;
    max-width: 600px;
    margin: 0 auto;
}

.error-icon {
    width: 120px;
    height: 120px;
    margin: 0 auto 32px;
    background: var(--bg-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 4px solid var(--border);
}

.error-icon i {
    font-size: 56px;
    color: var(--text-light);
}

.error-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text);
}

.error-message {
    font-size: 16px;
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 32px;
}

.error-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(90, 75, 218, 0.3);
}

.btn-secondary {
    background: var(--bg-light);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-dark);
}

.btn i {
    font-size: 16px;
}

@media (max-width: 768px) {
    .error-state {
        padding: 40px 16px;
    }
    
    .error-icon {
        width: 100px;
        height: 100px;
        margin-bottom: 24px;
    }
    
    .error-icon i {
        font-size: 48px;
    }
    
    .error-title {
        font-size: 24px;
    }
    
    .error-message {
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .error-state {
        padding: 32px 12px;
    }
    
    .error-icon {
        width: 80px;
        height: 80px;
        margin-bottom: 20px;
        border-width: 3px;
    }
    
    .error-icon i {
        font-size: 40px;
    }
    
    .error-title {
        font-size: 20px;
        margin-bottom: 12px;
    }
    
    .error-message {
        font-size: 14px;
        margin-bottom: 24px;
    }
    
    .error-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
        padding: 10px 20px;
        font-size: 14px;
    }
}
