* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

p,
.video-description,
.message-text,
.content-card p,
.file-card p,
#video-description {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

:root {
    --primary: #6B9B7C;
    --primary-dark: #5a8a6c;
    --bg-light: #f1f8f4;
    --bg-lighter: #e8f5e9;
    --text-dark: #2d3436;
    --text-gray: #636e72;
    --white: #ffffff;
    --border: rgba(107, 155, 124, 0.1);
    --shadow: rgba(0, 0, 0, 0.08);

    --font-base: clamp(14px, 1.5vw, 16px);
    --font-small: clamp(12px, 1.2vw, 14px);
    --font-large: clamp(18px, 2vw, 20px);
    --font-xlarge: clamp(24px, 3vw, 32px);

    --spacing-xs: clamp(4px, 0.5vw, 8px);
    --spacing-sm: clamp(8px, 1vw, 12px);
    --spacing-md: clamp(12px, 1.5vw, 20px);
    --spacing-lg: clamp(20px, 2.5vw, 30px);
    --spacing-xl: clamp(30px, 4vw, 50px);

    --touch-target: 44px;
}

html,
body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

#admin-panel {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}

#admin-panel .container {
    width: 100%;
    max-width: 100%;
    padding-left: var(--spacing-md);
    padding-right: var(--spacing-md);
    box-sizing: border-box;
}

[data-theme="dark"] {
    --bg-light: #1a1a1a;
    --bg-lighter: #242424;
    --text-dark: #e8e8e8;
    --text-gray: #b0b0b0;
    --white: #2d2d2d;
    --border: rgba(255, 255, 255, 0.1);
    --shadow: rgba(0, 0, 0, 0.3);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg-light: #1a1a1a;
        --bg-lighter: #242424;
        --text-dark: #e8e8e8;
        --text-gray: #b0b0b0;
        --white: #2d2d2d;
        --border: rgba(255, 255, 255, 0.1);
        --shadow: rgba(0, 0, 0, 0.3);
    }
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

@media (prefers-contrast: high) {
    :root {
        --border: rgba(107, 155, 124, 0.3);
        --shadow: rgba(0, 0, 0, 0.15);
    }

    .btn,
    .content-card,
    .file-card {
        border: 2px solid var(--primary) !important;
    }
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    min-height: 100vh;
    color: var(--text-dark);
    overflow-x: hidden;
    transition: background 0.3s, color 0.3s;
    font-size: var(--font-base);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

@media print {

    .theme-toggle,
    .top-nav,
    .btn-logout,
    .view-toggle,
    .tabs,
    .close-modal,
    .video-actions {
        display: none !important;
    }

    body {
        background: white !important;
        color: black !important;
    }

    .content-card,
    .file-card {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .modal-content {
        box-shadow: none !important;
    }
}

@media (hover: none) and (pointer: coarse) {

    .btn,
    .tab,
    .view-btn,
    .content-card,
    .file-card,
    .playlist-item,

    * {
        -webkit-overflow-scrolling: touch;
    }

    .btn:active,
    .content-card:active,
    .file-card:active {
        transform: scale(0.97);
        transition: transform 0.1s ease;
    }
}

.theme-toggle {
    position: fixed;
    top: 90px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    background: var(--white);
    box-shadow: 0 4px 15px var(--shadow);
    cursor: pointer;
    z-index: 99;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.theme-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px var(--shadow);
}

.theme-toggle .sun-icon {
    display: block;
}

.theme-toggle .moon-icon {
    display: none;
}

[data-theme="dark"] .theme-toggle .sun-icon {
    display: none;
}

[data-theme="dark"] .theme-toggle .moon-icon {
    display: block;
}

.login-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 50%, #a5d6a7 100%);
    z-index: 0;
}

[data-theme="dark"] .login-background {
    background: linear-gradient(135deg, #1a1a1a 0%, #242424 50%, #2d2d2d 100%);
}

.member-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--bg-light) 0%, var(--bg-lighter) 100%);
    z-index: 0;
}

.screen {
    display: none;
    min-height: 100vh;
    padding: var(--spacing-md);
    position: relative;
    z-index: 1;
}

.screen.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
    padding: 0 var(--spacing-md);
}

.card {
    background: var(--white);
    backdrop-filter: blur(20px);
    padding: clamp(30px, 5vw, 50px) clamp(25px, 4vw, 40px);
    border-radius: clamp(20px, 3vw, 30px);
    box-shadow: 0 30px 80px var(--shadow);
    max-width: 450px;
    margin: 0 auto;
    border: 1px solid var(--border);
}

.logo-container {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.logo-circle {
    width: clamp(70px, 10vw, 100px);
    height: clamp(70px, 10vw, 100px);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--spacing-md);
    box-shadow: 0 10px 30px rgba(107, 155, 124, 0.3);
    animation: float 3s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }
}

.card h1 {
    font-size: clamp(24px, 4vw, 32px);
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
    color: var(--text-dark);
}

.subtitle {
    color: var(--text-gray);
    font-size: var(--font-base);
}

.input-group {
    margin-bottom: var(--spacing-lg);
}

.input-group label {
    display: block;
    margin-bottom: var(--spacing-sm);
    font-weight: 600;
    color: var(--text-dark);
    font-size: var(--font-small);
}

.input-group input {
    width: 100%;
    padding: clamp(14px, 2vw, 16px) clamp(16px, 2.5vw, 20px);
    border: 2px solid var(--border);
    border-radius: 15px;
    font-size: var(--font-base);
    transition: all 0.3s;
    background: var(--bg-lighter);
    color: var(--text-dark);
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--white);
    box-shadow: 0 0 0 4px rgba(107, 155, 124, 0.1);
}

.video-files-section {
    margin-top: var(--spacing-lg);
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--border);
}

.video-files-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

.video-files-header h3 {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: var(--font-large);
    color: var(--text-dark);
    margin: 0;
    font-weight: 700;
}

.video-files-header svg {
    color: var(--primary);
}

.files-count {
    font-size: var(--font-small);
    color: var(--text-gray);
    background: var(--bg-lighter);
    padding: 6px 14px;
    border-radius: 15px;
    font-weight: 600;
}

.video-files-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.video-file-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--bg-lighter);
    border-radius: 15px;
    transition: all 0.3s;
    border: 2px solid var(--border);
}

.video-file-item:hover {
    transform: translateY(-3px);
    border-color: var(--primary);
    box-shadow: 0 8px 20px var(--shadow);
}

.video-file-icon {
    font-size: clamp(28px, 4vw, 36px);
    min-width: clamp(40px, 6vw, 50px);
    height: clamp(40px, 6vw, 50px);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--white);
    border-radius: 12px;
    flex-shrink: 0;
}

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

