/* Import Inter font */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap');

/*
 * MyTube - Modern Design System
 *
 * Минималистичный дизайн с мягкими цветами и акцентами
 */

:root {
    /* Размеры */
    --player-max-height: min(calc(100dvh - 300px), 1400px);
    --video-card-width: 320px;
    --sidebar-width: 310px;
    --border-radius: 8px;
    --border-radius-small: 8px;
    --border-radius-large: 16px;

    /* Light Theme Colors */
    --bg-primary: oklch(92% 0.004 286.32);
    --bg-secondary: #F5F5FC;
    --bg-card: #FFFFFF;
    --bg-dark: #2A2A32;
    --bg-darker: #1A1A22;
    --bg-hover: #EBEBF5;
    --bg-active: #E0E0F0;
    --bg-overlay: rgba(26, 26, 34, 0.9);
    --bg-overlay-light: rgba(42, 42, 50, 0.04);
    --bg-overlay-medium: rgba(42, 42, 50, 0.2);
    --bg-overlay-modal: rgba(26, 26, 34, 0.6);
    --bg-tertiary: #F0F0F5;

    /* Цвета текста */
    --text-primary: #2A2A32;
    --text-secondary: #55555C;
    --text-muted: #8585A0;
    --text-light: #B5B5C8;
    --text-white: #FFFFFF;
    --text-dark: #1A1A22;

    /* Цвета границ */
    --border-color: #E5E5F0;
    --border-color-dark: #D0D0E0;

    /* Цвета кнопок */
    --btn-primary-bg: #2A2A32;
    --btn-primary-hover: #1A1A22;
    --btn-secondary-bg: #F5F5FC;
    --btn-secondary-hover: #EBEBF5;
    --btn-danger-bg: #FF5A5F;
    --btn-danger-hover: #E74C50;

    /* Цвета акцентов */
    --accent-primary: #14B8A6;
    --accent-primary-light: #5EEAD4;
    --accent-success: #10B981;
    --accent-warning: #F59E0B;
    --accent-warning-bg: #FEF3C7;
    --accent-error: #EF4444;
    --accent-info: #3B82F6;

    /* Цвета состояний */
    --status-success-bg: #ECFDF5;
    --status-success-text: #059669;
    --status-pending-bg: #FEF3C7;
    --status-pending-text: #D97706;
    --status-processing-bg: #DBEAFE;
    --status-processing-text: #2563EB;
    --status-failed-bg: #FEE2E2;
    --status-failed-text: #DC2626;

    /* Тени */
    --shadow-xs: 0 1px 3px rgba(42, 42, 50, 0.06);
    --shadow-sm: 0 2px 8px rgba(42, 42, 50, 0.08);
    --shadow-md: 0 4px 16px rgba(42, 42, 50, 0.10);
    --shadow-lg: 0 8px 24px rgba(42, 42, 50, 0.12);
    --shadow-xl: 0 16px 40px rgba(42, 42, 50, 0.15);

    /* Отступы */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-2xl: 40px;

    /* Переходы */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 350ms ease;
}

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

body {
    font-family: "Montserrat", sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;

}
body:has(.mobile-overlay.active) {
    height: 100dvh; overflow:hidden
    }
a {
    color: inherit;
    text-decoration: none;
}

/* Layout */
.layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    background: var(--bg-card);
    padding: var(--spacing-lg) 16px;
    display: flex;
    flex-direction: column;
    height: calc(100dvh - 40px);
    position: sticky;
    top: 20px;
    border-radius: 20px;
    margin: 20px;
    box-shadow: rgba(0, 0, 0, 0.1) 0px 10px 15px -3px, rgba(0, 0, 0, 0.1) 0px 4px 6px -4px;
    overflow-y: auto;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

.sidebar::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

/* Sidebar Upload Button */
.sidebar-upload-btn {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: 14px 20px;
    background: linear-gradient(135deg, var(--accent-primary) 0%, #8B5CF6 100%);
    color: var(--text-white);
    border-radius: var(--border-radius-small);
    font-weight: 600;
    font-size: 15px;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
    text-decoration: none;
    margin-bottom: var(--spacing-md);
}

.sidebar-upload-btn i {
    font-size: 18px;
}

.sidebar-upload-btn:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.sidebar-upload-btn:active {
    transform: translateY(0);
}

.sidebar-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-dark);
    letter-spacing: -0.02em;
}

.sidebar-header a {
    color: var(--text-dark);
    transition: color var(--transition-normal);
}

.sidebar-header a:hover {
    color: var(--accent-primary);
}

.sidebar-nav {
    display: flex;
    gap: 5px;
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
    .nav-item-all {
       flex: 1
    }
}

.nav-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: 8px 18px;
    border-radius: var(--border-radius-small);
    transition: all var(--transition-normal);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 15px;
}

.nav-item i {
    font-size: 18px;
    width: 20px;
    text-align: center;
}

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

.nav-item.active {
    background: var(--bg-secondary);
    color: var(--accent-primary);
}

.categories-section {
    flex: 1;
}

.categories-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    margin-top: 10px
}

.categories-header h3 {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.8px;
}

.categories-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.category-item-wrapper {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 2px;
    cursor: grab;
    transition: all var(--transition-normal);
}

.category-item-wrapper[draggable="false"] {
    cursor: default;
    padding-left: 7px;
    margin-right: 51px;
    margin-bottom: 0;


    .category-item {
        padding-block: 3px;
        font-size: 13x;
    }
}

.category-item-wrapper:active {
    cursor: grabbing;
}

.category-item-wrapper[draggable="false"]:active {
    cursor: default;
}

.category-item-wrapper.dragging {
    opacity: 0.5;
}

.category-item-wrapper.drag-over {
    border-top: 2px solid var(--btn-primary-bg);
}

.category-item-drag-handle {
    color: var(--text-light);
    font-size: 14px;
    cursor: grab;
    padding: 4px;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.category-item-wrapper:hover .category-item-drag-handle {
    opacity: 1;
}

.category-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 15px;
    border-radius: var(--border-radius-small);
    transition: background var(--transition-normal);
    color: var(--text-secondary);
    flex: 1;
    font-weight: 600
}

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

.category-item.active {
    background: var(--bg-secondary);
    color: var(--accent-primary);
}

.hidden-categories-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    margin-top: 8px;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    border-radius: var(--border-radius-small);
    transition: all var(--transition-normal);
}

.hidden-categories-toggle:hover {
    background: var(--bg-overlay-light);
    color: var(--text-secondary);
}

.hidden-categories-toggle i {
    font-size: 12px;
    width: 12px;
    display: inline-block;
    transition: transform var(--transition-normal);
}

.hidden-categories-toggle.expanded i {
    transform: rotate(90deg);
}

.hidden-categories-list {
    margin-top: 4px;
}

.category-count {
    font-size: 12px;
    color: var(--text-muted);
}

.category-item-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.category-item-wrapper:hover .category-item-actions {
    opacity: 1;
}

