:root {
    /* Light Theme */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #e9ecef;
    --text-primary: #0a0a0a;
    --text-secondary: #495057;
    --text-tertiary: #6c757d;
    --border-color: #dee2e6;
    --accent-primary: #ff6b35;
    --accent-secondary: #004e89;
    --accent-hover: #ff8555;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.12);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.16);
}

[data-theme="dark"] {
    --bg-primary: #0f0f0f;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #2a2a2a;
    --text-primary: #f0f0f0;
    --text-secondary: #b8b8b8;
    --text-tertiary: #8a8a8a;
    --border-color: #3a3a3a;
    --accent-primary: #ff6b35;
    --accent-secondary: #00a8e8;
    --accent-hover: #ff8555;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.5);
}

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

body {
    font-family: 'Archivo', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Header */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

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

.menu-toggle {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px;
}

.menu-toggle span {
    width: 20px;
    height: 2px;
    background: var(--text-primary);
    transition: all 0.3s ease;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text-primary);
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: 20px;
}

.logo svg {
    color: var(--accent-primary);
}

.header-center {
    flex: 1;
    max-width: 600px;
    margin: 0 32px;
}

.search-container {
    display: flex;
    border: 1px solid var(--border-color);
    border-radius: 24px;
    overflow: hidden;
    background: var(--bg-secondary);
}

.search-container input {
    flex: 1;
    border: none;
    background: none;
    padding: 10px 16px;
    font-size: 14px;
    color: var(--text-primary);
    outline: none;
}

.search-btn {
    background: var(--bg-tertiary);
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

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

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.theme-toggle,
.upload-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: var(--text-primary);
    border-radius: 50%;
    transition: all 0.2s ease;
}

.theme-toggle:hover,
.upload-btn:hover {
    background: var(--bg-tertiary);
}

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

.user-menu {
    position: relative;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent-primary);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 0;
    min-width: 200px;
    box-shadow: var(--shadow-md);
    display: none;
}

.user-dropdown.active {
    display: block;
}

.dropdown-item {
    display: block;
    padding: 10px 16px;
    color: var(--text-primary);
    text-decoration: none;
    transition: background 0.2s ease;
}

.dropdown-item:hover {
    background: var(--bg-secondary);
}

.user-dropdown hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 8px 0;
}

.login-btn {
    padding: 8px 20px;
    background: var(--accent-primary);
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

.login-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 60px;
    left: 0;
    width: 240px;
    height: calc(100vh - 60px);
    background: var(--bg-primary);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    padding: 16px 0;
    transition: transform 0.3s ease;
}

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

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

.sidebar-nav {
    padding: 0 12px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 12px;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 4px;
    transition: all 0.2s ease;
}

.nav-item:hover {
    background: var(--bg-secondary);
}

.nav-item.active {
    background: var(--bg-tertiary);
    font-weight: 600;
}

.sidebar hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 12px 0;
}

.sidebar-section {
    padding: 0 12px;
    margin-top: 16px;
}

.sidebar-section h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.category-item {
    display: block;
    padding: 8px 12px;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 6px;
    margin-bottom: 4px;
    transition: all 0.2s ease;
}

.category-item:hover {
    background: var(--bg-secondary);
}

.pal-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 6px;
    margin-bottom: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pal-item:hover {
    background: var(--bg-secondary);
}

.pal-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 12px;
}

.pal-name {
    flex: 1;
    font-size: 14px;
}

/* Main Content */
.main-content {
    margin-left: 240px;
    margin-top: 60px;
    padding: 24px;
    min-height: calc(100vh - 60px);
}

.page {
    display: none;
}

.page.active {
    display: block;
}

/* Categories Section */
.categories-section {
    margin-bottom: 48px;
}

.categories-section h2 {
    font-family: 'Space Mono', monospace;
    font-size: 28px;
    margin-bottom: 24px;
    color: var(--text-primary);
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.category-card {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 32px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    color: var(--text-primary);
}

.category-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.category-card svg {
    margin-bottom: 12px;
    color: var(--accent-primary);
}

.category-card h3 {
    font-size: 18px;
    font-weight: 600;
}

/* Videos Section */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.section-header h2 {
    font-family: 'Space Mono', monospace;
    font-size: 24px;
}

.refresh-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    cursor: pointer;
    color: var(--text-primary);
    font-weight: 500;
    transition: all 0.2s ease;
}

.refresh-btn:hover {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

.videos-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 48px;
}

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

.video-card {
    background: var(--bg-secondary);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.video-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent-primary);
}

.video-thumbnail {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    background: var(--bg-tertiary);
    overflow: hidden;
}

.video-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.video-details {
    padding: 12px;
}