.video-file-info h4 {
    margin: 0 0 5px 0;
    font-size: var(--font-base);
    color: var(--text-dark);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.video-file-info p {
    margin: 0;
    font-size: var(--font-small);
    color: var(--text-gray);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-download {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: clamp(10px, 1.5vw, 12px) clamp(16px, 2.5vw, 20px);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: var(--font-small);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(107, 155, 124, 0.3);
    min-height: var(--touch-target);
}

.btn-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(107, 155, 124, 0.4);
}

.btn-download svg {
    width: 18px;
    height: 18px;
}

.btn {
    padding: clamp(12px, 2vw, 16px) clamp(20px, 3vw, 32px);
    border: none;
    border-radius: 15px;
    font-size: var(--font-base);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    min-height: var(--touch-target);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    width: 100%;
    margin-top: var(--spacing-sm);
    box-shadow: 0 10px 25px rgba(107, 155, 124, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(107, 155, 124, 0.4);
}

.error-message {
    color: #d63031;
    margin-top: var(--spacing-md);
    padding: var(--spacing-md) var(--spacing-lg);
    background: #fff5f5;
    border-radius: 12px;
    font-size: var(--font-small);
    display: none;
    border-left: 4px solid #d63031;
}

.error-message.show {
    display: block;
}

#member-screen .container {
    padding: clamp(80px, 12vh, 100px) var(--spacing-md) var(--spacing-xl);
}

.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: var(--white);
    backdrop-filter: blur(20px);
    box-shadow: 0 4px 20px var(--shadow);
    z-index: 100;
}

.nav-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--spacing-md) var(--spacing-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: clamp(16px, 2.5vw, 20px);
    font-weight: 700;
    color: var(--text-dark);
}

.img-logo {
    width: clamp(50px, 7vw, 60px);
    height: clamp(50px, 7vw, 60px);
}

.img-members {
    width: clamp(16px, 2.5vw, 20px);
    height: clamp(16px, 2.5vw, 20px);
}

.logo-circle-small {
    width: clamp(32px, 5vw, 40px);
    height: clamp(32px, 5vw, 40px);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.user-badge {
    padding: var(--spacing-xs) var(--spacing-md);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: 20px;
    font-size: var(--font-small);
    font-weight: 600;
}

.btn-logout {
    background: var(--white);
    color: var(--text-dark);
    border: 2px solid var(--border);
    padding: clamp(10px, 1.5vw, 12px) clamp(18px, 2.5vw, 24px);
    font-size: var(--font-small);
}

.btn-logout:hover {
    background: var(--bg-lighter);
    border-color: var(--primary);
}

.welcome-section {
    text-align: center;
    margin-bottom: var(--spacing-xl);
    padding: var(--spacing-xl) var(--spacing-md);
    background: var(--white);
    backdrop-filter: blur(10px);
    border-radius: 25px;
}

.welcome-section h1 {
    font-size: clamp(28px, 5vw, 36px);
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
    color: var(--text-dark);
}

.tabs-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
    border-bottom: 2px solid var(--border);
    flex-wrap: wrap;
    gap: var(--spacing-md);
}

.tabs {
    display: flex;
    gap: var(--spacing-md);
    overflow-x: auto;
    scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
    display: none;
}

.tab {
    padding: var(--spacing-md) var(--spacing-lg);
    background: none;
    border: none;
    font-size: var(--font-base);
    font-weight: 600;
    color: var(--text-gray);
    cursor: pointer;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
    min-height: var(--touch-target);
}

.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab:hover {
    color: var(--primary);
}

.view-toggle {
    display: flex;
    gap: var(--spacing-xs);
    padding: 0 var(--spacing-sm) var(--spacing-sm);
}

.view-btn {
    width: clamp(38px, 5vw, 40px);
    height: clamp(38px, 5vw, 40px);
    border: 2px solid var(--border);
    background: var(--white);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-gray);
    font-size: var(--font-base);
    min-width: var(--touch-target);
    min-height: var(--touch-target);
}

.view-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

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

.search-container {
    margin-bottom: var(--spacing-lg);
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--white);
    border: 2px solid var(--border);
    border-radius: 15px;
    padding: var(--spacing-sm) var(--spacing-md);
    transition: all 0.3s;
    max-width: 600px;
    margin: 0 auto;
}

.search-box:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(107, 155, 124, 0.1);
}

.search-box i.fa-magnifying-glass {
    color: var(--text-gray);
    font-size: 18px;
    margin-right: var(--spacing-sm);
}

.search-box input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: var(--font-base);
    color: var(--text-dark);
    outline: none;
    padding: 0;
}

.search-box input::placeholder {
    color: var(--text-gray);
}

.clear-search-btn {
    background: none;
    border: none;
    color: var(--text-gray);
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s;
    margin-left: var(--spacing-xs);
}

.clear-search-btn:hover {
    background: var(--bg-lighter);
    color: var(--primary);
}

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

@media (max-width: 768px) {
    .search-box {
        max-width: 100%;
    }
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.loading {
    text-align: center;
    padding: clamp(60px, 10vh, 80px) var(--spacing-md);
}

.spinner {
    width: clamp(50px, 7vw, 60px);
    height: clamp(50px, 7vw, 60px);
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto var(--spacing-lg);
}

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

.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
    gap: var(--spacing-lg);
    transition: all 0.3s;
}

.content-grid.list-view {
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
}

.content-card {
    background: var(--white);
    backdrop-filter: blur(10px);
    padding: var(--spacing-lg);
    border-radius: 20px;
    box-shadow: 0 8px 25px var(--shadow);
    transition: all 0.4s;
    border: 1px solid var(--border);
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
}

.content-card-info {
    flex: 1;
}

.content-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(107, 155, 124, 0.15);
}

.content-card.locked {
    opacity: 0.6;
    cursor: not-allowed;
}

.content-card .completion-check {
    display: none;
}

.content-card.completed .completion-check {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: var(--spacing-xs);
    color: #4caf50;
    font-size: var(--font-small);
    font-weight: 600;
}

.content-card.completed .completion-check i {
    font-size: 18px;
}

.content-card.locked .completion-check.locked-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: var(--spacing-xs);
    color: #ff9800;
    font-size: var(--font-small);
    font-weight: 600;
}

.content-card.locked .completion-check.locked-indicator i {
    font-size: 16px;
}

.content-grid.list-view .content-card {
    display: flex;
    flex-direction: row;
    gap: var(--spacing-lg);
    align-items: center;
    padding: var(--spacing-md);
    position: relative;
}

.content-grid.list-view .video-thumbnail {
    width: clamp(160px, 20vw, 200px);
    height: clamp(100px, 12vw, 120px);
    margin-bottom: 0;
    flex-shrink: 0;
}

.content-grid.list-view .content-card-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: var(--spacing-sm);
    padding: 0 var(--spacing-xl);
}

.content-grid.list-view .content-card h3 {
    margin: 0;
    font-size: var(--font-large);
    font-weight: 700;
}

.content-grid.list-view .content-card p {
    margin: 0;
    font-size: var(--font-small);
    line-height: 1.6;
    color: var(--text-gray);
}

.content-grid.list-view .completion-check {
    flex-shrink: 0;
    margin-top: 0;
}

.content-grid.list-view .sub-videos-count {
    bottom: auto;
    top: var(--spacing-md);
    left: var(--spacing-md);
    right: auto;
}

.video-thumbnail {
    width: 100%;
    height: clamp(140px, 20vw, 180px);
    background: linear-gradient(135deg, var(--bg-lighter) 0%, var(--border) 100%);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--spacing-md);
    position: relative;
    overflow: hidden;
}