.category-action-btn {
    background: none;
    border: none;
    padding: 6px;
    cursor: pointer;
    color: var(--text-muted);
    border-radius: var(--border-radius-small);
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-action-btn:hover {
    background: var(--bg-overlay-light);
    color: var(--text-dark);
}

.main-content {
    flex: 1;
    padding: 10px 20px 20px 10px;
    min-width: 0; /* Allow flex item to shrink below content size */
    overflow-x: hidden;
}

/* Page header */
.page-header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 25px;
    gap: 20px
}
.page-header:has(h1) {
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color-dark);
    padding-bottom: 10px;
    min-height: 59px;
}
.page-header h1 {
    font-size: 24px;
    font-weight: 600
}



/* Buttons */
.btn-primary, .btn-secondary, .btn-danger, .btn-icon {
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius-small);
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: all var(--transition-normal);
    font-family: 'Inter', sans-serif;
}

.btn-primary {
    background: var(--btn-primary-bg);
    color: var(--text-white);
    box-shadow: var(--shadow-xs);
}

.btn-primary:hover {
    background: var(--btn-primary-hover);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

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

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

.btn-danger {
    background: var(--btn-danger-bg);
    color: var(--text-white);
    box-shadow: var(--shadow-xs);
}

.btn-danger:hover {
    background: var(--btn-danger-hover);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    color: var(--btn-primary-bg);
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent
}

.btn-icon:hover {
    opacity: 0.8
}

.btn-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0;
    width: 32px;
    height: 32px;
}

.btn-close:hover {
    color: var(--text-dark);
}

.btn-inline {
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
    align-items: center;
}

/* Input with action button */
.input-with-action {
    display: flex;
    gap: 12px;
    align-items: stretch;
}

.input-with-action input[type="url"],
.input-with-action .custom-file-input {
    flex: 1;
}

/* Custom file input */
.custom-file-input {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-small);
    cursor: pointer;
    transition: all var(--transition-normal);
    color: var(--text-secondary);
    font-size: 14px;
}

.custom-file-input:hover {
    border-color: var(--border-color-dark);
    background: var(--bg-hover);
}

.custom-file-input i {
    color: var(--text-muted);
    font-size: 18px;
}

.custom-file-input span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Videos grid */
.videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(var(--video-card-width), 100%), 1fr));
    gap: 10px;
    max-width: 100%;
}

.video-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
    position: relative;
}

.video-card:hover {

}

.video-card::after {

}

.video-card:hover::after {
    opacity: 1;
}

.video-checkbox {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 10;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

/* Show checkbox on hover */
.video-card:hover .video-checkbox,
.video-card-scroll:hover .video-checkbox {
    opacity: 1;
}

/* Always show all checkboxes if any is checked */
body:has(.video-select:checked) .video-checkbox {
    opacity: 1;
}

.video-select {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.favorite-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-normal);
    backdrop-filter: blur(8px);
}

.favorite-btn i {
    color: var(--text-white);
    font-size: 18px;
    transition: all var(--transition-normal);
}

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

.favorite-btn.active i {
    color: var(--accent-warning);
}

.favorite-btn:active {
    transform: scale(0.95);
}

.refresh-thumbnail-btn {
    position: absolute;
    bottom: 8px;
    z-index: 10;
    background: rgba(0, 0, 0, 0.85);
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-normal);
    backdrop-filter: blur(8px);
    opacity: 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Positioning for preview button (always visible) */
.regenerate-preview-btn {
    left: 8px;
}

/* Positioning for download thumbnail button (only when source_url exists) */
.download-thumbnail-btn {
    left: 44px; /* 8px + 28px (button width) + 8px (gap) */
}

.video-thumbnail:hover .refresh-thumbnail-btn {
    opacity: 1;
}

.refresh-thumbnail-btn i {
    color: var(--text-white);
    font-size: 13px;
    transition: all var(--transition-normal);
}

.refresh-thumbnail-btn:hover {
    background: rgba(99, 102, 241, 0.95);
    transform: scale(1.05);
    border-color: rgba(99, 102, 241, 0.3);
}

.refresh-thumbnail-btn:active {
    transform: scale(0.95);
}

.refresh-thumbnail-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.video-link {
    display: block;
}

.video-thumbnail {
    position: relative;
    padding-top: 56.25%; /* 16:9 aspect ratio */
    background: var(--bg-tertiary);
    overflow: hidden;
}

/* Blurred background for vertical videos */
.video-thumbnail[data-orientation="vertical"]::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: var(--thumb-bg);
    background-size: cover;
    background-position: center;
    filter: blur(15px) brightness(0.9) saturate(0.5);
    z-index: 0;
    scale: 1.4
}

.video-thumbnail[data-orientation="vertical"] {
    --thumb-bg: var(--bg-image);
}

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

/* Contain for vertical videos */
.video-thumbnail[data-orientation="vertical"] img {
    object-fit: contain;
}

/* Preview video styles */
.preview-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 2;
}

/* Contain for vertical video previews */
.video-thumbnail[data-orientation="vertical"] .preview-video {
    object-fit: contain;
}

/* Show blurred background for vertical previews, similar to thumbnails */
.video-thumbnail[data-orientation="vertical"]:has(.preview-video)::before {
    z-index: 1;
}

.video-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.85);
    color: var(--text-white);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 2;
}

.video-info {
    padding: 12px;
}

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

.video-card:hover .video-title,
.video-card-scroll:hover .video-title {
    color: var(--accent-primary);
}

.video-meta {
    display: flex;
    gap: 8px;
    align-items: center;
}

.category-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: var(--bg-secondary);
    border-radius: 10px;
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 500;
    border: 1px solid var(--border-color);
    transition: all var(--transition-fast);
}

.category-badge::before {
    content: '\f07b';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 10px;
    color: var(--text-muted);
}

.category-badge:hover {
    background: var(--bg-hover);
    color: var(--text-dark);
}

.category-badge:hover::before {
    color: var(--accent-primary);
}

/* Empty state */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state h2 {
    margin-bottom: 10px;
    color: var(--text-secondary);
}

.empty-state p {
    margin-bottom: 20px;
}

/* Bulk actions */
.bulk-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: rgba(0,0,0,0.05);
    border-radius: var(--border-radius-small);
    font-size: 12px
}

.bulk-actions  .btn-secondary,
.bulk-actions  .btn-danger {
    padding-block: 5px;
}

[data-theme="dark"] .bulk-actions {
    background: rgba(0,0,0,0.2);
}

.select-input {
    padding: 6px 12px;
    border: 1px solid var(--border-color-dark);
    border-radius: var(--border-radius-small);
    background: var(--bg-card);
    font-size: 14px;
}

[data-theme="dark"] .select-input {
    color: #fff
}

/* Video page */
.video-page {
    max-width: 1200px;
    margin: 12px auto
}

.player-container {
    margin-bottom: 30px;
    background: var(--bg-dark);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    width: 100%;
    min-height: 400px;
    max-height: var(--player-max-height);
    /* aspect-ratio will be set dynamically via JS */
}

/* Video.js Player */
.video-js {
    width: 100% !important;
    height: 100% !important;
    min-height: 400px;
}

.video-js .vjs-tech {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
}

/* Quality selector icon */
.vjs-quality-selector .vjs-icon-placeholder {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    line-height: 1;
}

/* Fullscreen */
.video-js.vjs-fullscreen {
    height: 100vh !important;
}



.processing-notice {
    width: 100%;
    min-height: 400px;
    max-height: var(--player-max-height);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    color: var(--text-dark);
    text-align: center;
    padding: 40px;
}