.video-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-channel {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.video-meta {
    font-size: 13px;
    color: var(--text-tertiary);
}

/* Toggle Label */
.toggle-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.toggle-label input[type="checkbox"] {
    width: 40px;
    height: 20px;
    appearance: none;
    background: var(--bg-tertiary);
    border-radius: 10px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.toggle-label input[type="checkbox"]:checked {
    background: var(--accent-primary);
}

.toggle-label input[type="checkbox"]::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: white;
    top: 2px;
    left: 2px;
    transition: all 0.3s ease;
}

.toggle-label input[type="checkbox"]:checked::before {
    left: 22px;
}

/* Pagination */
.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 32px;
}

.pagination-controls button {
    padding: 10px 20px;
    background: var(--accent-primary);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

.pagination-controls button:hover:not(:disabled) {
    background: var(--accent-hover);
    transform: translateY(-2px);
}

.pagination-controls button:disabled {
    background: var(--bg-tertiary);
    color: var(--text-tertiary);
    cursor: not-allowed;
}

/* Loading Spinner */
.loading {
    display: flex;
    justify-content: center;
    padding: 40px 0;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--bg-tertiary);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Video Player Page */
.video-container {
    max-width: 1200px;
    margin: 0 auto 32px;
}

.video-player {
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 16px;
}

.video-player video {
    width: 100%;
    display: block;
}

.video-info h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 12px;
}

.video-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 16px;
}

.video-actions {
    display: flex;
    gap: 12px;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    cursor: pointer;
    color: var(--text-primary);
    font-weight: 500;
    transition: all 0.2s ease;
}

.action-btn:hover {
    background: var(--bg-tertiary);
}

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

.video-description {
    background: var(--bg-secondary);
    padding: 16px;
    border-radius: 8px;
    white-space: pre-wrap;
    line-height: 1.6;
}

/* Comments Section */
.comments-section {
    max-width: 1200px;
    margin: 0 auto 32px;
}

.comments-section h3 {
    font-size: 20px;
    margin-bottom: 24px;
}

.comment-form {
    display: flex;
    gap: 12px;
    margin-bottom: 32px;
}

.comment-form textarea {
    flex: 1;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-family: inherit;
    resize: vertical;
}

.comment-form button {
    padding: 12px 24px;
    background: var(--accent-primary);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

.comment-form button:hover {
    background: var(--accent-hover);
}

.comment-item {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: 8px;
}

.comment-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    flex-shrink: 0;
}

.comment-content {
    flex: 1;
}

.comment-header {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.comment-author {
    font-weight: 600;
}

.comment-date {
    color: var(--text-tertiary);
    font-size: 13px;
}

.comment-text {
    margin-bottom: 12px;
    line-height: 1.5;
}

.comment-actions {
    display: flex;
    gap: 16px;
}

.comment-vote {
    display: flex;
    align-items: center;
    gap: 8px;
}

.vote-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 4px;
    transition: all 0.2s ease;
}

.vote-btn:hover {
    color: var(--accent-primary);
}

.vote-btn.active {
    color: var(--accent-primary);
}

.vote-count {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 600;
}

/* Related Videos */
.related-videos {
    max-width: 400px;
}

.related-videos h3 {
    font-size: 18px;
    margin-bottom: 16px;
}

/* Auth Container */
.auth-container {
    max-width: 400px;
    margin: 80px auto;
}

.auth-box {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 32px;
    box-shadow: var(--shadow-md);
}

.auth-box h2 {
    text-align: center;
    margin-bottom: 24px;
    font-family: 'Space Mono', monospace;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.btn-primary {
    width: 100%;
    padding: 12px;
    background: var(--accent-primary);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
}

.auth-switch {
    text-align: center;
    margin-top: 16px;
    color: var(--text-secondary);
}

.auth-switch a {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 600;
}

.auth-switch a:hover {
    text-decoration: underline;
}

/* Upload Page */
.upload-container {
    max-width: 800px;
    margin: 0 auto;
}

.upload-container h2 {
    font-family: 'Space Mono', monospace;
    font-size: 28px;
    margin-bottom: 32px;
}

.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 64px 32px;
    text-align: center;
    background: var(--bg-secondary);
    margin-bottom: 24px;
    transition: all 0.3s ease;
}

.upload-area:hover {
    border-color: var(--accent-primary);
    background: var(--bg-tertiary);
}

.upload-area svg {
    color: var(--text-tertiary);
    margin-bottom: 16px;
}

.upload-area h3 {
    margin-bottom: 8px;
}

.upload-area p {
    color: var(--text-tertiary);
    margin-bottom: 16px;
}

.btn-secondary {
    padding: 10px 24px;
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

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

#videoPreview {
    margin-bottom: 24px;
}

#videoPreview video {
    width: 100%;
    border-radius: 12px;
    margin-bottom: 16px;
}

.video-details {
    background: var(--bg-secondary);
    padding: 16px;
    border-radius: 8px;
}

.video-details p {
    margin-bottom: 8px;
}

.upload-progress {
    margin-bottom: 24px;
}

.progress-bar {
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: var(--accent-primary);
    transition: width 0.3s ease;
}

#progressText {
    text-align: center;
    color: var(--text-secondary);
    font-weight: 600;
}