.video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.play-icon {
    position: absolute;
    width: clamp(50px, 7vw, 60px);
    height: clamp(50px, 7vw, 60px);
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(20px, 3vw, 24px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s;
}

.content-card:hover .play-icon {
    transform: scale(1.1);
}

.content-card .badge {
    display: inline-block;
    padding: 6px 12px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: 15px;
    font-size: 11px;
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
}

.content-card h3 {
    font-size: var(--font-large);
    margin-bottom: var(--spacing-xs);
    color: var(--text-dark);
    font-weight: 700;
    margin-top: 4px;
}

.content-card p {
    color: var(--text-gray);
    font-size: var(--font-small);
    line-height: 1.6;
}

.file-card {
    background: var(--white);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding: var(--spacing-lg);
    border-radius: 20px;
    box-shadow: 0 8px 25px var(--shadow);
    transition: all 0.4s;
    border: 1px solid var(--border);
    text-align: center;
    min-height: 100%;
}

.file-card-info {
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.file-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(107, 155, 124, 0.15);
}

.file-icon {
    font-size: clamp(42px, 6vw, 56px);
    margin-bottom: var(--spacing-md);
    flex-shrink: 0;
}

.file-card .badge {
    display: inline-block;
    padding: 6px 16px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: var(--spacing-md);
    flex-shrink: 0;
}

.file-card h3 {
    font-size: clamp(18px, 2.5vw, 20px);
    margin-bottom: var(--spacing-sm);
    color: var(--text-dark);
    font-weight: 700;
    flex-shrink: 0;
}

.file-card p {
    color: var(--text-gray);
    font-size: var(--font-base);
    margin-bottom: auto;
    flex: 1;
}

.file-card .btn {
    width: 100%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    margin-top: var(--spacing-md);
    flex-shrink: 0;
}

.content-grid.list-view .file-card {
    flex-direction: row;
    text-align: left;
    gap: var(--spacing-md);
    align-items: center;
    padding: var(--spacing-md);
}

.content-grid.list-view .file-icon {
    font-size: clamp(36px, 5vw, 48px);
    margin: 0;
    flex-shrink: 0;
}

.content-grid.list-view .file-card-info {
    flex: 1;
}

.content-grid.list-view .file-card h3 {
    margin: 0 0 5px 0;
    font-size: var(--font-large);
}

.content-grid.list-view .file-card p {
    margin: 0;
    font-size: var(--font-small);
}

.content-grid.list-view .file-card .btn {
    width: auto;
    padding: clamp(10px, 1.5vw, 12px) clamp(18px, 2.5vw, 24px);
    flex-shrink: 0;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal.active {
    display: block;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(10px);
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 95%;
    max-width: 1400px;
    height: 90vh;
    background: var(--white);
    border-radius: 25px;
    box-shadow: 0 25px 100px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.4s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

@keyframes slideUp {
    from {
        transform: translate(-50%, -40%);
        opacity: 0;
    }

    to {
        transform: translate(-50%, -50%);
        opacity: 1;
    }
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 20px;
    width: clamp(38px, 5vw, 45px);
    height: clamp(38px, 5vw, 45px);
    border: none;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    cursor: pointer;
    color: white;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 10;
    min-width: var(--touch-target);
    min-height: var(--touch-target);
}

.close-modal:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: rotate(90deg);
}

.modal-layout {
    display: grid;
    grid-template-columns: 1fr 400px;
    height: 100%;
    overflow: hidden;
}

.modal-main {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    background: var(--white);
}

.video-player-wrapper {
    position: relative;
    background: #000;
    flex-shrink: 0;
    overflow: hidden;
}

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

.sub-videos-count {
    position: absolute;
    bottom: var(--spacing-md);
    right: var(--spacing-md);
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(107, 155, 124, 0.95);
    color: white;
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    z-index: 2;
    box-shadow: 0 4px 12px rgba(107, 155, 124, 0.3);
}

.sub-videos-count i {
    font-size: 14px;
}

.video-player iframe,
.video-player video {
    width: 100%;
    height: 100%;
    border: none;
}

.video-player-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 80px;
    height: 65px;
    background: #000;
    z-index: 5;
    pointer-events: none;
}

.video-info-section {
    padding: var(--spacing-lg);
    flex: 1;
}

.video-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--spacing-md);
    gap: var(--spacing-md);
    flex-wrap: wrap;
}

.video-header h2 {
    font-size: clamp(20px, 3vw, 26px);
    color: var(--text-dark);
    font-weight: 700;
    margin-top: var(--spacing-sm);
}

.video-badge {
    display: inline-block;
    padding: 6px 14px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 600;
}

.video-watched-indicator {
    display: none;
    align-items: center;
    gap: var(--spacing-xs);
    color: #4caf50;
    font-weight: 600;
    font-size: var(--font-small);
    padding: var(--spacing-xs) var(--spacing-md);
    background: rgba(76, 175, 80, 0.1);
    border-radius: 20px;
}

.video-watched-indicator.show {
    display: flex;
}

#video-description {
    color: var(--text-gray);
    line-height: 1.8;
    font-size: var(--font-base);
    margin-bottom: var(--spacing-lg);
}

.video-actions {
    display: flex;
    gap: var(--spacing-md);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}

.btn-complete {
    flex: 1;
    min-width: 200px;
    background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
    color: white;
    box-shadow: 0 8px 20px rgba(76, 175, 80, 0.3);
}

.btn-complete:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(76, 175, 80, 0.4);
}

.btn-complete:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-next-video {
    flex: 1;
    min-width: 200px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 8px 20px rgba(107, 155, 124, 0.3);
}

.btn-next-video:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(107, 155, 124, 0.4);
}

.modal-sidebar {
    background: var(--bg-lighter);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.playlist-header {
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border);
    background: var(--white);
}

.playlist-header h3 {
    font-size: var(--font-large);
    color: var(--text-dark);
    margin-bottom: var(--spacing-xs);
}

.playlist-progress {
    font-size: var(--font-small);
    color: var(--text-gray);
    font-weight: 500;
}

.playlist-items {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-sm);
}

.playlist-item {
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-xs);
    background: var(--white);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    min-height: var(--touch-target);
}

.playlist-item.sub-video {
    margin-left: var(--spacing-lg);
    position: relative;
    background: var(--bg-lighter);
    border-left: 3px solid var(--primary);
}

.playlist-item.sub-video::before {
    content: '';
    position: absolute;
    left: calc(-1 * var(--spacing-lg));
    top: 50%;
    width: calc(var(--spacing-lg) - 3px);
    height: 2px;
    background: var(--primary);
    opacity: 0.5;
}

.playlist-item.sub-video .playlist-item-number {
    background: rgba(107, 155, 124, 0.2);
}

.playlist-item:hover {
    transform: translateX(5px);
    border-color: var(--primary);
}

.playlist-item.active {
    border-color: var(--primary);
    background: rgba(107, 155, 124, 0.1);
}

.playlist-item.locked {
    opacity: 0.5;
    cursor: not-allowed;
}

.playlist-item.locked:hover {
    transform: none;
    border-color: transparent;
}

.playlist-item-number {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: var(--bg-lighter);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: var(--font-small);
    color: var(--text-gray);
    flex-shrink: 0;
}

.playlist-item.active .playlist-item-number {
    background: var(--primary);
    color: white;
}

.playlist-item.completed .playlist-item-number {
    background: #4caf50;
    color: white;
}

.playlist-item.completed .playlist-item-number::after {
    content: '✓';
}

.playlist-item.locked .playlist-item-number::after {
    content: 'X';
    font-size: 12px;
}

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