.processing-notice h2 {
    margin: 20px 0 10px 0;
    font-size: 24px;
}

.processing-notice p {
    color: var(--text-secondary);
    margin: 0;
}

.processing-notice a {
    color: var(--accent-primary);
    text-decoration: underline;
}

.processing-notice .spinner {
    margin-bottom: 20px;
}

.video-details {
    background: var(--bg-card);
    padding: 24px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
}

.video-header {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 16px;
}

.video-title-row {
    display: flex;
    align-items: center;
    gap: 16px;
}

.video-title-row h1 {
    font-size: 24px;
    flex: 1;
    margin: 0;
}

.favorite-btn-large {
    background: rgba(0, 0, 0, 0.05);
    border: 2px solid var(--border-color);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-normal);
    flex-shrink: 0;
}

.favorite-btn-large i {
    color: var(--text-muted);
    font-size: 22px;
    transition: all var(--transition-normal);
}

.favorite-btn-large:hover {
    background: var(--bg-secondary);
    border-color: var(--accent-warning);
    transform: scale(1.05);
}

.favorite-btn-large.active {
    background: var(--accent-warning);
    border-color: var(--accent-warning);
}

.favorite-btn-large.active i {
    color: var(--text-white);
}

.favorite-btn-large:active {
    transform: scale(0.95);
}

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

.video-meta-info {
    display: flex;
    gap: 24px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-secondary);
}

.meta-item i {
    color: var(--text-muted);
    font-size: 16px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
}

.info-card {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    transition: all var(--transition-normal);
}

.info-card:hover {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-sm);
}

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

.info-card-header i {
    color: var(--accent-primary);
    font-size: 18px;
}

.info-card-header h3 {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    margin: 0;
}

.info-card p {
    color: var(--text-primary);
    line-height: 1.6;
    margin: 0;
}

.info-card-description {
    margin-bottom: 16px;
}

.video-info-block {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 20px;
    margin: 24px 0;
}

.info-row {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-color);
}

.info-row:last-child {
    border-bottom: none;
}

.info-row:first-child {
    padding-top: 0;
}

.info-row-description {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.info-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-label i {
    font-size: 14px;
}

.info-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tags-content {
    display: flex;
    flex-wrap: wrap;
    flex-direction: row;
    gap: 8px;
}

.category-link {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    transition: color var(--transition-fast);
}

.category-link:hover {
    color: var(--accent-primary);
}

.description-content {
    max-height: 72px;
    overflow: hidden;
    transition: max-height var(--transition-normal);
    position: relative;
}

.description-content.expanded {
    max-height: none;
}

.description-content.has-overflow::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(to bottom, transparent, var(--bg-secondary));
    pointer-events: none;
    opacity: 1;
    transition: opacity var(--transition-normal);
}

.description-content.has-overflow.expanded::after {
    opacity: 0;
}

.description-text {
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.6;
    color: var(--text-primary);
    margin: 0;
}

.description-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--accent-primary);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: var(--border-radius-small);
    transition: all var(--transition-fast);
    align-self: flex-start;
}

.description-toggle:hover {
    background: var(--accent-primary);
    color: var(--text-white);
    border-color: var(--accent-primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.description-toggle i {
    font-size: 10px;
    transition: transform var(--transition-fast);
}

.source-section {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 20px 0;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
}

.source-section i:first-child {
    color: var(--text-muted);
    font-size: 14px;
}

/* Debug Section */
.debug-section {
    margin: 20px 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.debug-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: var(--bg-secondary);
    cursor: pointer;
    user-select: none;
    transition: background var(--transition-fast);
}

.debug-header:hover {
    background: var(--bg-hover);
}

.debug-header h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    margin: 0;
    color: var(--text-primary);
}

.debug-header i.fa-bug {
    color: var(--accent-warning);
}

.debug-header i.fa-chevron-down {
    color: var(--text-muted);
    transition: transform var(--transition-normal);
}

.debug-content {
    display: none;
    padding: 16px;
}

.debug-loading {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
}

.debug-error {
    padding: 12px;
    background: var(--status-failed-bg);
    color: var(--status-failed-text);
    border-radius: var(--border-radius-small);
}

.debug-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.debug-section-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 16px;
}

.debug-section-card h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 12px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.debug-section-card h4 i {
    color: var(--accent-primary);
}

.debug-meta-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.debug-meta-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid var(--border-color);
}

.debug-meta-item:last-child {
    border-bottom: none;
}

.debug-meta-item .label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.debug-meta-item .value {
    font-size: 12px;
    color: var(--text-primary);
    font-weight: 600;
    font-family: 'Courier New', monospace;
}

.debug-files-table {
    overflow-x: auto;
}

.debug-files-table h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 12px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.debug-files-table h4 i {
    color: var(--accent-primary);
}

.debug-files-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.debug-files-table th {
    background: var(--bg-secondary);
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border-color);
}

.debug-files-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-color);
}

.debug-files-table tr:last-child td {
    border-bottom: none;
}

.debug-files-table tr:hover {
    background: var(--bg-secondary);
}

.file-type-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.file-type-badge.original {
    background: var(--accent-info);
    color: white;
}

.file-type-badge.\32 160p {
    background: #9333ea;
    color: white;
}

.file-type-badge.\31 080p {
    background: var(--accent-primary);
    color: white;
}

.file-type-badge.\37 20p {
    background: var(--accent-success);
    color: white;
}

.file-type-badge.\34 80p {
    background: var(--accent-warning);
    color: var(--text-dark);
}

.file-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 500;
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

.file-badge.symlink {
    background: var(--accent-warning-bg);
    color: var(--accent-warning);
    font-weight: 600;
}

.file-badge.hardlink {
    background: var(--status-success-bg);
    color: var(--status-success-text);
    font-weight: 600;
}

.debug-files-table .filename {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: var(--text-primary);
    font-weight: 600;
    	word-break: break-all;
}

.debug-files-table .filepath {
    font-family: 'Courier New', monospace;
    font-size: 11px;
    color: var(--text-primary);
    word-break: break-all;
    font-weight: 600
}

