* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

:root {
    --primary: #00BCD4;
    --primary-dark: #0097A7;
    --secondary: #00ACC1;
    --accent: #26C6DA;
    --dark: #263238;
    --dark-2: #37474F;
    --light: #ECEFF1;
    --gray: #B0BEC5;
    --success: #00E676;
    --warning: #FFD600;
    --danger: #FF5252;
    --sidebar-width: 280px;
}

body {
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    background: linear-gradient(135deg, #0D47A1 0%, #00695C 100%);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Auth Page */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.auth-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    max-width: 450px;
    width: 100%;
    overflow: hidden;
}

.auth-header {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    padding: 40px 30px;
    text-align: center;
    color: white;
}

.auth-header h1 {
    font-size: 28px;
    margin-bottom: 8px;
}

.auth-header p {
    opacity: 0.9;
    font-size: 14px;
}

.auth-body {
    padding: 30px;
}

.tab-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 25px;
}

.tab-btn {
    padding: 12px;
    border: 2px solid var(--light);
    background: white;
    color: var(--dark);
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Dashboard Layout */
.dashboard {
    display: flex;
    min-height: 100vh;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: transparent;
    border: none;
    font-size: 24px;
    color: var(--dark);
    cursor: pointer;
    padding: 8px;
    margin-right: 15px;
    transition: all 0.3s;
}

.mobile-menu-toggle:hover {
    color: var(--primary);
}

.mobile-menu-toggle:active {
    transform: scale(0.95);
}

/* Mobile Overlay */
.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s;
}

.mobile-overlay.active {
    display: block;
    opacity: 1;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--dark);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 100;
    transition: transform 0.3s;
}