.playlist-item-title {
    font-weight: 600;
    font-size: var(--font-small);
    color: var(--text-dark);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.playlist-item-duration {
    font-size: 12px;
    color: var(--text-gray);
}

.empty-state {
    background: var(--white);
    padding: clamp(60px, 10vh, 80px) var(--spacing-xl);
    border-radius: 25px;
    text-align: center;
    border: 2px dashed var(--border);
}

.empty-icon {
    font-size: clamp(60px, 10vw, 80px);
    margin-bottom: var(--spacing-lg);
}

.empty-state h3 {
    font-size: clamp(20px, 3vw, 24px);
    color: var(--text-dark);
    margin-bottom: var(--spacing-sm);
}

.empty-state p {
    font-size: var(--font-base);
    color: var(--text-gray);
}

.content-card.sub-video {
    margin-left: clamp(20px, 5vw, 40px);
    position: relative;
    border-left: 3px solid var(--primary);
    opacity: 0.95;
}

.content-card.sub-video::before {
    content: '';
    position: absolute;
    left: clamp(-20px, -5vw, -40px);
    top: 50%;
    width: clamp(17px, 4.5vw, 37px);
    height: 2px;
    background: var(--primary);
    opacity: 0.5;
}

.section-badge {
    position: absolute;
    top: var(--spacing-md);
    right: var(--spacing-md);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 6px 12px;
    border-radius: 12px;
    font-size: var(--font-small);
    font-weight: 700;
    z-index: 2;
    box-shadow: 0 4px 12px rgba(107, 155, 124, 0.3);
}

.section-badge.sub-section {
    background: linear-gradient(135deg, #5a8a6c 0%, #4a7a5c 100%);
    font-size: 12px;
}

.playlist-items::-webkit-scrollbar,
.modal-main::-webkit-scrollbar {
    width: 8px;
}

.playlist-items::-webkit-scrollbar-track,
.modal-main::-webkit-scrollbar-track {
    background: var(--bg-lighter);
}

.playlist-items::-webkit-scrollbar-thumb,
.modal-main::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 10px;
}

.playlist-items::-webkit-scrollbar-thumb:hover,
.modal-main::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

@keyframes slideInUp {
    from {
        transform: translateY(100px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideOutDown {
    from {
        transform: translateY(0);
        opacity: 1;
    }

    to {
        transform: translateY(100px);
        opacity: 0;
    }
}

@media (min-width: 2560px) {
    .container {
        max-width: 1600px;
    }

    .content-grid {
        grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
        gap: 40px;
    }

    .modal-content {
        max-width: 1800px;
    }

    .modal-layout {
        grid-template-columns: 1fr 500px;
    }
}

@media (min-width: 1920px) {
    :root {
        --spacing-xl: 60px;
        --spacing-lg: 35px;
    }

    .welcome-section h1 {
        font-size: 42px;
    }

    .content-grid {
        gap: 35px;
    }
}

@media (min-width: 1440px) and (max-width: 1919px) {
    .container {
        max-width: 1300px;
    }

    .content-grid {
        grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    }
}

@media (min-width: 1280px) and (max-width: 1439px) {
    .content-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 25px;
    }

    .modal-layout {
        grid-template-columns: 1fr 350px;
    }
}

@media (min-width: 1024px) and (max-width: 1279px) {
    .modal-layout {
        grid-template-columns: 1fr;
    }

    .modal-sidebar {
        display: none;
    }

    .modal-content {
        height: 95vh;
    }

    .content-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 20px;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .card {
        padding: clamp(35px, 5vw, 40px) clamp(25px, 4vw, 30px);
    }

    .content-grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        gap: 20px;
    }

    .content-grid.list-view .content-card {
        flex-direction: row;
        gap: var(--spacing-lg);
        align-items: center;
    }

    .content-grid.list-view .content-card-info {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        gap: var(--spacing-sm);
        padding: 0 var(--spacing-md);
    }

    .content-grid.list-view .video-thumbnail {
        width: 140px;
        height: 90px;
        margin-bottom: 0;
        flex-shrink: 0;
    }

    .nav-logo span {
        display: none;
    }

    .user-badge {
        display: none;
    }

    .tabs {
        gap: 10px;
    }

    .tab {
        padding: clamp(10px, 1.5vw, 12px) clamp(18px, 2.5vw, 20px);
        font-size: 14px;
    }

    .theme-toggle {
        top: 88px;
        right: 20px;
        width: 45px;
        height: 45px;
    }

    .video-actions {
        flex-direction: column;
    }

    .btn-complete,
    .btn-next-video {
        min-width: 100%;
    }

    .close-modal {
        top: 10px;
        right: 10px;
    }

    .video-info-section {
        padding: var(--spacing-md);
    }

    .modal-layout {
        grid-template-columns: 1fr;
    }

    .modal-sidebar {
        display: none;
    }
}

@media (min-width: 600px) and (max-width: 767px) {
    .welcome-section h1 {
        font-size: clamp(26px, 4vw, 30px);
    }

    .tabs-container {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-sm);
    }

    .view-toggle {
        padding: var(--spacing-sm) 0 0 0;
        width: 100%;
        justify-content: flex-end;
    }

    .content-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .content-card {
        padding: clamp(18px, 3vw, 20px);
    }

    .video-thumbnail {
        height: clamp(150px, 18vw, 170px);
    }

    .content-grid.list-view .content-card {
        flex-direction: row;
        gap: var(--spacing-md);
        align-items: center;
    }

    .content-grid.list-view .video-thumbnail {
        width: 140px;
        height: 90px;
        margin-bottom: 0;
        flex-shrink: 0;
    }

    .content-grid.list-view .content-card-info {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        gap: var(--spacing-sm);
    }

    .file-card {
        padding: var(--spacing-lg);
    }

    .content-grid.list-view .file-card {
        flex-direction: column;
        text-align: center;
    }

    .content-grid.list-view .file-card-info {
        width: 100%;
    }

    .content-grid.list-view .file-card .btn {
        width: 100%;
    }

    .theme-toggle {
        top: 75px;
        right: 15px;
        width: 42px;
        height: 42px;
    }

    .modal-content {
        width: 100%;
        height: 100vh;
        border-radius: 0;
    }

    .video-header {
        flex-direction: column;
        gap: var(--spacing-sm);
    }
}

@media (min-width: 480px) and (max-width: 599px) {
    #member-screen .container {
        padding: 90px var(--spacing-md) var(--spacing-lg);
    }

    .welcome-section {
        padding: var(--spacing-lg) var(--spacing-md);
        margin-bottom: var(--spacing-lg);
    }

    .welcome-section h1 {
        font-size: 26px;
    }

    .welcome-section p {
        font-size: 14px;
    }

    .card {
        padding: 35px 25px;
    }

    .card h1 {
        font-size: 28px;
    }

    .logo-circle {
        width: 80px;
        height: 80px;
    }

    .img-logo {
        width: 50px;
        height: 50px;
    }

    .nav-content {
        padding: 15px 20px;
    }

    .logo-circle-small {
        width: 35px;
        height: 35px;
    }

    .img-members {
        width: 18px;
        height: 18px;
    }

    .btn-logout {
        padding: 10px 18px;
        font-size: 13px;
    }

    .tab {
        padding: 10px 18px;
        font-size: 14px;
    }

    .view-btn {
        width: 38px;
        height: 38px;
        font-size: 14px;
    }

    .content-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .content-card {
        padding: 18px;
    }

    .content-card h3 {
        font-size: 16px;
    }

    .content-card p {
        font-size: 13px;
    }

    .video-thumbnail {
        height: 140px;
    }

    .play-icon {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }

    .file-card {
        padding: 20px;
    }

    .file-icon {
        font-size: 48px;
        margin-bottom: 15px;
    }

    .file-card h3 {
        font-size: 18px;
    }

    .file-card p {
        font-size: 14px;
    }

    .btn {
        padding: 14px 24px;
        font-size: 14px;
    }

    .theme-toggle {
        top: 70px;
        right: 12px;
        width: 40px;
        height: 40px;
    }

    .video-info-section {
        padding: 15px;
    }

    .video-header h2 {
        font-size: 20px;
    }

    #video-description {
        font-size: 14px;
    }

    .video-actions {
        gap: var(--spacing-sm);
    }

    .close-modal {
        width: 38px;
        height: 38px;
    }

    .content-card.sub-video {
        margin-left: 25px;
    }

    .content-card.sub-video::before {
        left: -25px;
        width: 22px;
    }
}