/* Pagination Styles */
.pagination-container {
    margin: 40px 0 60px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.pagination-info {
    text-align: center;
}

.video-counter {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    padding: 8px 20px;
    opacity: 0.5
}

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

.load-more-btn,
.load-all-btn {
    min-width: 160px;
}

.load-more-btn {
    font-weight: 600;
}

.load-all-btn {
    opacity: 0.9;
}

.load-more-btn:disabled,
.load-all-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Mobile responsive for pagination */
@media (max-width: 768px) {
    .pagination-container {
        margin: 30px 0 40px 0;
    }

    .pagination-actions {
        width: 100%;
        padding: 0 16px;
    }

    .load-more-btn,
    .load-all-btn {
        flex: 1;
        min-width: 0;
    }

    .video-counter {
        font-size: 13px;
    }
}

/* Mobile responsive for debug files table */
@media (max-width: 768px) {
    .debug-files-table {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .debug-files-table table {
        font-size: 11px;
    }

    /* Hide less important columns on mobile */
    .debug-files-table th:nth-child(5),
    .debug-files-table td:nth-child(5) {
        display: none;
    }

    .debug-files-table th,
    .debug-files-table td {
        padding: 8px 6px;
    }

    .debug-files-table .filename {
        font-size: 10px;
        max-width: 120px;
        overflow: hidden;
        text-overflow: ellipsis;
        	word-break: break-all;
    }

    .file-type-badge {
        padding: 3px 6px;
        font-size: 9px;
    }

    .file-badge {
        padding: 2px 6px;
        font-size: 9px;
    }

    .debug-info-grid {
        grid-template-columns: 1fr;
    }

    .debug-section-card {
        padding: 12px;
    }

    .debug-section-card h4 {
        font-size: 12px;
    }

    .debug-meta-item .label,
    .debug-meta-item .value {
        font-size: 11px;
    }
}

.info-section {
    margin-bottom: 20px;
}

.info-section h3 {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    display: inline-block;
    padding: 6px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 13px;
    color: var(--text-primary);
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.tag:hover {
    background: var(--accent-primary);
    color: var(--text-white);
    border-color: var(--accent-primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* Resolution Badges */
.resolution-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.resolution-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--accent-primary);
    color: var(--text-white);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    font-family: 'Courier New', monospace;
    letter-spacing: 0.5px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s linear
}

.resolution-badge:hover {
    opacity: 0.8;
    transform: translateY(-1px);
}

.resolution-badge i {
    font-size: 11px;
}

[data-theme="dark"] .resolution-badge {
    color: #000
}

.category-badge-large {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: linear-gradient(135deg, var(--accent-primary) 0%, #8B5CF6 100%);
    color: var(--text-white);
    border-radius: var(--border-radius-small);
    font-size: 14px;
    font-weight: 600;
}

.source-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--accent-primary);
    text-decoration: none;
    padding: 8px 12px;
    border-radius: var(--border-radius-small);
    word-break: break-all;
    width: 100%
}



.source-link i {
    flex-shrink: 0;
    font-size: 14px;
}

.text-muted {
    color: var(--text-muted);
}

.link {
    color: var(--accent-primary);
    text-decoration: underline;
}

.link:hover {
    opacity: 0.8;
}

/* Forms */
.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    font-size: 15px;
    color: var(--text-primary);
}

.form-group input[type="text"],
.form-group input[type="url"],
.form-group input[type="file"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-small);
    font-size: 15px;
    font-family: inherit;
    background: var(--bg-card);
    color: var(--text-primary);
    transition: all var(--transition-normal);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: var(--bg-card);
    box-shadow: 0 0 0 3px var(--bg-overlay-light);
}

.form-group input[type="checkbox"] {
    width: auto;
    margin-right: 10px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.form-group textarea.auto-expand {
    resize: none;
    overflow: hidden;
    min-height: 100px;
    transition: height var(--transition-fast);
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    justify-content: flex-end;
}

.settings-section .form-actions {
    margin-top: 8px;
}

/* Thumbnail preview */
.thumbnail-preview {
    margin-top: 20px;
    text-align: center;
    position: relative;
    width: 640px;
    max-height: 480px;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    border-radius: var(--border-radius-small);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin-bottom: 45px
}

.thumbnail-preview::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: var(--preview-bg);
    background-size: cover;
    background-position: center;
    filter: blur(15px) brightness(0.9) saturate(0.5);
    scale: 1.1;
    z-index: 0;
}

.thumbnail-preview img {
    position: relative;
    width: 100%;
    max-height: 480px;
    height: auto;
    object-fit: contain;
    display: block;
    margin: 0 auto;
    z-index: 1;
}

#thumbnailTime {
    margin-top: 8px;
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 600;
    display: none
}

/* Modern Range Slider */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(to right, var(--accent-primary) 0%, var(--accent-primary) 50%, var(--bg-hover) 50%, var(--bg-hover) 100%);
    outline: none;
    transition: all var(--transition-normal);
    margin: 16px 0;
    cursor: pointer;
}

input[type="range"]:hover {
    background: linear-gradient(to right, var(--accent-primary) 0%, var(--accent-primary) 50%, var(--bg-active) 50%, var(--bg-active) 100%);
}

/* Webkit (Chrome, Safari, Edge) */
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-primary);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
    transition: all var(--transition-normal);
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.6);
}

input[type="range"]::-webkit-slider-thumb:active {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.5);
}

/* Firefox */
input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-primary);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
    transition: all var(--transition-normal);
}

input[type="range"]::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.6);
}

input[type="range"]::-moz-range-thumb:active {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.5);
}

input[type="range"]::-moz-range-track {
    height: 6px;
    border-radius: 3px;
    background: var(--bg-hover);
}

/* Dark theme adjustments */
[data-theme="dark"] input[type="range"] {
    background: linear-gradient(to right, var(--accent-primary) 0%, var(--accent-primary) 50%, #4C566A 50%, #4C566A 100%);
}

[data-theme="dark"] input[type="range"]:hover {
    background: linear-gradient(to right, var(--accent-primary) 0%, var(--accent-primary) 50%, #5E6A80 50%, #5E6A80 100%);
}

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

.video-thumbnail-preview {
    text-align: center;
    margin-bottom: 24px;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    animation: fadeIn 0.3s ease;
}

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

.video-thumbnail-preview img {

    width: 100%;
    height: auto;
    border-radius: var(--border-radius-small);
    box-shadow: var(--shadow-md);
    background: var(--bg-hover);
}

.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 30px;
    border-bottom: 1px solid var(--border-color);
}

.tab-btn {
    padding: 12px 24px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-size: 15px;
    color: var(--text-secondary);
    transition: all var(--transition-normal);
}

.tab-btn:hover {
    color: var(--text-dark);
}

.tab-btn.active {
    color: var(--text-dark);
    border-bottom-color: var(--text-dark);
    font-weight: 500;
}

.tab-content {
    display: none;
}

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

/* Metadata loading */
.metadata-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 60px 20px;
}

.loading-animation {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-lg);
}

.loading-icon {
    font-size: 48px;
    color: var(--accent-primary);
}

.loading-text {
    text-align: center;
}

.loading-text h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

.loading-text p {
    font-size: 14px;
    color: var(--text-muted);
    margin: 0;
}

/* Upload Progress */
.upload-progress {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
    padding: 40px 20px;
}

.progress-animation {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
}

.progress-icon {
    font-size: 48px;
    color: var(--accent-primary);
    flex-shrink: 0;
}

.progress-icon .fa-circle-check {
    color: var(--accent-success);
}

.progress-icon .fa-circle-xmark {
    color: var(--accent-error);
}

.progress-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

/* Progress bar */
.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-hover);
    border-radius: var(--border-radius-small);
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: var(--btn-primary-bg);
    width: 0%;
    transition: width 0.3s;
    animation: progress 1.5s ease-in-out infinite;
}

@keyframes progress {
    0% { width: 0%; }
    50% { width: 50%; }
    100% { width: 100%; }
}

.progress-text {
    font-size: 14px;
    color: var(--text-secondary);
    text-align: center;
}

/* Stats page */
.stats-page {
    max-width: 1000px;
    margin: 0 auto
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: var(--bg-card);
    padding: 24px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    text-align: center;
}

.stat-card h3 {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 10px;
    text-transform: uppercase;
}

.stat-value {
    font-size: 32px;
    font-weight: 600;
    color: var(--text-dark);
}