/* Channel Page */
.channel-header {
    display: flex;
    gap: 24px;
    margin-bottom: 32px;
    padding: 32px;
    background: var(--bg-secondary);
    border-radius: 12px;
}

.channel-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--accent-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 32px;
    font-weight: 700;
    flex-shrink: 0;
}

.channel-info h1 {
    font-size: 28px;
    margin-bottom: 8px;
}

.channel-stats {
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.btn-subscribe {
    padding: 10px 24px;
    background: var(--accent-primary);
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-subscribe:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
}

.btn-subscribe.subscribed {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.channel-featured {
    margin-bottom: 32px;
}

.channel-videos h3 {
    font-size: 20px;
    margin-bottom: 16px;
}

/* Admin Page */
.admin-container {
    max-width: 800px;
    margin: 0 auto;
}

.admin-container h2 {
    font-family: 'Space Mono', monospace;
    font-size: 28px;
    margin-bottom: 32px;
}

.admin-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}

.admin-section h3 {
    font-size: 20px;
    margin-bottom: 20px;
}

/* Thumbnail scrubber */
.thumbnail-scrubber {
    background: var(--bg-primary);
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 16px;
}

.video-preview-container {
    position: relative;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 12px;
}

#scrubberCanvas {
    width: 100%;
    height: auto;
    display: block;
}

.scrubber-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.btn-icon {
    background: rgba(0, 0, 0, 0.7);
    border: none;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.btn-icon:hover {
    background: var(--accent-primary);
    transform: scale(1.1);
}

.timeline-container {
    position: relative;
    margin-bottom: 8px;
}

#timelineSlider {
    width: 100%;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

#timelineSlider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: var(--accent-primary);
    border-radius: 50%;
    cursor: pointer;
}

#timelineSlider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: var(--accent-primary);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.timeline-markers {
    position: absolute;
    top: -20px;
    left: 0;
    right: 0;
    height: 16px;
    pointer-events: none;
}

.timeline-info {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-secondary);
}

/* Tags */
.tags-display {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.tag-item {
    background: var(--bg-tertiary);
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.tag-remove {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.tag-remove:hover {
    background: var(--accent-primary);
    color: white;
}

.video-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0;
}

.video-tag {
    background: var(--bg-secondary);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

/* Categories actions */
.categories-actions {
    text-align: center;
    margin-top: 24px;
}

.categories-actions button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

#showMoreCategories svg {
    transition: transform 0.3s ease;
}

#showMoreCategories.expanded svg {
    transform: rotate(180deg);
}

.categories-grid.collapsed {
    max-height: 400px;
    overflow: hidden;
    position: relative;
}

.categories-grid.collapsed::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: linear-gradient(transparent, var(--bg-primary));
    pointer-events: none;
}

/* Engagement total */
.engagement-total {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    background: var(--bg-secondary);
    border-radius: 20px;
    font-size: 14px;
    color: var(--text-secondary);
    margin-left: 12px;
}

.stats-left {
    flex: 1;
}

/* Edit Video Page */
.video-edit-preview {
    margin-bottom: 24px;
}

.video-edit-preview video {
    width: 100%;
    max-width: 800px;
    border-radius: 12px;
    margin-bottom: 16px;
}

.thumbnail-section {
    background: var(--bg-secondary);
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 24px;
}

.thumbnail-section h3 {
    font-size: 18px;
    margin-bottom: 8px;
}

.help-text {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 16px;
}

.thumbnail-options {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.thumbnail-options .btn-secondary {
    display: flex;
    align-items: center;
    gap: 8px;
}

.thumbnail-preview {
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    background: var(--bg-primary);
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.thumbnail-preview img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 8px;
}

.thumbnail-preview.has-thumbnail {
    border-color: var(--accent-primary);
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.form-actions button {
    flex: 1;
}

/* Video card with edit button */
.video-card-admin {
    position: relative;
}

.edit-video-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    opacity: 0;
    transition: all 0.2s ease;
    z-index: 10;
}

.video-card-admin:hover .edit-video-btn {
    opacity: 1;
}

.edit-video-btn:hover {
    background: var(--accent-primary);
}

.delete-video-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

.delete-video-btn:hover {
    background: #c82333;
}

/* Mobile Responsive */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .categories-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

@media (max-width: 768px) {
    .header-center {
        display: none;
    }
    
    .logo span {
        display: none;
    }
    
    .videos-row,
    .videos-grid {
        grid-template-columns: 1fr;
    }
    
    .video-container {
        padding: 0;
    }
    
    .related-videos {
        max-width: 100%;
    }
    
    .channel-header {
        flex-direction: column;
        text-align: center;
    }
    
    .channel-avatar {
        margin: 0 auto;
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: 16px;
    }
    
    .categories-grid {
        grid-template-columns: 1fr;
    }
    
    .video-info h1 {
        font-size: 18px;
    }
    
    .video-stats {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .comment-form {
        flex-direction: column;
    }
}