@media (max-width: 480px) {
    .modal {
        overflow-y: auto;
    }

    .modal-content {
        position: fixed;
        top: 0 !important;
        left: 0 !important;
        transform: none !important;
        width: 100% !important;
        height: 100% !important;
        max-height: 100vh !important;
        border-radius: 0 !important;
        overflow-y: auto;
    }

    .modal-layout {
        display: flex;
        flex-direction: column;
        min-height: 100vh;
    }

    .modal-main {
        flex: 1;
        display: flex;
        flex-direction: column;
    }

    .video-player-wrapper {
        flex-shrink: 0;
    }

    .video-player {
        width: 100%;
        height: auto;
        aspect-ratio: 16/9;
        max-height: 40vh;
    }

    .video-info-section {
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .close-modal {
        position: fixed;
        top: 10px;
        right: 10px;
        z-index: 10000;
        background: rgba(0, 0, 0, 0.8);
    }

    .modal-sidebar {
        display: none !important;
    }
}

@media (max-width: 479px) {
    .logo-circle-small {
        display: none !important;
    }

    .view-toggle {
        display: none !important;
    }
}

@media (min-width: 375) and (max-width: 479px) {

    #member-screen .container {
        padding: 75px 12px 30px;
    }

    .theme-toggle {
        top: 15px;
        right: 5px;
    }

    .welcome-section {
        padding: 20px 15px;
        margin-bottom: 15px;
        border-radius: 15px;
    }

    .welcome-section h1 {
        font-size: 22px;
        line-height: 1.3;
        margin-bottom: 8px;
    }

    .welcome-section p {
        font-size: 14px;
    }

    .tabs-container {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 20px;
        padding-bottom: 0;
        gap: 12px;
    }

    .tabs {
        gap: 12px;
        flex: 1;
    }

    .tab {
        padding: 12px 16px;
        font-size: 14px;
    }

    .view-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    .nav-content {
        padding: 12px 15px;
        gap: 10px;
    }

    .logo-circle-small {
        width: 34px;
        height: 34px;
    }

    .img-members {
        width: 17px;
        height: 17px;
    }

    .content-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .content-card {
        padding: 16px;
    }

    .content-card h3 {
        font-size: 16px;
    }

    .content-card p {
        font-size: 13px;
    }

    .video-thumbnail {
        height: 135px;
        margin-bottom: 12px;
    }

    .modal-content {
        width: 100%;
        height: 100%;
        max-height: 100vh;
        border-radius: 0;
        top: 0;
        left: 0;
        transform: none;
    }

    .video-player {
        width: 100%;
        aspect-ratio: 16/9;
        max-height: 40vh;
    }

    .video-info-section {
        padding: 15px;
        overflow-y: auto;
    }

    .video-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

    .video-header h2 {
        font-size: 18px;
        margin-top: 0;
    }

    .video-actions {
        gap: 10px;
        flex-direction: column;
    }

    .btn-complete,
    .btn-next-video {
        width: 100%;
        min-width: 100%;
        padding: 12px 18px;
        font-size: 13px;
    }

    .close-modal {
        top: 10px;
        right: 10px;
        width: 38px;
        height: 38px;
        z-index: 1000;
    }

    .video-files-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .video-files-header h3 {
        font-size: 16px;
    }

    .video-file-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 12px;
    }

    .video-file-info {
        width: 100%;
    }

    .btn-download {
        padding: 10px 16px;
        font-size: 12px;
        width: 100%;
        justify-content: center;
    }

    .content-card.sub-video {
        margin-left: 20px;
        border-left-width: 2px;
    }

    .content-card.sub-video::before {
        left: -20px;
        width: 17px;
    }

    .section-badge {
        padding: 5px 10px;
        font-size: 12px;
    }
}

@media (max-width: 374px) {
    #member-screen .container {
        padding: 85px 10px 25px;
    }

    .welcome-section {
        padding: 25px 12px;
        margin-bottom: 25px;
    }

    .welcome-section h1 {
        font-size: 22px;
    }

    .welcome-section p {
        font-size: 13px;
    }

    .card {
        padding: 30px 20px;
    }

    .card h1 {
        font-size: 24px;
    }

    .subtitle {
        font-size: 14px;
    }

    .logo-circle {
        width: 70px;
        height: 70px;
    }

    .img-logo {
        width: 45px;
        height: 45px;
    }

    .input-group input {
        padding: 14px 18px;
        font-size: 15px;
    }

    .nav-content {
        padding: 12px 15px;
    }

    .nav-logo {
        font-size: 18px;
    }

    .logo-circle-small {
        width: 32px;
        height: 32px;
    }

    .img-members {
        width: 16px;
        height: 16px;
    }

    .btn-logout {
        padding: 8px 16px;
        font-size: 12px;
    }

    .tabs-container {
        margin-bottom: 20px;
    }

    .tab {
        padding: 8px 15px;
        font-size: 13px;
    }

    .view-btn {
        width: 36px;
        height: 36px;
        font-size: 13px;
    }

    .content-card {
        padding: 15px;
    }

    .content-card h3 {
        font-size: 15px;
    }

    .content-card p {
        font-size: 12px;
    }

    .video-thumbnail {
        height: 120px;
    }

    .play-icon {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }

    .completion-check {
        font-size: 12px;
    }

    .completion-check i {
        font-size: 16px;
    }

    .file-card {
        padding: 18px;
    }

    .file-icon {
        font-size: 42px;
        margin-bottom: 12px;
    }

    .file-card h3 {
        font-size: 16px;
        margin-bottom: 8px;
    }

    .file-card p {
        font-size: 13px;
        margin-bottom: 15px;
    }

    .btn {
        padding: 12px 20px;
        font-size: 13px;
    }

    .theme-toggle {
        top: 68px;
        right: 10px;
        width: 38px;
        height: 38px;
    }

    .theme-toggle svg {
        width: 20px;
        height: 20px;
    }

    .modal-content {
        height: 100vh;
    }

    .video-info-section {
        padding: 12px;
    }

    .video-header h2 {
        font-size: 18px;
        margin-top: 5px;
    }

    #video-description {
        font-size: 13px;
        line-height: 1.6;
        margin-bottom: 20px;
    }

    .video-watched-indicator {
        font-size: 12px;
        padding: 6px 12px;
    }

    .video-actions {
        flex-direction: column;
        gap: 8px;
        padding-top: 15px;
    }

    .btn-complete,
    .btn-next-video {
        font-size: 13px;
        padding: 12px 20px;
        min-width: 100%;
    }

    .close-modal {
        top: 8px;
        right: 8px;
        width: 36px;
        height: 36px;
    }

    .close-modal svg {
        width: 20px;
        height: 20px;
    }

    .empty-state {
        padding: 60px 20px;
    }

    .empty-state h3 {
        font-size: 20px;
    }

    .empty-state p {
        font-size: 14px;
    }

    .loading {
        padding: 60px 15px;
    }

    .spinner {
        width: 50px;
        height: 50px;
        border-width: 3px;
    }

    .video-files-section {
        margin-top: 15px;
        padding-top: 15px;
    }

    .video-file-item {
        padding: 12px;
    }

    .video-file-icon {
        font-size: 28px;
        min-width: 40px;
        height: 40px;
    }

    .message-text {
        font-size: 13px;
    }

    .content-card.sub-video {
        margin-left: 15px;
    }

    .content-card.sub-video::before {
        left: -15px;
        width: 12px;
    }

    .content-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .tabs-container {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-sm);
    }

    .view-toggle {
        padding: var(--spacing-sm) 0 0 0;
        width: 100%;
        justify-content: flex-end;
    }

    .content-grid.list-view .content-card {
        flex-direction: row;
        gap: var(--spacing-sm);
        align-items: center;
    }

    .content-grid.list-view .video-thumbnail {
        width: 100px;
        height: 65px;
        margin-bottom: 0;
        flex-shrink: 0;
    }

    .content-grid.list-view .content-card-info {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        gap: 5px;
        padding: 0 8px;
    }

    .content-grid.list-view .file-card {
        flex-direction: column;
        text-align: center;
    }

    .content-grid.list-view .file-card .btn {
        width: 100%;
    }
}