.stat-card-total {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border: 2px solid var(--accent-primary);
    box-shadow: var(--shadow-md);
}

.stat-card-total h3 {
    font-weight: 600;
}

.stat-card-total .stat-value {
    font-size: 36px;
}

.category-stats h2 {
    font-size: 20px;
    margin-bottom: 20px;
}

.stats-table {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.stats-table table {
    width: 100%;
    border-collapse: collapse;
}

.stats-table th,
.stats-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--bg-hover);
}

.stats-table th {
    background: var(--bg-secondary);
    font-weight: 600;
    font-size: 14px;
    color: var(--text-secondary);
}

.stats-table tr:last-child td {
    border-bottom: none;
}

.stats-table a {
    color: var(--accent-primary);
}

.stats-table a:hover {
    text-decoration: underline;
}

/* Settings page */
.settings-page {
    max-width: 900px;
    margin: 0 auto;
}

.settings-page > h1 {
    margin-bottom: 24px;
}

/* Settings Tabs */
.settings-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    padding: 6px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    overflow-x: auto;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

.settings-tabs::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.settings-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: transparent;
    border: none;
    border-radius: var(--border-radius-small);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    flex-shrink: 0;
}

.settings-tab i {
    font-size: 16px;
}

.settings-tab:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.settings-tab.active {
    background: var(--bg-card);
    color: var(--accent-primary);
    box-shadow: var(--shadow-xs);
}

.settings-tab.active i {
    color: var(--accent-primary);
}

/* Mobile: Hide text, show only icons */
@media (max-width: 768px) {

.settings-page {
    margin: 0 20px 20px
}
    .settings-tab span {
        display: none;
    }

    .settings-tab {
        padding: 12px 16px;
    }

    .settings-tab i {
        font-size: 18px;
    }

    .setting-item {
        flex-direction: column;
        align-items: flex-start !important;
    }
}

/* Settings Content */
.settings-content {
    position: relative;
}

.settings-section {
    display: none;
    flex-direction: column;
    gap: 16px;
    padding: 28px;
    background: var(--bg-card);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    animation: fadeIn 0.3s ease;
}

.settings-section.active {
    display: flex;
}

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

.settings-section h2 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

.settings-section h2 i {
    color: var(--accent-primary);
    font-size: 22px;
}

.section-description {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

/* Logs Page */
.logs-page {
    max-width: 1400px;
    margin: 0 auto;
}

.logs-page .page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.logs-page h1 {
    margin: 0;
}

.logs-table {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.logs-table table {
    width: 100%;
    border-collapse: collapse;
    min-width: 900px;
}

.logs-table th,
.logs-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.logs-table th {
    background: var(--bg-secondary);
    font-weight: 600;
    color: var(--text-secondary);
    position: sticky;
    top: 0;
    z-index: 10;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.logs-table th i {
    margin-right: 6px;
    opacity: 0.7;
}

.logs-table tbody {
    font-size: 14px;
}

.log-row {
    transition: background-color var(--transition-fast);
}

.log-row:hover {
    background: var(--bg-hover);
}

.log-row:last-child td {
    border-bottom: none;
}

/* Log row status colors */
.log-row.log-success {
    border-left: 3px solid var(--status-success-text);
}

.log-row.log-error {
    border-left: 3px solid var(--status-failed-text);
}

.log-row.log-processing {
    border-left: 3px solid var(--status-processing-text);
}

.log-row.log-info {
    border-left: 3px solid var(--accent-info);
}

/* Log time column */
.log-time {
    white-space: nowrap;
}

.log-time .relative-time {
    display: block;
    font-weight: 500;
    color: var(--text-primary);
}

.log-time .absolute-time {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Log action column */
.log-action {
    font-weight: 500;
    color: var(--text-secondary);
}

/* Log details column */
.log-details {
    color: var(--text-secondary);
    max-width: 400px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Log video column */
.log-video a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.log-video a:hover {
    color: var(--accent-primary-hover);
    text-decoration: underline;
}

/* Status badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--border-radius-small);
    font-size: 12px;
    font-weight: 600;
    text-transform: capitalize;
}

.status-badge i {
    font-size: 13px;
}

.status-success {
    background: var(--status-success-bg);
    color: var(--status-success-text);
}

.status-error {
    background: var(--status-failed-bg);
    color: var(--status-failed-text);
}

.status-processing {
    background: var(--status-processing-bg);
    color: var(--status-processing-text);
}

.status-info {
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent-info);
}

.temp-expiry-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: var(--border-radius-small);
    font-size: 12px;
    font-weight: 500;
    background: var(--accent-warning-bg);
    color: var(--accent-warning);
}

.temp-expiry-badge i {
    font-size: 11px;
}

.temp-expiry-meta {
    color: var(--accent-warning);
    font-weight: 600;
}

.temp-expiry-meta i {
    color: var(--accent-warning) !important;
}

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

.modal-content {
    background: var(--bg-card);
    padding: 24px;
    border-radius: var(--border-radius);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

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

.category-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

/* Processing placeholder */
.processing-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 14px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--bg-tertiary);
    border-top: 4px solid var(--btn-primary-bg);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.status-pending {
    background: var(--status-pending-bg);
    color: var(--status-pending-text);
}

.status-processing {
    background: var(--status-processing-bg);
    color: var(--status-processing-text);
}

.status-failed {
    background: var(--status-failed-bg);
    color: var(--status-failed-text);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
}

.toast {
    background: var(--bg-card);
    padding: 16px 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s ease-out;
    border-left: 4px solid var(--btn-primary-bg);
}

.toast.toast-success {
    border-left-color: var(--accent-success);
}

.toast.toast-error {
    border-left-color: var(--accent-error);
}

.toast.toast-info {
    border-left-color: var(--accent-info);
}

.toast.toast-warning {
    border-left-color: var(--accent-warning);
}

.toast-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.toast-success .toast-icon {
    color: var(--accent-success);
}

.toast-error .toast-icon {
    color: var(--accent-error);
}

.toast-info .toast-icon {
    color: var(--accent-info);
}

.toast-warning .toast-icon {
    color: var(--accent-warning);
}

.toast-message {
    flex: 1;
    font-size: 14px;
    color: var(--text-dark);
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.toast-close:hover {
    color: var(--text-dark);
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

.toast.toast-hiding {
    animation: slideOut 0.3s ease-in forwards;
}

/* Modal improvements */
.modal-small {
    max-width: 400px;
}

.modal-body {
    padding: 20px 0;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-dark);
}

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

/* View Switcher */
.view-switcher {
    display: flex;
    gap: 4px;
    background: rgba(0,0,0,0.05);
    padding: 4px;
    border-radius: 12px;
}

[data-theme="dark"] .view-switcher {

    background: rgba(0,0,0,0.2);
}

.view-btn {
    padding: 8px 12px;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
}

.view-btn:hover {
    background: var(--bg-overlay-light);
    color: var(--text-dark);
}

.view-btn.active {
    background: var(--bg-card);
    color: var(--text-dark);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Categories View */
#categoriesView {
    max-width: 100%;
    overflow-x: hidden;
}

.category-row {
    margin-bottom: 20px;
    max-width: 100%;
    overflow: hidden;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color-dark);
}

.category-row:last-child {
    border-bottom: none;
}

.category-row-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding: 0 4px;
}

.category-row-header h2 {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    color: var(--text-dark);
    letter-spacing: -0.02em;
}

.video-count-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.video-count-badge::before {
    content: '\f03d';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 11px;
    color: var(--text-muted);
}

.view-all-link {
    margin-left: auto;
    color: var(--primary-color);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all var(--transition-fast);
    padding: 6px 12px;
    border-radius: 8px;
}

.view-all-link:hover {
    background: var(--bg-secondary);
    color: var(--primary-hover);
}

.videos-scroll-container {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 12px;
    scroll-behavior: smooth;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

.videos-scroll-container::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.video-card-scroll {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
    position: relative;
    width: var(--video-card-width);
    min-width: var(--video-card-width);
    max-width: var(--video-card-width);
    flex-shrink: 0;
}

.video-card-scroll:hover {

}

.video-card-scroll::after {

}

.video-card-scroll:hover::after {
    opacity: 1;
}

/* Sidebar Footer */
.sidebar-footer {
    display: flex;
    gap: var(--spacing-xs);
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--border-color);
    margin-top: auto;
    flex-direction: column;
}

.sidebar-footer .footer-links {
    gap: var(--spacing-xs);
    justify-content: space-around;
}

.footer-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--border-radius-small);
    color: var(--text-light);
    transition: all var(--transition-normal);
    background: none;
    border: none;
    cursor: pointer;
    text-decoration: none;
}

.footer-link i {
    font-size: 18px;
}

.footer-link:hover {
    background: var(--bg-hover);
    color: var(--text-secondary);
}

.footer-link.active {
    background: var(--bg-active);
    color: var(--accent-primary);
}

/* Upload Button */
.btn-upload {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--accent-primary) 0%, #8B5CF6 100%);
    color: var(--text-white);
    border-radius: var(--border-radius-small);
    font-weight: 600;
    font-size: 15px;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
    text-decoration: none;
}