.sidebar-header {
    padding: 25px 20px;
    background: var(--dark-2);
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header h2 {
    font-size: 20px;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-header p {
    font-size: 12px;
    color: var(--gray);
    margin-top: 5px;
}

.sidebar-menu {
    flex: 1;
    padding: 15px 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.sidebar-menu::-webkit-scrollbar {
    width: 6px;
}

.sidebar-menu::-webkit-scrollbar-track {
    background: var(--dark-2);
}

.sidebar-menu::-webkit-scrollbar-thumb {
    background: var(--gray);
    border-radius: 3px;
}

.sidebar-menu::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

.menu-section {
    margin-bottom: 25px;
}

.menu-title {
    padding: 10px 20px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--gray);
    font-weight: 700;
}

.menu-item {
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: rgba(255,255,255,0.8);
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.menu-item:hover {
    background: rgba(255,255,255,0.05);
    color: white;
}

.menu-item.active {
    background: linear-gradient(90deg, rgba(0,188,212,0.2), transparent);
    color: white;
    border-left: 3px solid var(--accent);
}

.menu-item i {
    width: 20px;
    font-size: 16px;
}

.menu-badge {
    margin-left: auto;
    background: var(--danger);
    color: white;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.user-details {
    flex: 1;
}

.user-name {
    font-weight: 600;
    font-size: 14px;
}

.user-role {
    font-size: 11px;
    color: var(--gray);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
}

/* Top Bar */
.topbar {
    background: white;
    padding: 20px 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-left h1 {
    font-size: 24px;
    color: var(--dark);
    margin-bottom: 4px;
}

.breadcrumb {
    font-size: 13px;
    color: var(--gray);
}

.topbar-right {
    display: flex;
    gap: 15px;
    align-items: center;
}

.topbar-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,188,212,0.4);
}

/* Content Area */
.content {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
}

.page-section {
    display: none;
}

.page-section.active {
    display: block;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-icon.blue { background: rgba(0,188,212,0.1); color: var(--primary); }
.stat-icon.green { background: rgba(0,230,118,0.1); color: var(--success); }
.stat-icon.orange { background: rgba(255,214,0,0.1); color: var(--warning); }
.stat-icon.red { background: rgba(255,82,82,0.1); color: var(--danger); }

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 5px;
}

.stat-label {
    font-size: 13px;
    color: var(--gray);
    font-weight: 500;
}

/* Card */
.card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 20px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--light);
}

.card-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Form */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--dark);
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--light);
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0,188,212,0.1);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-warning {
    background: var(--warning);
    color: var(--dark);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Progress */
.progress-container {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 20px;
    display: none;
}

.progress-bar {
    width: 100%;
    height: 40px;
    background: var(--light);
    border-radius: 20px;
    overflow: hidden;
    margin: 15px 0;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transition: width 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
}

/* Upload Item */
.upload-item {
    background: white;
    border: 2px solid var(--light);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    transition: all 0.3s;
}

.upload-item:hover {
    border-color: var(--primary);
}

.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.upload-filename {
    font-weight: 600;
    color: var(--dark);
    font-size: 15px;
}

.upload-status {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.upload-status.uploading { 
    background: rgba(0,188,212,0.2); 
    color: var(--primary); 
}

.upload-status.completed { 
    background: rgba(0,230,118,0.2); 
    color: #00C853; 
}

.upload-status.error { 
    background: rgba(255,82,82,0.2); 
    color: var(--danger); 
}

.upload-progress-text {
    font-size: 13px;
    color: var(--gray);
    margin-bottom: 8px;
}

.upload-stats {
    display: flex;
    gap: 20px;
    font-size: 12px;
    color: var(--gray);
    margin-top: 8px;
}

.upload-stat {
    display: flex;
    align-items: center;
    gap: 5px;
}

.badge-info {
    background: rgba(0,188,212,0.1);
    color: var(--primary);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

.form-help {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--gray);
}

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
}

/* Video List */
.video-item {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s;
}

.video-item:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.video-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.video-info h3 {
    color: var(--dark);
    margin-bottom: 8px;
}

.video-meta {
    font-size: 13px;
    color: var(--gray);
}

.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-pending { background: rgba(255,214,0,0.2); color: #F57F17; }
.status-processing { background: rgba(0,188,212,0.2); color: var(--primary); }
.status-completed { background: rgba(0,230,118,0.2); color: #00C853; }
.status-failed { background: rgba(255,82,82,0.2); color: var(--danger); }

.video-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.video-actions .btn {
    padding: 8px 16px;
    font-size: 13px;
}

/* Info Box */
.info-box {
    background: linear-gradient(135deg, rgba(0,188,212,0.1), rgba(0,172,193,0.1));
    border-left: 4px solid var(--primary);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.info-box h4 {
    color: var(--primary);
    margin-bottom: 10px;
    font-size: 16px;
}

.info-box ul {
    margin-left: 20px;
    color: #b3e6ff;
}

.info-box li {
    margin: 5px 0;
    font-size: 14px;
}

/* Info Grid */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
    padding: 20px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: var(--light);
    border-radius: 8px;
}

.info-label {
    font-weight: 600;
    color: var(--gray);
    font-size: 13px;
}

.info-value {
    font-weight: 700;
    color: var(--dark);
    font-size: 14px;
}

.info-item.status-ok .info-value {
    color: var(--success);
}

.info-item.status-error .info-value {
    color: var(--danger);
}

/* Settings Form */
.settings-section {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.settings-section h3 {
    color: var(--dark);
    margin-bottom: 15px;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: var(--primary);
}

input:checked + .toggle-slider:before {
    transform: translateX(26px);
}

.hidden {
    display: none !important;
}

/* New Styles for Phase 8 */

/* Pagination */
#pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.pagination-info {
    color: var(--gray);
    font-size: 14px;
}

.pagination-controls {
    display: flex;
    gap: 5px;
}

.pagination-controls button {
    padding: 8px 12px;
    border: 1px solid var(--light);
    background: white;
    color: var(--dark);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 40px;
}

.pagination-controls button:hover:not(:disabled) {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.pagination-controls button.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.pagination-controls button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-controls span {
    padding: 8px 5px;
    color: var(--gray);
}

.pagination-size select {
    padding: 8px 12px;
    border: 1px solid var(--light);
    border-radius: 6px;
    background: white;
    color: var(--dark);
    cursor: pointer;
}

/* Videos Table */
.videos-table {
    width: 100%;
    border-collapse: collapse;
}

.videos-table thead {
    background: var(--light);
}

.videos-table th,
.videos-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid var(--light);
}

.videos-table th {
    font-weight: 600;
    color: var(--dark);
    font-size: 14px;
}

.thumbnail-cell {
    width: 120px;
}

.thumbnail-wrapper {
    position: relative;
    width: 100px;
    height: 60px;
}

.thumbnail-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.thumbnail-upload-btn {
    position: absolute;
    bottom: 5px;
    right: 5px;
    width: 28px;
    height: 28px;
    border: none;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.thumbnail-wrapper:hover .thumbnail-upload-btn {
    opacity: 1;
}

.thumbnail-upload-btn:hover {
    background: var(--primary);
}

.actions-cell {
    white-space: nowrap;
}

.action-btn {
    padding: 8px 10px;
    border: none;
    background: var(--primary);
    color: white;
    border-radius: 6px;
    cursor: pointer;
    margin-right: 5px;
    transition: all 0.2s;
    font-size: 12px;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.action-btn.delete {
    background: var(--danger);
}

.action-btn.warning {
    background: var(--warning);
    color: var(--dark);
}

.action-btn.success {
    background: var(--success);
}

.embed-cell {
    white-space: nowrap;
}

.embed-btn {
    padding: 8px 12px;
    border: 1px solid var(--primary);
    background: white;
    color: var(--primary);
    border-radius: 6px;
    cursor: pointer;
    margin-right: 5px;
    transition: all 0.2s;
    font-size: 12px;
}

.embed-btn:hover {
    background: var(--primary);
    color: white;
}

.folder-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    color: white;
    font-size: 12px;
    font-weight: 600;
}

.btn-link {
    background: none;
    border: none;
    color: var(--primary);
    text-decoration: underline;
    cursor: pointer;
    font-size: 14px;
}

.btn-link:hover {
    color: var(--primary-dark);
}

/* Folders */
.folders-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.folder-item {
    width: 100%;
    padding: 12px 15px;
    border: none;
    background: var(--light);
    color: var(--dark);
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.folder-item:hover {
    background: var(--primary);
    color: white;
    transform: translateX(5px);
}

.folder-item.active {
    background: var(--primary);
    color: white;
}

.folder-item.create-folder {
    background: white;
    border: 2px dashed var(--primary);
    color: var(--primary);
    justify-content: center;
}

.folder-item.create-folder:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Folder item wrapper with action buttons */
.folder-item-wrapper {
    position: relative;
    width: 100%;
}

.folder-item-wrapper .folder-item {
    width: 100%;
}

.folder-item-wrapper button[title="Sửa thư mục"],
.folder-item-wrapper button[title="Xóa thư mục"] {
    opacity: 0;
    transition: opacity 0.2s;
}

.folder-item-wrapper:hover button[title="Sửa thư mục"],
.folder-item-wrapper:hover button[title="Xóa thư mục"] {
    opacity: 1;
}

.folder-item-wrapper button[title="Sửa thư mục"]:hover {
    background: #1976D2 !important;
}

.folder-item-wrapper button[title="Xóa thư mục"]:hover {
    background: #d32f2f !important;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
    animation: modalFadeIn 0.2s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal.modal-closing {
    animation: modalFadeOut 0.2s ease-out;
}

@keyframes modalFadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

.modal-content {
    background: white;
    border-radius: 16px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: modalSlideUp 0.3s ease-out;
}

@keyframes modalSlideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid var(--light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    color: var(--dark);
    font-size: 20px;
}

.close-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--light);
    color: var(--dark);
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.close-btn:hover {
    background: var(--danger);
    color: white;
}

.modal-body {
    padding: 25px;
}

.modal-body label {
    display: block;
    margin-bottom: 5px;
    color: var(--dark);
    font-weight: 500;
    font-size: 14px;
}

.modal-body input[type="text"],
.modal-body input[type="color"],
.modal-body input[type="file"],
.modal-body select,
.modal-body textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--light);
    border-radius: 8px;
    font-size: 14px;
}

.modal-body textarea {
    resize: vertical;
    font-family: inherit;
}

.folder-select-btn {
    width: 100%;
    padding: 15px;
    border: 1px solid var(--light);
    background: white;
    color: var(--dark);
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.folder-select-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* Responsive */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }
    
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        z-index: 999;
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
    }
    
    .topbar {
        flex-wrap: wrap;
    }
    
    .topbar-left {
        display: flex;
        align-items: center;
        width: 100%;
    }
    
    .topbar-left h1 {
        font-size: 18px;
    }
    
    .breadcrumb {
        font-size: 12px;
    }
    
    .topbar-right {
        width: 100%;
        margin-top: 10px;
    }
    
    .topbar-btn {
        width: 100%;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    #page-videos > div {
        grid-template-columns: 1fr !important;
    }
    
    .videos-table {
        font-size: 12px;
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .videos-table table {
        min-width: 800px;
    }
    
    .videos-table th,
    .videos-table td {
        padding: 10px 5px;
    }
    
    .thumbnail-wrapper {
        width: 100%;
        height: auto;
        aspect-ratio: 16/9;
    }
    
    .actions-cell,
    .embed-cell {
        white-space: normal;
    }
    
    .action-btn,
    .embed-btn {
        margin-bottom: 5px;
        display: inline-block;
    }
    
    #pagination {
        flex-direction: column;
        gap: 10px;
    }
    
    .pagination-controls {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .modal-content {
        max-width: 95%;
        margin: 20px;
    }
    
    .stat-card {
        padding: 15px;
    }
    
    .stat-value {
        font-size: 28px;
    }
    
    .content {
        padding: 15px;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .filters {
        flex-direction: column;
        width: 100%;
    }
    
    .filters input,
    .filters select,
    .filters button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .action-btn,
    .embed-btn {
        font-size: 11px;
        padding: 6px 8px;
    }
    
    .folder-item {
        font-size: 14px;
        padding: 10px;
    }
    
    .topbar-left h1 {
        font-size: 16px;
    }
    
    .breadcrumb {
        display: none;
    }
    
    .stat-value {
        font-size: 24px;
    }
    
    .stat-label {
        font-size: 11px;
    }
    
    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    .modal-content {
        margin: 10px;
        padding: 15px;
    }
    
    .modal-header h2 {
        font-size: 18px;
    }
    
    .form-group label {
        font-size: 13px;
    }
}

/* Toggle Switch for Redis */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--success);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.btn-secondary {
    background: var(--gray);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.btn-secondary:hover {
    background: var(--dark-2);
    transform: translateY(-2px);
}

.btn-secondary i {
    margin-right: 5px;
}