@media (max-height: 600px) and (orientation: landscape) {
    .modal-content {
        height: 98vh;
    }

    .video-info-section {
        padding: 15px;
    }

    .video-header h2 {
        font-size: 20px;
    }

    #video-description {
        font-size: 13px;
        margin-bottom: 15px;
    }

    .welcome-section {
        padding: 25px var(--spacing-md);
        margin-bottom: 30px;
    }

    .welcome-section h1 {
        font-size: 28px;
    }

    #member-screen .container {
        padding: 85px var(--spacing-md) var(--spacing-lg);
    }

}

@media (max-height: 500px) {
    .modal-content {
        height: 100vh;
        border-radius: 0;
    }

    .video-info-section {
        padding: 12px;
    }

    .video-actions {
        padding-top: 12px;
    }

    .btn-complete,
    .btn-next-video {
        padding: 10px 20px;
    }

    .welcome-section {
        padding: 20px var(--spacing-md);
        margin-bottom: 25px;
    }

}

@media (orientation: landscape) and (hover: none) and (pointer: coarse) {
    .modal-content {
        height: 100vh;
        border-radius: 0;
    }

    .video-player-wrapper {
        max-height: 60vh;
    }

    .modal-main {
        overflow-y: auto;
    }

}

@media (hover: hover) and (pointer: fine) {

    .btn:hover,
    .tab:hover,
    .view-btn:hover,
    .content-card:hover,
    .file-card:hover {
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .video-file-item:hover {
        transform: translateY(-3px);
    }

    .playlist-item:hover {
        transform: translateX(5px);
    }
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        color-scheme: dark;
    }

    :root:not([data-theme="light"]) img {
        opacity: 0.9;
    }
}

@media (prefers-reduced-motion: no-preference) {
    *:focus-visible {
        outline: 3px solid var(--primary);
        outline-offset: 2px;
        border-radius: 4px;
    }
}

@media (prefers-contrast: more) {

    .btn,
    .content-card,
    .file-card,
    .tab,
    .view-btn {
        border-width: 3px !important;
    }

    .video-watched-indicator,
    .completion-check {
        font-weight: 800;
    }
}

.folder-card {
    background: var(--white);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding: var(--spacing-lg);
    border-radius: 20px;
    box-shadow: 0 8px 25px var(--shadow);
    transition: all 0.4s;
    border: 1px solid var(--border);
    text-align: center;
    cursor: pointer;
    position: relative;
    min-height: 100%;
}

.folder-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(107, 155, 124, 0.15);
    border-color: var(--primary);
}

.folder-card:active {
    transform: translateY(-5px);
}

.folder-icon {
    font-size: clamp(56px, 8vw, 70px);
    margin-bottom: var(--spacing-md);
    color: var(--primary);
    flex-shrink: 0;
}

.folder-card h3 {
    font-size: clamp(18px, 2.5vw, 20px);
    margin-bottom: var(--spacing-sm);
    color: var(--text-dark);
    font-weight: 700;
    flex-shrink: 0;
}

.folder-card p {
    color: var(--text-gray);
    font-size: var(--font-base);
    margin-bottom: auto;
    flex: 1;
}

.folder-files-count {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    margin-top: var(--spacing-md);
    padding: var(--spacing-xs) var(--spacing-md);
    background: var(--bg-lighter);
    border-radius: 15px;
    font-size: var(--font-small);
    font-weight: 600;
    color: var(--text-gray);
}

.folder-files-count i {
    color: var(--primary);
}

.folder-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 900px;
    max-height: 85vh;
    background: var(--white);
    border-radius: 25px;
    box-shadow: 0 25px 100px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.4s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.folder-modal-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-xl) var(--spacing-xl) var(--spacing-lg);
    border-bottom: 2px solid var(--border);
    background: var(--bg-lighter);
}

.folder-modal-icon {
    width: clamp(60px, 8vw, 70px);
    height: clamp(60px, 8vw, 70px);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(28px, 4vw, 32px);
    color: white;
    flex-shrink: 0;
}

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

.folder-modal-info h2 {
    font-size: clamp(22px, 3vw, 28px);
    color: var(--text-dark);
    margin: 0 0 var(--spacing-xs) 0;
    font-weight: 700;
}

.folder-modal-info p {
    color: var(--text-gray);
    font-size: var(--font-base);
    margin: 0;
}

.folder-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-xl);
}

.folder-files-grid {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.folder-file-card {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--bg-lighter);
    border-radius: 15px;
    transition: all 0.3s;
    border: 2px solid var(--border);
}

.folder-file-card:hover {
    transform: translateX(5px);
    border-color: var(--primary);
    box-shadow: 0 4px 15px var(--shadow);
}

.folder-file-icon {
    font-size: clamp(32px, 5vw, 40px);
    min-width: clamp(45px, 6vw, 50px);
    height: clamp(45px, 6vw, 50px);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--white);
    border-radius: 12px;
    flex-shrink: 0;
}

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

.folder-file-info h4 {
    margin: 0 0 4px 0;
    font-size: var(--font-base);
    color: var(--text-dark);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.folder-file-info p {
    margin: 0;
    font-size: var(--font-small);
    color: var(--text-gray);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-download-small {
    width: clamp(40px, 6vw, 45px);
    height: clamp(40px, 6vw, 45px);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(107, 155, 124, 0.3);
}

.btn-download-small:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 18px rgba(107, 155, 124, 0.4);
}

.content-grid.list-view .folder-card {
    flex-direction: row;
    text-align: left;
    gap: var(--spacing-md);
    align-items: center;
    padding: var(--spacing-md);
}

.content-grid.list-view .folder-icon {
    font-size: clamp(40px, 6vw, 50px);
    margin: 0;
}

.content-grid.list-view .folder-card h3 {
    margin: 0 0 4px 0;
}

.content-grid.list-view .folder-card p {
    margin: 0;
    font-size: var(--font-small);
}

.content-grid.list-view .folder-files-count {
    margin-top: 0;
    margin-left: auto;
}

@media (max-width: 768px) {
    .folder-modal-content {
        width: 95%;
        max-height: 90vh;
    }

    .folder-modal-header {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }

    .folder-file-card {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-sm);
    }

    .btn-download-small {
        width: 100%;
        height: var(--touch-target);
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .folder-modal-content {
        width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }

    .folder-modal-body {
        padding: var(--spacing-md);
    }

    .folder-modal-header {
        padding: var(--spacing-lg);
    }
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
    flex-wrap: wrap;
    gap: var(--spacing-md);
}

.table-header h3 {
    margin: 0;
}

.filter-dropdown {
    position: relative;
}

.filter-btn {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: clamp(10px, 1.5vw, 12px) clamp(18px, 2.5vw, 20px);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: var(--font-small);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(107, 155, 124, 0.3);
}

.filter-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(107, 155, 124, 0.4);
}

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