.btn-upload i {
    font-size: 18px;
}

.btn-upload:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.btn-upload:active {
    transform: translateY(0);
}

/* Icon sizing for Font Awesome */
.view-btn i {
    font-size: 18px;
}

.category-item-drag-handle i {
    font-size: 12px;
}

.category-action-btn i {
    font-size: 14px;
}

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

/* Button icons */
.btn-primary i,
.btn-secondary i,
.btn-danger i {
    margin-right: 6px;
}

/* Tab button icons */
.tab-btn i {
    margin-right: 6px;
    font-size: 14px;
}

/* Mobile Header */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    padding: 0 var(--spacing-md);
    align-items: center;
    gap: var(--spacing-md);
    z-index: 1001;
    box-shadow: var(--shadow-sm);
}

.mobile-header h1 {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
}

.burger-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-dark);
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--border-radius-small);
    transition: background var(--transition-normal);
}

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

.mobile-header-center {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.mobile-header-center .view-switcher {
    margin: 0;
}

.mobile-upload-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 34px;
    background: linear-gradient(135deg, var(--accent-primary) 0%, #8B5CF6 100%);
    color: var(--text-white);
    border-radius: var(--border-radius-small);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
    text-decoration: none;
}

.mobile-upload-btn i {
    font-size: 20px;
}

.mobile-upload-btn:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.mobile-upload-btn:active {
    transform: translateY(0);
}

/* Mobile Overlay */
.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-overlay-modal);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-normal);
}

.mobile-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* Responsive Breakpoints */
@media (max-width: 1200px) {
    :root {
        --video-card-width: 280px;
    }
    
    .videos-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 16px;
    }
}