.filter-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 8px 25px var(--shadow);
    border: 1px solid var(--border);
    min-width: 220px;
    padding: var(--spacing-xs);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s;
    z-index: 100;
}

.filter-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.filter-option {
    width: 100%;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: clamp(10px, 1.5vw, 12px) var(--spacing-md);
    background: transparent;
    border: none;
    border-radius: 8px;
    font-size: var(--font-small);
    font-weight: 600;
    color: var(--text-dark);
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.filter-option:hover {
    background: var(--bg-lighter);
    color: var(--primary);
}

.filter-option.active {
    background: rgba(107, 155, 124, 0.1);
    color: var(--primary);
}

.filter-option i {
    font-size: 14px;
    width: 20px;
    text-align: center;
}

@media (max-width: 768px) {
    .table-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .filter-dropdown {
        width: 100%;
    }

    .filter-btn {
        width: 100%;
        justify-content: center;
    }

    .filter-menu {
        right: 0;
        left: 0;
        width: 100%;
    }
}

.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.stat-card {
    background: var(--white);
    padding: var(--spacing-lg);
    border-radius: 20px;
    box-shadow: 0 8px 25px var(--shadow);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    transition: all 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 35px var(--shadow);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 15px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 28px;
    flex-shrink: 0;
}

.stat-info h3 {
    font-size: clamp(28px, 4vw, 36px);
    font-weight: 700;
    color: var(--text-dark);
    margin: 0 0 5px 0;
}

.stat-info p {
    font-size: var(--font-small);
    color: var(--text-gray);
    margin: 0;
    font-weight: 600;
}

.admin-charts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.chart-card {
    background: var(--white);
    padding: var(--spacing-lg);
    border-radius: 20px;
    box-shadow: 0 8px 25px var(--shadow);
    border: 1px solid var(--border);
}

.chart-card.full-width {
    grid-column: 1 / -1;
}

.chart-card h3 {
    font-size: var(--font-large);
    color: var(--text-dark);
    margin-bottom: var(--spacing-lg);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.chart-card h3 i {
    color: var(--primary);
}

.chart-container {
    min-height: 300px;
}

.users-table-container {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.users-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-lighter);
}

.users-table thead {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
}

.users-table th,
.users-table td {
    padding: var(--spacing-md);
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.users-table th {
    font-weight: 700;
    font-size: var(--font-small);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.users-table td {
    font-size: var(--font-small);
}

.users-table tbody tr {
    transition: background 0.3s;
}

.users-table tbody tr:hover {
    background: var(--white);
}

.progress-bar {
    height: 8px;
    background: var(--border);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    min-width: 100px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 10px;
    transition: width 0.5s;
}

.user-level-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.level-psicologos {
    background: linear-gradient(135deg, #6B9B7C 0%, #5a8a6c 100%);
    color: white;
}

.level-admin {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
}

.level-dev {
    background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%);
    color: white;
}

.last-login {
    font-size: 12px;
    color: var(--text-gray);
    display: flex;
    align-items: center;
    gap: 5px;
}

.last-login i {
    color: var(--primary);
}

@media (min-width: 768px) and (max-width: 1023px) {
    #admin-panel .container {
        padding: 20px 15px;
        max-width: 100%;
    }

    .admin-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .stat-card {
        padding: 15px;
    }

    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 24px;
    }

    .stat-info h3 {
        font-size: 24px;
    }

    .admin-charts {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .chart-card {
        padding: 15px;
    }

    .users-table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -15px;
        padding: 0 15px;
    }

    .users-table {
        min-width: 800px;
    }
}

@media (min-width: 600px) and (max-width: 767px) {
    #admin-panel .container {
        padding: 15px 12px;
        max-width: 100%;
        overflow-x: hidden;
    }

    .welcome-section {
        padding: 20px 15px;
        margin-bottom: 20px;
    }

    .admin-stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .stat-card {
        padding: 15px;
        min-height: auto;
    }

    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 24px;
    }

    .stat-info h3 {
        font-size: 26px;
    }

    .stat-info p {
        font-size: 13px;
    }

    .admin-charts {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .chart-card {
        padding: 15px;
        margin: 0;
        width: 100%;
        box-sizing: border-box;
    }

    .chart-card h3 {
        font-size: 16px;
        margin-bottom: 15px;
    }

    .chart-container {
        min-height: 250px;
        width: 100%;
        overflow-x: hidden;
    }

    .table-header {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }

    .filter-btn {
        width: 100%;
        justify-content: center;
    }

    .filter-menu {
        left: 0;
        right: 0;
        width: 100%;
    }

    .users-table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -12px;
        padding: 0 12px;
        width: calc(100% + 24px);
    }

    .users-table {
        min-width: 700px;
    }

    .users-table th,
    .users-table td {
        padding: 10px 8px;
        font-size: 12px;
    }
}

@media (min-width: 480px) and (max-width: 599px) {
    #admin-panel {
        padding: 0;
        margin: 0;
        width: 100%;
        max-width: 100vw;
    }

    #admin-panel .container {
        padding: 15px 10px;
        max-width: 100%;
        margin: 0;
        width: 100%;
        box-sizing: border-box;
    }

    .welcome-section {
        padding: 18px 12px;
        margin: 0 0 15px 0;
        border-radius: 15px;
    }

    .welcome-section h1 {
        font-size: 22px;
        margin-bottom: 5px;
    }

    .admin-stats-grid {
        grid-template-columns: 1fr;
        gap: 10px;
        margin-bottom: 20px;
    }

    .stat-card {
        padding: 12px;
        flex-direction: column;
        text-align: center;
        gap: 10px;
        width: 100%;
        box-sizing: border-box;
    }

    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 24px;
        margin: 0 auto;
    }

    .stat-info {
        width: 100%;
    }

    .stat-info h3 {
        font-size: 28px;
        margin-bottom: 5px;
    }

    .stat-info p {
        font-size: 12px;
    }

    .admin-charts {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-bottom: 20px;
    }

    .chart-card {
        padding: 12px;
        width: 100%;
        margin: 0;
        box-sizing: border-box;
    }

    .chart-card h3 {
        font-size: 15px;
        margin-bottom: 12px;
        flex-wrap: wrap;
    }

    .chart-container {
        min-height: 220px;
        width: 100%;
        overflow-x: hidden;
    }

    .table-header {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
        width: 100%;
    }

    .table-header h3 {
        font-size: 15px;
    }

    .filter-dropdown {
        width: 100%;
    }

    .filter-btn {
        width: 100%;
        padding: 12px 16px;
        font-size: 13px;
        justify-content: center;
    }

    .filter-menu {
        width: 100%;
        left: 0;
        right: 0;
        min-width: auto;
    }

    .filter-option {
        padding: 12px 15px;
        font-size: 13px;
    }

    .users-table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -10px;
        padding: 0 10px;
        width: calc(100% + 20px);
        border-radius: 8px;
    }

    .users-table {
        min-width: 650px;
        font-size: 11px;
    }

    .users-table th,
    .users-table td {
        padding: 8px 6px;
        font-size: 11px;
    }

    .user-level-badge {
        font-size: 9px;
        padding: 3px 8px;
    }

    .progress-bar {
        min-width: 70px;
        height: 6px;
    }

    .last-login {
        font-size: 10px;
    }
}