@media (max-width: 1024px) {
    :root {
        --sidebar-width: 260px;
        --video-card-width: 260px;
    }
    
    .sidebar {
        margin: 15px;
        padding: var(--spacing-xl) var(--spacing-md);
    }
    
    .main-content {
        padding: 20px;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .page-header-actions {
        width: 100%;
        flex-wrap: wrap;
    }
}

@media (max-width: 768px) {
.search-filters-container {
    display: none !important
}
.video-info-block .info-row:has(.tags-content) {
    display: flex;
    flex-direction: column;
}
.tags-content {
    gap: 4px
}
.tag {
    padding: 1px 10px
}

.player-container {
    --player-max-height: 90vh;
    border-radius: 0;
}
.category-row {margin-bottom: 30px}
    .category-row-header {
        padding: 0 8px;
    }

    .category-row-header h2 {
        font-size: 18px;
    }

    .video-count-badge {
        font-size: 11px;
        padding: 5px 10px;
    }
    /* Show mobile header */
    .mobile-header {
        display: flex;
        height: 50px;
        padding: 0 12px;
        gap: 8px;
    }

    /* Hide desktop sidebar by default */
    .sidebar {
        position: fixed;
        top: 50px;
        left: 0;
        height: calc(100vh - 50px);
        margin: 0;
        border-radius: 0;
        transform: translateX(-100%);
        transition: transform var(--transition-normal);
        z-index: 1000;
        box-shadow: none;
        overflow-y: auto;
    }
    
    /* Show sidebar when mobile-open */
    .sidebar.mobile-open {
        transform: translateX(0);
        box-shadow: var(--shadow-xl);
    }
    
    /* Show overlay when sidebar is open */
    body.sidebar-open .mobile-overlay {
        display: block;
    }
    
    /* Adjust layout */
    .layout {
        flex-direction: column;
        padding-top: 50px;
    }
    
    .main-content {
        padding: 0px;
        width: 100%;
    }
    
    /* Videos grid */
    .videos-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 12px;
    }
    
    /* Page header */
    .page-header {
        margin-bottom: 20px;
    }

    .page-header h1 {
        display: none; /* Hide title on mobile */
    }

    .page-header-actions {
        gap: 10px;
        width: 100%;
    }

    .upload-page,
    .stats-page,
    .logs-page,
    .video-page {
        padding: 16px
    }

    /* Hide all main page titles on mobile */
    .upload-page > h1,
    .stats-page > h1,
    .logs-page > h1,
    .video-page h1 {
        display: none;
    }

    /* Upload button - hide on mobile */
    .btn-upload {
        display: none;
    }

    /* Category actions - more compact on mobile */
    .category-actions {
        gap: 6px;
    }

    .category-actions button {
        padding: 8px 12px;
        font-size: 13px;
    }

    .category-actions button i {
        margin-right: 4px;
    }

    /* View switcher - will be moved to mobile header */
    .view-switcher {
        /* Styling handled by mobile-header-actions */
    }
    
    /* Video cards */
    .video-card {
        border-radius: 8px;
    }
    
    .video-title {
        font-size: 13px;
    }
    
    .video-duration {
        font-size: 11px;
        padding: 2px 4px;
    }
    
    /* Category badges */
    .category-badge {
        font-size: 11px;
        padding: 3px 6px;
    }

    /* Video page metadata */
    .video-metadata-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 12px;
        margin: 12px 0;
        background: var(--bg-secondary);
        border: none;
        border-radius: var(--border-radius-small);
    }

    .tags-display {
        width: 100%;
    }

    .source-section {
        padding: 12px;
        margin: 12px 0;
    }
    
    /* Bulk actions */
    .bulk-actions {
        flex-wrap: wrap;
        padding: 10px 12px;
        gap: 8px;
        width: 100%;
    }
    
    .bulk-actions select {
        flex: 1;
        min-width: 150px;
    }
    
    /* Video page */
    .video-page {
        padding: 0;
        margin-top: 0;
    }
    
    .video-details {
        border-radius: 16px;
        padding: 16px;
    }
    
    .video-header {
        gap: 12px;
    }

    .video-title-row h1 {
        font-size: 20px;
    }

    .favorite-btn-large {
        width: 40px;
        height: 40px;
    }

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

    .favorite-btn {
        width: 32px;
        height: 32px;
    }

    .favorite-btn i {
        font-size: 16px;
    }
    
    .video-actions {
        width: 100%;
        flex-direction: row;
    }
    
    .video-actions button {
        flex: 1;
        font-size: 14px;
    }
    
    .video-meta-info {
        flex-wrap: wrap;
        gap: 12px;
    }

    .meta-item {
        font-size: 13px;
    }

    .meta-item i {
        font-size: 14px;
    }

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

    .info-card {
        padding: 16px;
    }
    
    /* Upload page */
    .upload-page h1 {
        font-size: 24px;
    }
    
    .tabs {
        margin-bottom: 20px;
    }
    
    .tab-btn {
        padding: 10px 16px;
        font-size: 14px;
    }
    
    .form-group label {
        font-size: 13px;
    }
    
    .form-group input,
    .form-group textarea,
    .form-group select {
        font-size: 14px;
    }
    
    /* Stats page */
    .stats-page h1 {
        font-size: 24px;
        margin-bottom: 20px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-bottom: 30px;
    }
    
    .stat-card {
        padding: 16px;
    }
    
    .stat-value {
        font-size: 28px;
    }
    
    .stats-table,
    .logs-table {
        border-radius: 12px;
        overflow-x: auto;
    }
    
    .stats-table th,
    .stats-table td,
    .logs-table th,
    .logs-table td {
        padding: 10px 12px;
        font-size: 13px;
    }
    
    /* Logs page */
    .logs-page h1 {
        font-size: 24px;
        margin-bottom: 20px;
    }
    
    /* Modals */
    .modal-content {
        width: 95%;
        padding: 20px;
        border-radius: 16px;
    }
    
    .modal-header h2 {
        font-size: 18px;
    }
    
    /* Toast notifications */
    .toast-container {
        left: 10px;
        right: 10px;
        bottom: 70px; /* Above mobile navigation */
        max-width: none;
    }
    
    .toast {
        width: 100%;
        padding: 12px 16px;
    }
    
    .toast-message {
        font-size: 13px;
    }
    
    /* Categories view */
    .category-row-header h2 {
        font-size: 18px;
    }
    
    .video-count-badge {
        font-size: 12px;
        padding: 3px 8px;
    }
    
    .videos-scroll-container {
        gap: 0px;
    }
    
    .video-card-scroll {
        width: 200px;
        min-width: 200px;
        max-width: 200px;
        border-radius: 16px;
        margin-left: 8px;
        margin-right: 8px;
    }
    .video-card-scroll:first-of-type {
        margin-left: 16px;
    }
    /* Thumbnail preview */
    .thumbnail-preview img {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    /* Extra small screens */
    .videos-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 10px;
        padding: 0 16px
    }
    
    .page-header h1 {
        font-size: 20px;
    }
    
    .btn-upload {
        padding: 8px 12px;
    }
    
    .video-title {
        font-size: 12px;
        -webkit-line-clamp: 2;
    }
    
    .stat-card h3 {
        font-size: 12px;
    }
    
    .stat-value {
        font-size: 24px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions button {
        width: 100%;
    }
    
    .video-actions {
        flex-direction: column;
    }
}

/* Landscape mobile */
@media (max-width: 768px) and (orientation: landscape) {
    :root {
        --player-max-height: 70vh;
    }
    
    .mobile-header {
        height: 50px;
    }
    
    .layout {
        padding-top: 50px;
    }
}


/* Dark Theme */
[data-theme="dark"] {
    /* Nord Dark Theme Colors */
    --bg-primary: #2E3440;
    --bg-secondary: #3B4252;
    --bg-card: #434C5E;
    --bg-dark: #2E3440;
    --bg-darker: #2E3440;
    --bg-hover: #4C566A;
    --bg-active: #5E6A80;
    --bg-overlay: rgba(46, 52, 64, 0.95);
    --bg-overlay-light: rgba(216, 222, 233, 0.05);
    --bg-overlay-medium: rgba(216, 222, 233, 0.1);
    --bg-overlay-modal: rgba(46, 52, 64, 0.85);
    --bg-tertiary: #3B4252;

    /* Nord Dark Text Colors */
    --text-primary: #ECEFF4;
    --text-secondary: #D8DEE9;
    --text-muted: #88C0D0;
    --text-light: #81A1C1;
    --text-white: #ECEFF4;
    --text-dark: #ECEFF4;

    /* Nord Dark Borders */
    --border-color: #4C566A;
    --border-color-dark: #5E6A80;

    /* Nord Dark Buttons */
    --btn-primary-bg: #5E81AC;
    --btn-primary-hover: #81A1C1;
    --btn-secondary-bg: #4C566A;
    --btn-secondary-hover: #5E6A80;

    /* Nord Accent Colors */
    --accent-primary: #2bd0ff;
    --accent-primary-light: #8FBCBB;
    --accent-warning: #EBCB8B;
    --accent-warning-bg: #51493D;

    /* Nord Status colors */
    --status-success-bg: #3B4E44;
    --status-success-text: #A3BE8C;
    --status-pending-bg: #51493D;
    --status-pending-text: #EBCB8B;
    --status-processing-bg: #3E4A5E;
    --status-processing-text: #88C0D0;
    --status-failed-bg: #523E40;
    --status-failed-text: #BF616A;
}

/* Dark Theme Form Overrides */
[data-theme="dark"] .form-group input[type="text"],
[data-theme="dark"] .form-group input[type="url"],
[data-theme="dark"] .form-group input[type="file"],
[data-theme="dark"] .form-group textarea,
[data-theme="dark"] .form-group select {
    background: #3B4252;
    border-color: #4C566A;
    color: #ECEFF4;
}

[data-theme="dark"] .form-group input::placeholder,
[data-theme="dark"] .form-group textarea::placeholder {
    color: #81A1C1;
    opacity: 0.7;
}

[data-theme="dark"] .form-group input:focus,
[data-theme="dark"] .form-group textarea:focus,
[data-theme="dark"] .form-group select:focus {
    background: #434C5E;
    border-color: #88C0D0;
    box-shadow: 0 0 0 3px rgba(136, 192, 208, 0.15);
}

/* Theme Toggle */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    margin-bottom: var(--spacing-md);
    background: var(--bg-secondary);
    border-radius: var(--border-radius-small);
    cursor: pointer;
    transition: all var(--transition-normal);
}

.theme-toggle:hover {
    background: var(--bg-hover);
}

.theme-toggle-label {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

.theme-toggle-label i {
    font-size: 16px;
    color: var(--text-muted);
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    width: 48px;
    height: 26px;
    background: var(--bg-hover);
    border-radius: 13px;
    transition: all var(--transition-normal);
    border: 2px solid var(--border-color);
}

.toggle-switch::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    background: var(--text-white);
    transition: all var(--transition-normal);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .toggle-switch {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

[data-theme="dark"] .toggle-switch::before {
    transform: translateX(22px);
    background: var(--text-white);
}

/* Theme icons */
.theme-icon-light {
    display: block;
}

.theme-icon-dark {
    display: none;
}

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

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

/* Settings Modal */
.settings-content {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

/* Setting items */
.setting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius-small);
    gap: var(--spacing-md);
    transition: background var(--transition-fast);
}

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

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

.setting-info label {
    font-weight: 600;
    font-size: 15px;
    color: var(--text-primary);
}

.setting-description {
    font-size: 13px;
    color: var(--text-muted);
}

/* Toggle Checkbox */
.toggle-checkbox {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
    cursor: pointer;
}

.toggle-checkbox input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-hover);
    border: 2px solid var(--border-color);
    border-radius: 13px;
    transition: all var(--transition-normal);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    height: 18px;
    width: 18px;
    left: 2px;
    bottom: 2px;
    background: var(--text-white);
    border-radius: 50%;
    transition: all var(--transition-normal);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-checkbox input:checked + .toggle-slider {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

.toggle-checkbox input:checked + .toggle-slider::before {
    transform: translateX(22px);
}

/* Settings Select and Input */
.setting-select,
.setting-input {
    padding: 8px 12px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-small);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-normal);
    min-width: 150px;
}

.setting-select:focus,
.setting-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--bg-overlay-light);
}

.setting-input {
    text-align: right;
}

/* Dark theme overrides for settings */
[data-theme="dark"] .setting-select,
[data-theme="dark"] .setting-input {
    background: #3B4252;
    border-color: #4C566A;
    color: #ECEFF4;
}

[data-theme="dark"] .setting-select:focus,
[data-theme="dark"] .setting-input:focus {
    background: #434C5E;
    border-color: #88C0D0;
    box-shadow: 0 0 0 3px rgba(136, 192, 208, 0.15);
}

/* Footer Links Wrapper */
.footer-links {
    display: flex;
    gap: var(--spacing-xs);
}

/* Related Videos Section */
.related-videos-section {
    margin-top: var(--spacing-lg);
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--border-color);
}

.related-videos-section h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.related-videos-section h2 i {
    color: var(--accent-primary);
}

.related-videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--spacing-md);
}

.related-video-card {
    background: var(--bg-card);
    border-radius: var(--border-radius-small);
    overflow: hidden;
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
    border: 1px solid var(--border-color);
}

.related-video-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.related-video-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.related-video-thumbnail {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    background-size: cover;
    background-position: center;
    background-color: var(--bg-dark);
}

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

.related-video-info {
    padding: var(--spacing-sm);
}

.related-video-info h4 {
    font-size: 0.9rem;
    font-weight: 500;
    margin: 0 0 var(--spacing-xs) 0;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}

.related-video-meta {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.category-badge-small {
    font-size: 0.75rem;
    padding: 2px 8px;
    background: var(--accent-primary);
    color: var(--text-white);
    border-radius: var(--border-radius-small);
    font-weight: 500;
}

/* Dark theme adjustments */
[data-theme="dark"] .related-video-card {
    background: #2E3440;
    border-color: #434C5E;
}

[data-theme="dark"] .related-video-card:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .related-videos-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: var(--spacing-sm);
    }

    .related-video-info h4 {
        font-size: 0.85rem;
    }
}

/* Search and Filters - Compact Inline Version */
.search-filters-container {
    flex: 1;
    margin-right: var(--spacing-md);
}

.search-form {
    display: flex;
    gap: var(--spacing-xs);
    align-items: center;
}

.search-input-wrapper {
    position: relative;
    flex: 1;
    min-width: 200px;
    max-width: 350px;
}

.search-input-wrapper i {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
    font-size: 0.85rem;
}

.search-input-wrapper i.fa-xmark {
    position: static;
    transform: unset
}

.search-input {
    width: 100%;
    padding: 8px 30px 8px 32px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-small);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: all var(--transition-normal);
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.1);
}

.clear-search-btn {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px 6px;
    border-radius: var(--border-radius-small);
    transition: all var(--transition-fast);
    font-size: 0.8rem;
    opacity: 1;
    visibility: visible;
}

.clear-search-btn.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

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

.filter-select-inline {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-small);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition-normal);
    min-width: 100px;
}

.filter-select-inline:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.1);
}

.filter-select-inline:hover {
    border-color: var(--accent-primary);
}

.clear-filters-btn {
    padding: 8px 10px;
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-small);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    opacity: 1;
    visibility: visible;
}

.clear-filters-btn.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.clear-filters-btn:hover {
    background: var(--accent-error);
    color: var(--text-white);
    border-color: var(--accent-error);
}

/* Dark theme adjustments */
[data-theme="dark"] .search-input,
[data-theme="dark"] .filter-select-inline {
    background: #2E3440;
    border-color: #434C5E;
}

[data-theme="dark"] .search-input:focus,
[data-theme="dark"] .filter-select-inline:focus,
[data-theme="dark"] .filter-select-inline:hover {
    border-color: #88C0D0;
}

/* Checkbox group styling */
.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.checkbox-label {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.checkbox-label:hover {
    background: var(--bg-hover);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.checkbox-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkbox-label .checkmark {
    position: relative;
    height: 22px;
    width: 22px;
    background-color: #fff;
    border: 2px solid #d1d5db;
    border-radius: 6px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.checkbox-label:hover .checkmark {
    border-color: var(--accent-primary);
    background-color: #f9fafb;
}

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

.checkbox-label .checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 6px;
    top: 1px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-label input[type="checkbox"]:checked ~ .checkmark:after {
    display: block;
}

.checkbox-label span {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    transition: color 0.2s ease;
}

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

/* Dark theme adjustments */
[data-theme="dark"] .checkbox-label .checkmark {
    background-color: #2E3440;
    border-color: #434C5E;
}

[data-theme="dark"] .checkbox-label:hover .checkmark {
    border-color: #88C0D0;
}

/* Hide search and filters on mobile */
@media (max-width: 768px) {
    .search-filters-container {
        display: none;
    }
}




.video-card-clean .video-info{
    position: absolute;
    left: 8px;
    bottom: 8px;
    width: calc(100% - 16px);
    z-index: 10;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(20px);
    padding: 8px;
    border-radius: 5px;

    opacity: 0;
    pointer-events:  none;
    transform: translateY(5px);
    transition: all 0.3s ease-in-out


}
.video-card-clean:hover .video-info {
    opacity: 1;
    pointer-events: unset;
    transform: unset;
}

.video-card-clean:hover .video-title{
        color: #fff
    }

.video-card-clean  .video-title {
    color: #fff;
    margin-bottom: 0;
    font-size: 12px;
    &:hover {
        color: #fff
    }
}

.video-card-clean .video-meta {
    display: none
}

.video-card-clean .refresh-thumbnail-btn {
    bottom: unset; top: 8px; left: 40px;
}

.video-card-clean .download-thumbnail-btn {
     left: 70px;
}

.video-card-clean:hover {
    .video-duration {
        display: none
    }
}