@media (min-width: 375px) and (max-width: 479px) {
    #admin-panel {
        padding: 0;
        width: 100%;
        max-width: 100vw;
        overflow-x: hidden;
    }

    #admin-panel .container {
        padding: 12px 8px;
        width: 100%;
        max-width: 100%;
        margin: 0;
        box-sizing: border-box;
    }

    .welcome-section {
        padding: 15px 10px;
        margin: 0 0 12px 0;
        border-radius: 12px;
    }

    .welcome-section h1 {
        font-size: 20px;
        margin-bottom: 5px;
    }

    .admin-stats-grid {
        grid-template-columns: 1fr;
        gap: 8px;
        margin-bottom: 15px;
        width: 100%;
    }

    .stat-card {
        padding: 10px;
        flex-direction: column;
        text-align: center;
        gap: 8px;
        width: 100%;
        box-sizing: border-box;
    }

    .stat-icon {
        width: 45px;
        height: 45px;
        font-size: 22px;
        margin: 0 auto;
    }

    .stat-info {
        width: 100%;
    }

    .stat-info h3 {
        font-size: 24px;
        margin-bottom: 3px;
    }

    .stat-info p {
        font-size: 11px;
    }

    .admin-charts {
        grid-template-columns: 1fr;
        gap: 10px;
        margin-bottom: 15px;
        width: 100%;
    }

    .chart-card {
        padding: 10px;
        width: 100%;
        margin: 0;
        box-sizing: border-box;
    }

    .chart-card h3 {
        font-size: 14px;
        margin-bottom: 10px;
        gap: 5px;
    }

    .chart-card h3 i {
        font-size: 14px;
    }

    .chart-container {
        min-height: 200px;
        width: 100%;
        overflow-x: hidden;
    }

    .table-header {
        flex-direction: column;
        gap: 8px;
        align-items: stretch;
        width: 100%;
    }

    .table-header h3 {
        font-size: 14px;
    }

    .filter-dropdown {
        width: 100%;
    }

    .filter-btn {
        width: 100%;
        padding: 10px 14px;
        font-size: 12px;
        justify-content: center;
    }

    .filter-menu {
        width: 100%;
        left: 0;
        right: 0;
        min-width: auto;
    }

    .filter-option {
        padding: 10px 12px;
        font-size: 12px;
    }

    .filter-option i {
        font-size: 12px;
        width: 16px;
    }

    .users-table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -8px;
        padding: 0 8px;
        width: calc(100% + 16px);
        border-radius: 8px;
    }

    .users-table {
        min-width: 600px;
        font-size: 10px;
    }

    .users-table th,
    .users-table td {
        padding: 7px 5px;
        font-size: 10px;
        white-space: nowrap;
    }

    .user-level-badge {
        font-size: 8px;
        padding: 2px 6px;
    }

    .progress-bar {
        min-width: 60px;
        height: 5px;
    }

    .last-login {
        font-size: 9px;
    }
}

@media (max-width: 374px) {
    #admin-panel {
        padding: 0;
        width: 100%;
        max-width: 100vw;
        overflow-x: hidden;
    }

    #admin-panel .container {
        padding: 10px 6px;
        width: 100%;
        max-width: 100%;
        margin: 0;
        box-sizing: border-box;
    }

    .welcome-section {
        padding: 12px 8px;
        margin: 0 0 10px 0;
        border-radius: 10px;
    }

    .welcome-section h1 {
        font-size: 18px;
        margin-bottom: 3px;
        line-height: 1.2;
    }

    .admin-stats-grid {
        grid-template-columns: 1fr;
        gap: 6px;
        margin-bottom: 12px;
        width: 100%;
    }

    .stat-card {
        padding: 8px;
        flex-direction: column;
        text-align: center;
        gap: 6px;
        width: 100%;
        box-sizing: border-box;
    }

    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 20px;
        margin: 0 auto;
    }

    .stat-info {
        width: 100%;
    }

    .stat-info h3 {
        font-size: 22px;
        margin-bottom: 2px;
    }

    .stat-info p {
        font-size: 10px;
    }

    .admin-charts {
        grid-template-columns: 1fr;
        gap: 8px;
        margin-bottom: 12px;
        width: 100%;
    }

    .chart-card {
        padding: 8px;
        width: 100%;
        margin: 0;
        box-sizing: border-box;
    }

    .chart-card h3 {
        font-size: 13px;
        margin-bottom: 8px;
        gap: 4px;
    }

    .chart-card h3 i {
        font-size: 12px;
    }

    .chart-container {
        min-height: 180px;
        width: 100%;
        overflow-x: hidden;
    }

    .table-header {
        flex-direction: column;
        gap: 6px;
        align-items: stretch;
        width: 100%;
    }

    .table-header h3 {
        font-size: 13px;
    }

    .filter-dropdown {
        width: 100%;
    }

    .filter-btn {
        width: 100%;
        padding: 8px 12px;
        font-size: 11px;
        justify-content: center;
    }

    .filter-btn i {
        font-size: 12px;
    }

    .filter-menu {
        width: 100%;
        left: 0;
        right: 0;
        min-width: auto;
    }

    .filter-option {
        padding: 8px 10px;
        font-size: 11px;
    }

    .filter-option i {
        font-size: 11px;
        width: 14px;
    }

    .users-table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -6px;
        padding: 0 6px;
        width: calc(100% + 12px);
        border-radius: 6px;
    }

    .users-table {
        min-width: 550px;
        font-size: 9px;
    }

    .users-table th,
    .users-table td {
        padding: 6px 4px;
        font-size: 9px;
        white-space: nowrap;
    }

    .user-level-badge {
        font-size: 7px;
        padding: 2px 5px;
    }

    .progress-bar {
        min-width: 50px;
        height: 4px;
    }

    .last-login {
        font-size: 8px;
        flex-direction: column;
        gap: 1px;
        align-items: flex-start;
    }

    .last-login i {
        display: none;
    }
}

@media (max-width: 1023px) {
    .users-table-container::-webkit-scrollbar {
        height: 5px;
    }

    .users-table-container::-webkit-scrollbar-track {
        background: var(--bg-lighter);
        border-radius: 10px;
    }

    .users-table-container::-webkit-scrollbar-thumb {
        background: var(--primary);
        border-radius: 10px;
    }

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

@media print {
    @page {
        margin: 2cm;
        size: A4;
    }

    * {
        animation: none !important;
        transition: none !important;
    }

    .video-player,
    .video-thumbnail,
    .play-icon {
        display: none !important;
    }

    .content-card,
    .file-card {
        border: 1px solid #000 !important;
        margin-bottom: 1cm;
    }

}