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

:root {
    /* Light Mode Colors */
    --bg-primary: #ffffff;
    --bg-secondary: #eeeeee;
    --bg-tertiary: #f1f5f9;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-tertiary: #94a3b8;
    --border-color: #e2e8f0;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

    /* Brand Colors */
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-light: #eef2ff;
    --secondary: #8b5cf6;
    --success: #10b981;
    --success-light: #d1fae5;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --info: #3b82f6;
    --info-light: #dbeafe;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-success: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --gradient-danger: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    --gradient-dark: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    --bg: var(--bg-tertiary); /* Nền chung cho các mục, thường là bg-tertiary/secondary */
    --card-bg: var(--bg-primary); /* Nền cho panel/card */
    --card-hover: var(--bg-secondary); /* Hover nền card/item */
    --info-bg: var(--info-light); /* Nền cho thông báo/info box */
    --text: var(--text-primary); /* Màu chữ chính */
    --border: var(--border-color); /* Viền */
}

[data-theme="dark"] {
    /* Dark Mode Colors */
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-tertiary: #64748b;
    --border-color: #334155;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.3), 0 1px 2px 0 rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.2);

    /* Adjust for dark mode */
    --primary-light: #312e81;
    --success-light: #064e3b;
    --danger-light: #7f1d1d;
    --warning-light: #78350f;
    --info-light: #1e3a8a;
    /* Bổ sung Dựa trên CSS đã cho */
    --bg: var(--bg-secondary); /* Nền chung cho các mục */
    --card-bg: var(--bg-secondary); /* Nền cho panel/card */
    --card-hover: var(--bg-tertiary); /* Hover nền card/item */
    --info-bg: var(--info-light); /* Nền cho thông báo/info box */
    --text: var(--text-primary); /* Màu chữ chính */
    --border: var(--border-color); /* Viền */
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--gradient-primary);
    color: var(--text-primary);
    padding: 10px;
    height: 100vh;
    transition: background 0.3s ease;
}

[data-theme="dark"] body {
    background: var(--gradient-dark);
}

[data-theme="dark"] .btn-secondary {
    color: #0f172a;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    background: var(--bg-primary);
    border-radius: 15px;
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    transition: background 0.3s ease;
}

/* ============= HEADER ============= */
header {
    background: var(--gradient-primary);
    color: white;
    padding: 10px;
    position: relative;
}

[data-theme="dark"] header {
    background: var(--gradient-dark);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.header-left h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.95;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 0.5rem;
    color: white;
}

#userName {
    font-weight: 500;
}

.theme-toggle {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1) rotate(15deg);
}

/* ============= BADGES ============= */
span.badge-info.spankhoi {
    display: inline-flex;
    width: 32px;
    min-width: 32px;
    height: 32px;
    text-align: center;
    border-radius: 50%;
    font-size: 13pt;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

span.badge-info.spankhoi:hover,
span.badge-info.spankhoi.active {
    background: orange !important;
    color: white;

}

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    white-space: nowrap;
    cursor: pointer;
}

.badge-admin {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #78350f;
}

.badge-user {
    background: #93c5fd;
    color: #1e3a8a;
}

.badge-info {
    background: #3b82f6;
    color: white;
}

.badge-secondary {
    background: #6b7280;
    color: white;
}

/* ============= SETTINGS PANEL ============= */
.settings-panel {
    padding: 10px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    transition: background 0.3s ease;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-start;
}

.settings-content {
    display: none;
    margin-top: 1rem;
    padding: 1.5rem;
    background: var(--bg-primary);
    border-radius: 0.75rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    flex-basis: 100%;
}

.settings-content.active {
    display: block;
    animation: slideDown 0.3s ease;
}

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

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

.settings-content h3 {
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    font-size: 1.25rem;
}

/* ============= MAIN CONTENT ============= */
div#mainApp {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.main-content {
    padding: 10px;
    background: var(--bg-secondary);
    transition: background 0.3s ease;
    height: 100%;
    overflow: hidden;
}

.section {
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
}

.section.hidden {
    display: none;
}

.section-header {
    display: flex;
    align-items: center;
    padding-bottom: 5px;
    flex-wrap: wrap;
    gap: 1rem;
    position: sticky;
    top: 0;
    background: var(--bg-secondary);
    z-index: 999;
}

.section-header h2,
.section-header h3 {
    font-size: 1.75rem;
    color: var(--text-primary);
    font-weight: 700;
    margin: 0;
    flex: 1;
}

.section-header h3 {
    font-size: 1.5rem;
}

.section-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* ============= TABS ============= */
.tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0;
}

.tab-button {
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    bottom: -2px;
}

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

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

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
    overflow-y: auto;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* ============= BUTTONS ============= */
.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: var(--shadow);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

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

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

.btn-secondary:hover:not(:disabled) {
    background: var(--text-primary);
    transform: translateY(-2px);
}

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

.btn-success:hover:not(:disabled) {
    background: #059669;
    transform: translateY(-2px);
}

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

.btn-danger:hover:not(:disabled) {
    background: #dc2626;
    transform: translateY(-2px);
}

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

.btn-warning:hover:not(:disabled) {
    background: #d97706;
    transform: translateY(-2px);
}

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

.btn-info:hover:not(:disabled) {
    background: #2563eb;
    transform: translateY(-2px);
}

.btn-large {
    padding: 1.25rem 2.5rem;
    font-size: 1.25rem;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* ============= FORMS ============= */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.form-group input[type="text"],
.form-group input[type="file"],
.form-group input[type="password"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.875rem;
    border: 2px solid var(--border-color);
    border-radius: 0.75rem;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--bg-primary);
    color: var(--text-primary);
}

.form-group input[type="file"] {
    padding: 0.5rem;
}

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

.form-group textarea {
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
    padding: 10px !important;
}

.form-group small {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    margin-top: 0.25rem;
    display: block;
}

/* ============= FILMS GRID ============= */
.films-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 15px;
    overflow-y: auto;
}

.film-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.film-card.selected {
    border-color: var(--primary);
    background: var(--primary-light);
    box-shadow: var(--shadow-lg);
}

.film-card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    font-weight: 700;
}

.film-card p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.film-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    gap: 1rem;
}

.film-card-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.film-card-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    /* flex-wrap: wrap; */
}

.keywords-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.keyword-tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 500;
    margin: 2px 5px;
}

[data-theme="dark"] .keyword-tag {
    background: rgba(99, 102, 241, 0.25);
    color: #a5b4fc;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.film-meta {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.875rem;
    color: var(--text-tertiary);
}

.film-creator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: var(--bg-secondary);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    margin-bottom: 5px;
    color: var(--text-secondary);
}

[data-theme="dark"] .film-creator {
    background: rgba(255, 255, 255, 0.05);
}

.film-creator i {
    color: var(--primary);
}

/* ============= SCENES LIST ============= */
.scenes-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 1.5rem;
}

.scene-card {
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: 1rem;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.scene-card:hover {
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.scene-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.scene-header h4 {
    font-size: 1.25rem;
    color: var(--text-primary);
    font-weight: 600;
}

.scene-time {
    font-size: 0.875rem;
    color: var(--text-tertiary);
    background: var(--bg-secondary);
    padding: 0.25rem 0.75rem;
    border-radius: 0.5rem;
    white-space: nowrap;
    margin-left: 5px;
}

/* ============= SCENE CONTEXT ============= */
.scene-context {
    background: var(--bg-secondary);
    border-left: 3px solid var(--primary);
    padding: 0.75rem;
    margin: 0.75rem 0;
    border-radius: 4px;
}

.context-item {
    margin: 0.5rem 0;
    font-size: 0.9em;
    color: var(--text-secondary);
}

.context-item strong {
    color: var(--primary);
    margin-right: 0.5rem;
}

.scene-content {
    margin-bottom: 1rem;
}

.scene-media {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.scene-ref-image {
    width: 100%;
    height: 260px;
    object-fit: cover;
    border-radius: 0.5rem;
    border: 2px solid var(--border-color);
}

.scene-video {
    width: 100%;
    max-height: 300px;
    border-radius: 0.5rem;
    border: 2px solid var(--border-color);
}

.scene-image-placeholder {
    width: 100%;
    height: 260px;
    background: var(--bg-tertiary);
    border-radius: 0.5rem;
    border: 2px dashed var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    font-size: 2rem;
}

.scene-details {
    margin-bottom: 1rem;
}

.scene-prompt {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.scene-prompt strong {
    color: var(--text-primary);
}

.scene-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* ============= CHARACTERS ============= */
.characters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.character-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    overflow: hidden;
}

.character-card:hover {
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.character-image,
.character-image-placeholder {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background-color: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: var(--text-tertiary);
    flex-shrink: 0;
}

.character-image {
    background-color: transparent;
}

.character-card-content {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.character-card h4 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.character-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-grow: 1;
}

.character-card .whisk-prompt-preview {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    font-style: italic;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-all;
}

.character-card-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    margin-top: auto;
}

/* ============= MODALS ============= */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease;
}

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

.modal-content {
    background: var(--bg-primary);
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: var(--shadow-xl);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideUp 0.3s ease;
}

.modal-large {
    max-width: 800px;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }

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

.modal-content h2 {
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    font-size: 1.75rem;
}

.close {
    position: absolute;
    right: 1.5rem;
    top: 1.5rem;
    font-size: 2rem;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover {
    color: var(--danger);
}

/* ============= EXPORT SECTION ============= */
.export-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--bg-primary);
    border-radius: 1rem;
    border: 2px solid var(--border-color);
    text-align: center;
}

.progress-container {
    margin-top: 1rem;
}

.progress-container.hidden {
    display: none;
}

.progress-bar {
    width: 100%;
    height: 1rem;
    background: var(--bg-tertiary);
    border-radius: 0.5rem;
    overflow: hidden;
    margin-bottom: 1rem;
}

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

/* ============= BATCH GENERATE ============= */
.batch-scene-list {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1rem;
    background: var(--bg-secondary);
}

.batch-scene-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
    background: var(--bg-primary);
    transition: all 0.2s ease;
}

.batch-scene-item:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.batch-scene-item input[type="checkbox"] {
    width: 1.25rem;
    height: 1.25rem;
    cursor: pointer;
    accent-color: var(--primary);
}

.batch-scene-info {
    flex: 1;
}

.batch-scene-info strong {
    color: var(--text-primary);
    display: block;
    margin-bottom: 0.25rem;
}

.batch-scene-info small {
    color: var(--text-tertiary);
    font-size: 0.875rem;
}

/* ============= LOGIN PAGE ============= */
.login-page {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 9999;
}

[data-theme="dark"] .login-page {
    background: var(--gradient-dark);
}

.login-page.hidden {
    display: none;
}

.login-container {
    background: var(--bg-primary);
    border-radius: 1.5rem;
    box-shadow: var(--shadow-xl);
    padding: 3rem;
    max-width: 450px;
    width: 100%;
    animation: slideUp 0.5s ease;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h1 {
    font-size: 2rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 1rem;
}

.login-switch-text {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.login-switch-text a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.login-switch-text a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* Password input wrapper */
.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrapper input {
    width: 100%;
    padding-right: 3rem;
}

.password-toggle {
    position: absolute;
    right: 0.75rem;
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}

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

/* Password strength indicator */
.password-strength {
    margin-top: 0.5rem;
}

.strength-bar {
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 0.25rem;
}

.strength-bar-fill {
    height: 100%;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.strength-weak {
    background: var(--danger);
    width: 33%;
}

.strength-medium {
    background: var(--warning);
    width: 66%;
}

.strength-strong {
    background: var(--success);
    width: 100%;
}

/* ============= TIMELINE PLAYER ============= */
.timeline-player-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(4px);
}

.timeline-player-overlay.hidden {
    display: none;
}

.timeline-player-content {
    background: var(--bg-primary);
    border-radius: 1rem;
    padding: 2rem;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    box-shadow: var(--shadow-xl);
}

#timelineVideoPlayer {
    max-width: 100%;
    max-height: 70vh;
    border-radius: 0.5rem;
}

#timelinePlayerStatus {
    text-align: center;
    color: var(--text-secondary);
}

/* ============= PLACEHOLDER TEXT ============= */
.placeholder-text {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-tertiary);
    font-size: 1.1rem;
}

/* ============= HIDDEN CLASS ============= */
.hidden {
    display: none !important;
}

/* ============= HIDE MOBILE ============= */
.hide-mobile {
    display: inline;
}

/* ============= FILMS TOOLBAR ============= */
.films-toolbar {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
    width: 100%;
}

/* ============= FILTERS GROUP - COMPLETELY REDESIGNED ============= */
.filters-group {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
    flex: 1;
}

.filters-group input,
.filters-group select {
    min-width: 180px;
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 0.75rem;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-weight: 500;
}

/* Light mode - clean white backgrounds */
.filters-group input {
    background: #ffffff;
}

.filters-group select {
    background: #ffffff;
    cursor: pointer;
}

.filters-group input::placeholder {
    color: #94a3b8;
}

.filters-group select option {
    background: #ffffff;
    color: #0f172a;
}

/* Dark mode - properly styled with good contrast */
[data-theme="dark"] .filters-group input,
[data-theme="dark"] .filters-group select {
    background: #1e293b;
    border-color: #475569;
    color: #f1f5f9;
}

[data-theme="dark"] .filters-group input::placeholder {
    color: #64748b;
}

[data-theme="dark"] .filters-group select {
    background: #1e293b;
}

[data-theme="dark"] .filters-group select option {
    background: #1e293b;
    color: #f1f5f9;
}

/* Focus states - beautiful and clear */
.filters-group input:focus,
.filters-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

[data-theme="dark"] .filters-group input:focus,
[data-theme="dark"] .filters-group select:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

/* Hover states */
.filters-group input:hover,
.filters-group select:hover {
    border-color: var(--primary);
}

[data-theme="dark"] .filters-group input:hover,
[data-theme="dark"] .filters-group select:hover {
    border-color: #818cf8;
}

/* ============= STATUS BADGES ============= */
.film-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.film-status-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.status-in_progress {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.status-completed {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.status-paused {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

/* ============= USER CARDS (ADMIN PANEL) ============= */
.users-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
    padding: 1rem;
}

.user-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.user-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
    border-color: var(--primary);
}

.user-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 1rem;
}

.user-info-main h3 {
    margin: 0 0 0.25rem 0;
    font-size: 1.25rem;
    color: var(--text-primary);
}

.user-username {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-tertiary);
}

.user-badges {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-end;
}

.user-meta {
    padding: 0.75rem 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    margin: 1rem 0;
}

.user-meta small {
    color: var(--text-tertiary);
}

.user-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.user-actions .text-muted {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-tertiary);
    font-size: 0.875rem;
}

/* ============= PROGRESS MESSAGE ============= */
.progress-message {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-left: 4px solid var(--primary);
    border-radius: 0.5rem;
    color: var(--text-secondary);
}

.progress-message.hidden {
    display: none;
}

/* ============= SWEETALERT2 DARK MODE ============= */
[data-theme="dark"] .swal2-popup {
    background: var(--bg-primary) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .swal2-title {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .swal2-html-container {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .swal2-input,
[data-theme="dark"] .swal2-textarea {
    background: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .swal2-input:focus,
[data-theme="dark"] .swal2-textarea:focus {
    outline: none;
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px var(--primary-light) !important;
}

[data-theme="dark"] .swal2-confirm {
    background: var(--primary) !important;
    color: white !important;
}

[data-theme="dark"] .swal2-cancel {
    background: var(--text-secondary) !important;
    color: white !important;
}

/* ============= RESPONSIVE - TABLET ============= */
@media (max-width: 1024px) {
    .header-left h1 {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

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

    .scenes-list {
        grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    }

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

/* ============= RESPONSIVE - MOBILE ============= */
@media (max-width: 768px) {
    body {
        padding: 0;
    }

    .container {
        border-radius: 0;
    }

    .hide-mobile {
        display: none;
    }

    /* Header */
    .header-content {
        gap: 1rem;
        align-items: stretch;
    }

    .header-left h1 {
        font-size: 1.5rem;
        text-align: center;
        display: none;
    }

    .subtitle {
        font-size: 0.875rem;
        text-align: center;
    }

    .header-right {
        justify-content: center;
        flex-wrap: wrap;
        flex: 1;
    }

    .user-info {
        flex: 1;
        justify-content: center;
    }

    /* Settings panel */
    .settings-panel {
        flex-direction: row;
    }

    .settings-panel button {
        flex: 1;
    }

    /* Films grid */
    .films-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .sptitle {
        display: none;
    }

    span.badge-info.spankhoi {
        margin-top: 10px;
        font-size: 13px;
    }

    button.view-toggle-btn {
        width: 32px;
        height: 32px;
    }

    .header-left {
        display: none;
    }

    /* Filters */
    .films-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .filters-group {
        width: 100%;
        flex-wrap: nowrap;
    }

    .filters-group input,
    .filters-group select {
        width: 30%;
        min-width: auto;
    }

    /* User cards */
    .users-grid {
        grid-template-columns: 1fr;
        padding: 0.5rem;
    }

    .user-card {
        padding: 1rem;
    }

    .user-header {
        flex-direction: column;
        gap: 0.75rem;
    }

    .user-badges {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: flex-start;
    }

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

    .user-actions button {
        width: 100%;
    }

    /* Section headers */
    /* .section-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    } */
    .subtitle {
        display: none;
    }

    .section-header h2 {
        font-size: 1.25rem;
    }

    .section-actions {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .section-actions button {
        flex: 1;
        min-width: calc(50% - 0.25rem);
    }

    /* Film card adjustments */
    .film-card-header {
        flex-direction: column;
        gap: 0.5rem;
    }

    .film-card-badges {
        justify-content: flex-start;
        width: 100%;
    }

    /* .film-card-actions {
        flex-wrap: wrap;
    } */

    .film-card-actions button {
        flex: 1;
        min-width: 70px;
    }

    /* Modals on mobile */
    .modal-content {
        width: 95%;
        max-width: none;
        margin: 1rem auto;
        max-height: 90vh;
        overflow-y: auto;
        padding: 1.5rem;
    }

    .modal-large {
        width: 95%;
    }

    .scene-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    /* Tabs */
    .tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .tab-button {
        white-space: nowrap;
        padding: 0.75rem 1rem;
    }

    .scene-card {
        padding: 1rem;
    }

    /* Characters grid */
    .characters-grid {
        grid-template-columns: 1fr;
    }

    /* Login container */
    .login-container {
        padding: 2rem 1.5rem;
    }
}

/* ============= EXTRA SMALL DEVICES ============= */
@media (max-width: 480px) {
    .header-left h1 {
        font-size: 1.25rem;
    }

    .subtitle {
        font-size: 0.75rem;
    }

    .btn {
        padding: 0.625rem 1rem;
        font-size: 0.875rem;
    }

    .btn-small {
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
    }

    .btn-large {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }

    .modal-content {
        padding: 1rem;
    }

    .form-group label {
        font-size: 0.875rem;
    }

    input,
    select,
    textarea {
        font-size: 0.875rem;
        padding: 0.75rem;
    }

    .badge {
        font-size: 0.625rem;
        padding: 0.2rem 0.5rem;
        white-space: nowrap;
    }

    .film-status-badge {
        font-size: 0.625rem;
        padding: 0.2rem 0.5rem;
    }

    .section-actions button {
        min-width: 15%;
    }

    .login-container {
        padding: 1.5rem 1rem;
    }
}

/* ============= TOUCH DEVICE IMPROVEMENTS ============= */
@media (hover: none) and (pointer: coarse) {
    .film-card {
        cursor: pointer;
        -webkit-tap-highlight-color: rgba(102, 126, 234, 0.1);
    }

    .film-status-badge {
        min-height: 32px;
        min-width: 32px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* Remove hover effects on touch devices */
    .film-card:hover,
    .user-card:hover,
    .btn:hover {
        transform: none;
    }

    /* Add active states instead */
    .film-card:active {
        transform: scale(0.98);
        opacity: 0.9;
    }

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

/* ============= LANDSCAPE MOBILE ORIENTATION ============= */
@media (max-width: 768px) and (orientation: landscape) {
    .header-content {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .section-header {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .modal-content {
        max-height: 85vh;
    }
}

/* ============= PRINT STYLES ============= */
@media print {

    .settings-panel,
    .film-card-actions,
    .user-actions,
    .section-actions,
    button,
    .btn {
        display: none !important;
    }

    .film-card,
    .user-card {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}

/* ============= DARK MODE ENHANCEMENTS ============= */
[data-theme="dark"] .film-meta {
    border-color: #374151;
}

[data-theme="dark"] .user-card {
    background: #1f2937;
    border-color: #374151;
}

[data-theme="dark"] .user-meta {
    border-color: #374151;
}

/* ============= ACCESSIBILITY IMPROVEMENTS ============= */
@media (prefers-reduced-motion: reduce) {

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

/* ============= HIGH CONTRAST MODE ============= */
@media (prefers-contrast: high) {

    .film-card,
    .user-card {
        border: 2px solid currentColor;
    }

    .badge {
        border: 1px solid currentColor;
    }

    .film-status-badge {
        border: 1px solid white;
    }
}

/* ============= LOADING STATES ============= */
.skeleton-loader {
    background: linear-gradient(90deg,
            var(--bg-secondary) 25%,
            var(--bg-tertiary) 50%,
            var(--bg-secondary) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
    border-radius: 8px;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* ============= UTILITY CLASSES ============= */
.text-muted {
    color: var(--text-tertiary);
}

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

.mt-1 {
    margin-top: 0.5rem;
}

.mt-2 {
    margin-top: 1rem;
}

.mt-3 {
    margin-top: 1.5rem;
}

.mt-4 {
    margin-top: 2rem;
}

.mb-1 {
    margin-bottom: 0.5rem;
}

.mb-2 {
    margin-bottom: 1rem;
}

.mb-3 {
    margin-bottom: 1.5rem;
}

.mb-4 {
    margin-bottom: 2rem;
}

.p-1 {
    padding: 0.5rem;
}

.p-2 {
    padding: 1rem;
}

.p-3 {
    padding: 1.5rem;
}

.p-4 {
    padding: 2rem;
}

.flex {
    display: flex;
}

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

.flex-wrap {
    flex-wrap: wrap;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-1 {
    gap: 0.5rem;
}

.gap-2 {
    gap: 1rem;
}

.gap-3 {
    gap: 1.5rem;
}

/* ============= ANIMATIONS ============= */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

.animate-slide-in {
    animation: slideIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.animate-fade-in {
    animation: fadeIn 0.3s ease-out;
}

/* ============= SMOOTH SCROLLING ============= */
html {
    scroll-behavior: smooth;
}

/* ============= FOCUS VISIBLE ============= */
*:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ============= END OF ENHANCED STYLES ============= */
/* ============= THÊM ĐOẠN CSS NÀY VÀO SAU PHẦN .filters-group (khoảng dòng 1275) ============= */

/* Filter Input Wrapper với nút Clear */
.filter-input-wrapper {
    position: relative;
    flex: 1;
    min-width: 180px;
}

.filter-input-wrapper input {
    width: 100%;
    padding: 0.75rem 2.5rem 0.75rem 1rem;
    /* Padding bên phải để chừa chỗ cho nút clear */
    border: 2px solid var(--border-color);
    border-radius: 0.75rem;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-weight: 500;
}

/* Light mode */
.filter-input-wrapper input {
    background: #ffffff;
}

.filter-input-wrapper input::placeholder {
    color: #94a3b8;
}

/* Dark mode */
[data-theme="dark"] .filter-input-wrapper input {
    background: #1e293b;
    border-color: #475569;
    color: #f1f5f9;
}

[data-theme="dark"] .filter-input-wrapper input::placeholder {
    color: #64748b;
}

/* Focus states */
.filter-input-wrapper input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

[data-theme="dark"] .filter-input-wrapper input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

/* Hover states */
.filter-input-wrapper input:hover {
    border-color: var(--primary);
}

[data-theme="dark"] .filter-input-wrapper input:hover {
    border-color: #818cf8;
}

/* Nút Clear bên trong input */
.filter-clear-btn {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 0.5rem;
    display: none;
    /* Hidden by default, shown by JS when input has value */
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    transition: all 0.2s ease;
    font-size: 0.875rem;
}

.filter-clear-btn:hover {
    background: var(--danger-light);
    color: var(--danger);
    transform: translateY(-50%) scale(1.1);
}

[data-theme="dark"] .filter-clear-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.filter-clear-btn:active {
    transform: translateY(-50%) scale(0.95);
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .filter-input-wrapper {
        width: auto;
        min-width: auto;
    }

    .filter-input-wrapper input {
        width: 100%;
    }
}

/* ============= PAGINATION CONTROLS ============= */
.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    padding: 10px;
    padding-bottom: 0;
    flex-wrap: wrap;
}

.pagination-controls button {
    min-width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}

.pagination-controls button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-controls span {
    color: var(--text-tertiary);
    padding: 0 0.5rem;
}

/* ============= STATUS OPTIONS (SCENE STATUS MODAL) ============= */
.status-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 0.5rem;
}

.status-option {
    position: relative;
    display: flex;
    align-items: center;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--bg-primary);
}

.status-option:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.status-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.status-option input[type="radio"]:checked+.status-label {
    color: var(--primary);
}

.status-option input[type="radio"]:checked~.status-label strong {
    color: var(--primary);
}

.status-option.status-pending:has(input:checked) {
    background: rgba(148, 163, 184, 0.1);
    border-color: #94a3b8;
}

.status-option.status-edit-image:has(input:checked),.status-edit_image {
    background: rgba(251, 146, 60, 0.1);
    border-color: #fb923c;
}
.status-badge {
    margin-left: auto;
    border-radius: 10px;
}
.status-option.status-edit-video:has(input:checked),.status-edit_video {
    background: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
}

.status-option.status-ok:has(input:checked) {
    background: rgba(34, 197, 94, 0.1);
    border-color: #22c55e;
}

.status-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    cursor: pointer;
}

.status-label i {
    font-size: 1.5rem;
    min-width: 24px;
}

.status-label strong {
    font-size: 0.95rem;
    color: var(--text-primary);
    transition: color 0.3s ease;
}

.status-pending .status-label i {
    color: #94a3b8;
}

.status-edit-image .status-label i {
    color: #fb923c;
}

.status-edit-video .status-label i {
    color: #ef4444;
}

.status-ok .status-label i {
    color: #22c55e;
}

/* ============= SCENE NOTES (CHAT STYLE) ============= */
.scene-notes-container {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 2px solid var(--border-color);
}

.scene-notes-list {
    max-height: 400px;
    overflow-y: auto;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Scrollbar styling */
.scene-notes-list::-webkit-scrollbar {
    width: 8px;
}

.scene-notes-list::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: 4px;
}

.scene-notes-list::-webkit-scrollbar-thumb {
    background: var(--text-tertiary);
    border-radius: 4px;
}

.scene-notes-list::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

.chat-message {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 80%;
    animation: slideIn 0.3s ease-out;
}

.chat-message-left {
    align-self: flex-start;
}

.chat-message-right {
    align-self: flex-end;
    align-items: flex-end;
}

.chat-message-header {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    font-size: 0.875rem;
}

.chat-message-left .chat-message-header {
    flex-direction: row;
}

.chat-message-right .chat-message-header {
    flex-direction: row-reverse;
}

.chat-message-header strong {
    color: var(--primary);
}

.chat-time {
    color: var(--text-tertiary);
    font-size: 0.75rem;
}

.chat-message-body {
    padding: 0.75rem 1rem;
    border-radius: 12px;
    word-wrap: break-word;
    line-height: 1.5;
}

.chat-message-left .chat-message-body {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-top-left-radius: 4px;
}

.chat-message-right .chat-message-body {
    background: var(--primary);
    color: white;
    border-top-right-radius: 4px;
}

[data-theme="dark"] .chat-message-left .chat-message-body {
    background: #1e293b;
    border-color: #475569;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .status-options {
        grid-template-columns: 1fr;
    }

    .chat-message {
        max-width: 90%;
    }
}

/* ============================================
   CSS SNIPPET - BADGE STYLES
   Thêm vào file style.css của bạn (sau phần .badge-secondary)
   ============================================ */

/* Badge Success - Màu xanh lá (cho trạng thái "Đã OK") */
.badge-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

/* Badge Warning - Màu cam (cho trạng thái "Sửa ảnh") */
.badge-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

/* Badge Danger - Màu đỏ (cho trạng thái "Sửa Video") */
.badge-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

/* Badge Primary - Màu xanh dương */
.badge-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
}

/* Badge with icon - Khoảng cách cho icon */
.badge i {
    margin-right: 0.25rem;
}

/* ============================================
   CSS SNIPPET - SCENE HEADER IMPROVEMENTS
   Thay thế phần .scene-header hiện có
   ============================================ */

.scene-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.scene-header>div:first-child {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    flex-wrap: wrap;
}

.scene-header h4 {
    font-size: 1.25rem;
    color: var(--text-primary);
    font-weight: 600;
    margin: 0;
}

.scene-time {
    font-size: 0.875rem;
    color: var(--text-tertiary);
    background: var(--bg-secondary);
    padding: 0.25rem 0.75rem;
    border-radius: 0.5rem;
    white-space: nowrap;
}

/* ============================================
   SCROLL TO TOP BUTTON
   ============================================ */
.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, #2563eb 100%);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-to-top:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
}

.scroll-to-top:active {
    transform: translateY(-2px) scale(0.98);
}

.scroll-to-top i {
    font-size: 1.25rem;
}

/* ============================================
   MEDIA GALLERY STYLES
   ============================================ */
.scene-media-section {
    margin-bottom: 1.5rem;
}

.media-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
}

.media-section-header h5 {
    margin: 0;
    font-size: 1rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.media-section-header h5 i {
    color: var(--primary);
}

.media-count {
    font-size: 0.875rem;
    color: var(--text-tertiary);
    background: var(--bg-secondary);
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
}

.media-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

/* Full width when only 1 item */
.media-gallery:has(.media-item:only-child) {
    grid-template-columns: 1fr;
}

.media-gallery:has(.media-item:first-child:nth-last-child(1)) {
    grid-template-columns: 1fr;
}

.media-item {
    position: relative;
    border-radius: 0.75rem;
    overflow: hidden;
    background: var(--bg-secondary);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

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

.media-item.selected {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.media-item img,
.media-item video {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.media-item:hover img,
.media-item:hover video {
    transform: scale(1.05);
}

.default-badge {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 2;
    box-shadow: var(--shadow-md);
}

.media-actions {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.8) 0%, transparent 100%);
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem 0.5rem 1rem;
    justify-content: center;
    opacity: 0;
    transform: translateY(-100%);
    transition: all 0.3s ease;
}

.media-item:hover .media-actions {
    opacity: 1;
    transform: translateY(0);
}

.btn-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.btn-icon.btn-danger {
    background: rgba(239, 68, 68, 0.8);
}

.btn-icon.btn-danger:hover {
    background: rgba(239, 68, 68, 1);
}

.scene-image-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    background: var(--bg-secondary);
    border-radius: 0.75rem;
    color: var(--text-tertiary);
    border: 2px dashed var(--border-color);
}

.scene-image-placeholder i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.scene-image-placeholder p {
    margin: 0;
    font-size: 0.875rem;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .media-gallery {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 0.75rem;
    }

    .media-item img,
    .media-item video {
        height: 150px;
    }

    .scroll-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }

    .scroll-to-top i {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .media-gallery {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   VIEW TOGGLE BUTTONS
   ============================================ */
.view-toggle-group {
    display: flex;
    gap: 0;
    background: var(--bg-secondary);
    border-radius: 0.5rem;
    padding: 0.25rem;
    border: 1px solid var(--border-color);
}

.view-toggle-btn {
    width: 40px;
    height: 36px;
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    cursor: pointer;
    border-radius: 0.25rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.view-toggle-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.view-toggle-btn.active {
    background: var(--primary);
    color: white;
    box-shadow: var(--shadow-sm);
}

.view-toggle-btn i {
    font-size: 1rem;
}

/* ============================================
   FILMS LIST VIEW
   ============================================ */
.films-list-view {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow-y: auto;
}

.film-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    gap: 1.5rem;
}

.film-list-item:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateX(5px);
}

.film-list-main {
    flex: 1;
    min-width: 0;
}

.film-list-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.film-list-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--text-primary);
}

.film-list-description {
    color: var(--text-secondary);
    margin: 0.5rem 0;
    line-height: 1.5;
}

.film-list-meta {
    display: flex;
    gap: 1.5rem;
    margin-top: 0.75rem;
    font-size: 0.875rem;
    color: var(--text-tertiary);
}

.film-list-meta span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.film-list-meta i {
    color: var(--primary);
}

.film-creator,
.film-date {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.film-list-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* Mobile responsive for list view */
@media (max-width: 768px) {
    .film-list-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .film-list-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

/* Badge Primary enhancement */
.badge-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    font-weight: 600;
}

/* ============================================
   DASHBOARD / STATISTICS
   ============================================ */
.dashboard-filters {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.dashboard-filters select {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.875rem;
    cursor: pointer;
}

.dashboard-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.summary-card {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    transition: all 0.3s ease;
}

.summary-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.summary-icon {
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, #2563eb 100%);
    border-radius: 1rem;
    color: white;
    font-size: 2rem;
    box-shadow: var(--shadow-md);
}

.summary-content {
    flex: 1;
    position: relative;
}

.summary-content h3 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.25rem 0;
}

.summary-content p {
    font-size: 0.875rem;
    color: var(--text-tertiary);
    margin: 0;
}

.summary-percentage {
    position: absolute;
    top: 0;
    right: 0;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    background: var(--bg-secondary);
    border-radius: 1rem;
    color: var(--primary);
}

.dashboard-charts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.chart-container {
    padding: 1.5rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    box-shadow: var(--shadow-sm);
}

.chart-container h3 {
    font-size: 1.125rem;
    color: var(--text-primary);
    margin: 0 0 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

.chart-container canvas {
    max-height: 300px;
}

.dashboard-details {
    display: grid;
    gap: 1.5rem;
}

.details-card {
    padding: 1.5rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    box-shadow: var(--shadow-sm);
}

.details-card h3 {
    font-size: 1.125rem;
    color: var(--text-primary);
    margin: 0 0 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

.film-details-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.film-detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

.film-detail-item:hover {
    background: var(--bg-tertiary);
    transform: translateX(5px);
}

.film-detail-name {
    flex: 1;
    font-weight: 600;
    color: var(--text-primary);
}

.film-detail-stats {
    display: flex;
    gap: 1.5rem;
    font-size: 0.875rem;
}

.film-detail-stat {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-tertiary);
}

.film-detail-stat i {
    color: var(--primary);
}

.film-detail-stat strong {
    color: var(--text-primary);
}

/* Mobile responsive for dashboard */
@media (max-width: 768px) {
    .dashboard-summary {
        grid-template-columns: 1fr;
    }

    .dashboard-charts {
        grid-template-columns: 1fr;
    }

    .summary-card {
        padding: 1rem;
    }

    .summary-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }

    .summary-content h3 {
        font-size: 1.5rem;
    }

    .film-detail-stats {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
}

/* Progress Bar Styles */
.film-progress-wrapper {
    margin-top: 1rem;
    width: 100%;
}

.film-progress-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.film-progress-percent {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 1rem;
}

.film-progress-bar {
    width: 100%;
    height: 12px;
    background: var(--bg-tertiary);
    border-radius: 6px;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.film-progress-fill {
    height: 100%;
    border-radius: 6px;
    transition: width 0.6s ease, background-color 0.3s ease;
    position: relative;
    overflow: hidden;
}

.film-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.3),
            transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

/* Progress Bar Colors */
.progress-danger {
    background: linear-gradient(90deg, #ef4444 0%, #dc2626 100%);
}

.progress-info {
    background: linear-gradient(90deg, #3b82f6 0%, #2563eb 100%);
}

.progress-warning {
    background: linear-gradient(90deg, #f59e0b 0%, #d97706 100%);
}

.progress-success {
    background: linear-gradient(90deg, #10b981 0%, #059669 100%);
}

/* User Statistics Styles */
.user-stats-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.user-stats-item {
    padding: 1.25rem;
    background: var(--bg-secondary);
    border-radius: 0.75rem;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.user-stats-item:hover {
    background: var(--bg-tertiary);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

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

.user-stats-name {
    font-weight: 600;
    font-size: 1.125rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-stats-name i {
    color: var(--primary);
}

.user-stats-body {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.user-stat-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-tertiary);
}

.user-stat-item i {
    color: var(--primary);
    font-size: 1rem;
}

.user-stat-item strong {
    color: var(--text-primary);
    font-size: 1rem;
}

/* Update film-detail-item to use flexbox column for better layout */
.film-detail-item {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 1.25rem;
    background: var(--bg-secondary);
    border-radius: 0.75rem;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.film-detail-item:hover {
    background: var(--bg-tertiary);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.film-detail-name {
    font-weight: 600;
    font-size: 1.125rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.film-detail-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

#VideoFinal {
    margin: 10px 0;
}

#VideoFinal video {
    max-width: 720px;
    height: 480px;
}

/* Mobile responsive updates */
@media (max-width: 768px) {

    .film-detail-stats,
    .user-stats-body {
        grid-template-columns: repeat(2, 1fr);
    }

    #VideoFinal video {
        height: 250px;
    }


    .user-stats-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {

    .film-detail-stats,
    .user-stats-body {
        grid-template-columns: 1fr;
    }
}

#sceneJson {
    height: 300px;
    font-family: monospace;
    font-size: 0.9em;
}

/* === THÊM MỚI CSS CHO "REVIEW" === */
.status-option.status-review .status-label i {
    color: #8b5cf6;
    /* Màu tím */
}

.status-option.status-review:has(input:checked) {
    background: rgba(139, 92, 246, 0.1);
    border-color: #8b5cf6;
}

.badge-review {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: white;
}

.scene-latest-note {
    font-style: italic;
    background: #673AB7;
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    border-left: 3px solid var(--info);
    font-size: 0.9rem;
    margin-top: 0.75rem !important;
}
select option:checked {
    background-color: #673AB7!important;
    color: white!important;
}
select option{
    padding: 5px!important;
}
.media-item img,
.media-item video {
    width: 100%; /* Đảm bảo media responsive */
    height: auto;  /* Cho phép chiều cao tự động theo width */
    
    /* ĐÂY LÀ PHẦN QUAN TRỌNG: */
    aspect-ratio: 16 / 9;  /* Giữ tỷ lệ 16:9 (hoặc 4/3, 1/1 tùy bạn) */
    
    object-fit: cover;    /* Đảm bảo ảnh/video lấp đầy khung, không bị méo */
    background-color: #f0f0f0; /* Thêm màu nền cho đẹp khi đang tải */
}
.section-header h2{white-space: nowrap;}
.scene-media-section .media-item {
    /* Đảm bảo media-item có position relative */
    position: relative; 
}
.video-placeholder {
    position: relative;
    min-height: 120px; /* Chiều cao tối thiểu, bạn có thể chỉnh */
    aspect-ratio: 16 / 9; /* Giữ tỷ lệ 16:9 */
    background-color: #2a2a2a; /* Màu nền giữ chỗ */
    border: 1px solid #444;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden; /* Ẩn các phần tử con bị tràn */
}

/* Icon "Play" ở giữa placeholder */
.video-placeholder-icon {
    position: absolute;
    font-size: 3rem; /* Kích thước icon */
    color: rgba(255, 255, 255, 0.5);
    pointer-events: none; /* Cho phép click "xuyên qua" icon */
    z-index: 1;
}

.video-placeholder .media-actions {
    opacity: 1; /* Luôn hiển thị (hoặc theo CSS cũ của bạn) */
    z-index: 2;
}

.video-placeholder .default-badge {
    z-index: 2;
}

.media-item video {
    width: 100%;
    height: auto;
    display: block;
}
/* ============= STYLES FOR UPGRADE V2 ============= */
/* style-patches-v2.css */

/* ============= IMAGE ZOOM MODAL ============= */
.zoom-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.zoom-modal.hidden {
    display: none;
}

.zoom-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
}

.zoom-modal-content {
    position: relative;
    width: 95%;
    height: 95%;
    background: var(--card-bg);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.zoom-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
}

.zoom-modal-title {
    font-size: 1.2rem;
    font-weight: bold;
}

.zoom-modal-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.zoom-btn {
    background: var(--secondary);
    border: none;
    color: var(--text);
    padding: 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    min-width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.zoom-btn.zoom-close {
    background: var(--danger);
    color: white;
}

.zoom-btn.zoom-close:hover {
    background: #dc2626;
}

.zoom-level {
    font-size: 0.9rem;
    font-weight: bold;
    min-width: 50px;
    text-align: center;
}

.zoom-modal-body {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.zoom-image-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    overflow: hidden;
}

.zoom-image-container:active {
    cursor: grabbing;
}

#zoomImage {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transform-origin: center;
    transition: opacity 0.3s, transform 0.1s;
    user-select: none;
}

.zoom-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.7);
    border: none;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    z-index: 10;
}

.zoom-nav-btn:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: translateY(-50%) scale(1.1);
}

.zoom-nav-prev {
    left: 20px;
}

.zoom-nav-next {
    right: 20px;
}

.zoom-modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    background: var(--bg);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.zoom-image-info {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
}

.zoom-shortcuts {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.zoom-shortcuts kbd {
    background: var(--secondary);
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: monospace;
    font-size: 0.8rem;
}

/* Zoom button on scene images */
.scene-image-container {
    position: relative;
}

/* ============= ZOOM & EXTRACT FRAME BUTTONS ============= */

/* Zoom Image Button */
.zoom-image-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    z-index: 5;
}
/* SỬA LỖI: Trỏ vào đúng class .media-item để hiển thị nút */
.scene-card .media-item:hover .zoom-image-btn {
    display: flex !important;
}

/* Extract Frame Button */
.extract-frame-btn {
    position: absolute;
    top: 10px;
    right: 50px; /* Sẽ nằm cạnh nút zoom */
    background: rgba(0, 0, 0, 0.7);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    z-index: 5;
}

/* SỬA LỖI: Trỏ vào đúng class .media-item để hiển thị nút */
.scene-card .media-item:hover .extract-frame-btn {
    display: flex !important;
}
.zoom-image-btn:hover {
    background: var(--primary);
    transform: scale(1.1);
}

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

/* Extract Frame Button */
.extract-frame-btn {
    position: absolute;
    top: 10px;
    right: 50px;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    z-index: 5;
}

.scene-card .scene-video-preview:hover .extract-frame-btn,
.scene-card [class*="video"]:hover .extract-frame-btn {
    display: flex !important;
}

.extract-frame-btn:hover {
    background: var(--success);
    transform: scale(1.1);
}

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

/* ============= TIMELINE EDITOR ============= */
/* Fix timeline canvas container */
.timeline-canvas-wrapper {
    overflow-x: auto;
    overflow-y: hidden;
    background: #f5f5f5;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 1.5rem;
}

.timeline-canvas-container {
    position: relative;
    min-height: 200px;
}

#timelineCanvas {
    display: block;
    cursor: pointer;
}

/* Fix z-index for video render section */
#videoRenderSection {
    position: relative;
    z-index: 1;
    background: var(--bg);
}

#videoRenderSection.hidden {
    display: none;
}

/* Ensure scenes section is hidden when video render is shown */
.timeline-editor-container:not(.hidden) ~ #scenesSection,
.timeline-editor-container:not(.hidden) ~ #filmsSection {
    display: none !important;
}

/* Image zoom button */
.scene-image-container {
    position: relative;
}

.zoom-image-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    z-index: 5;
}

.scene-image-container:hover .zoom-image-btn {
    display: flex;
}

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

/* Extract frame button for videos */
.scene-video-container {
    position: relative;
}

.extract-frame-btn {
    position: absolute;
    top: 10px;
    right: 5px; /* Positioned next to other buttons */
    background: rgba(0, 0, 0, 0.7);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    z-index: 5;
}

.scene-video-container:hover .extract-frame-btn {
    display: flex;
}

.extract-frame-btn:hover {
    background: var(--success);
    transform: scale(1.1);
}

/* Zoom modal styles */
.zoom-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.zoom-modal.hidden {
    display: none;
}

.zoom-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
}

.zoom-modal-content {
    position: relative;
    width: 95%;
    height: 95%;
    background: var(--card-bg);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.zoom-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
}

.zoom-modal-title {
    font-size: 1.2rem;
    font-weight: bold;
}

.zoom-modal-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.zoom-btn {
    background: var(--secondary);
    border: none;
    color: var(--text);
    padding: 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    min-width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.zoom-btn.zoom-close {
    background: var(--danger);
    color: white;
}

.zoom-btn.zoom-close:hover {
    background: #dc2626;
}

.zoom-level {
    font-size: 0.9rem;
    font-weight: bold;
    min-width: 50px;
    text-align: center;
}

.zoom-modal-body {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.zoom-image-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    overflow: hidden;
}

.zoom-image-container:active {
    cursor: grabbing;
}

#zoomImage {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transform-origin: center;
    transition: opacity 0.3s, transform 0.1s;
    user-select: none;
}

.zoom-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.7);
    border: none;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    z-index: 10;
}

.zoom-nav-btn:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: translateY(-50%) scale(1.1);
}

.zoom-nav-prev {
    left: 20px;
}

.zoom-nav-next {
    right: 20px;
}

.zoom-modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    background: var(--bg);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.zoom-image-info {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
}

.zoom-shortcuts {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.zoom-shortcuts kbd {
    background: var(--secondary);
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: monospace;
    font-size: 0.8rem;
}

/* Timeline editor styles */
.timeline-editor-container {
    padding: 2rem;
    background: var(--bg);
    min-height: 100vh;
    position: relative;
    z-index: 2;
}

.timeline-editor {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border);
}

.timeline-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.timeline-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--bg);
    border-radius: 8px;
    gap: 1rem;
    flex-wrap: wrap;
}

.timeline-playback {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.timeline-time {
    font-family: monospace;
    font-size: 1.1rem;
    font-weight: bold;
    margin-left: 1rem;
}

.timeline-zoom {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

#zoomLevel {
    min-width: 60px;
    text-align: center;
    font-weight: bold;
}

.timeline-actions {
    display: flex;
    gap: 0.5rem;
}

.timeline-playhead {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 2px;
    height: 180px;
    background: #ef4444;
    pointer-events: none;
    z-index: 10;
}

.timeline-playhead::before {
    content: '';
    position: absolute;
    top: -8px;
    left: -6px;
    width: 0;
    height: 0;
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-top: 10px solid #ef4444;
}

.timeline-details {
    background: var(--bg);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    min-height: 150px;
}

.timeline-details .no-selection {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 120px;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.timeline-details .no-selection i {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--primary);
}

.scene-trim-details h3 {
    margin: 0 0 1rem 0;
    font-size: 1.3rem;
    color: var(--primary);
}

.trim-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.trim-stat {
    background: var(--card-bg);
    padding: 1rem;
    border-radius: 6px;
    border: 1px solid var(--border);
}

.trim-stat.highlight {
    background: var(--primary-light);
    border-color: var(--primary);
}

.trim-stat label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.3rem;
}

.trim-stat span {
    font-size: 1.3rem;
    font-weight: bold;
    font-family: monospace;
}

.trim-actions {
    display: flex;
    gap: 0.5rem;
}

.timeline-preview {
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}

/* Responsive */
@media (max-width: 768px) {
    .zoom-modal-content {
        width: 100%;
        height: 100%;
        border-radius: 0;
    }
    
    .zoom-nav-btn {
        width: 40px;
        height: 40px;
    }
    
    .zoom-shortcuts {
        display: none;
    }
    
    .timeline-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .timeline-playback,
    .timeline-zoom,
    .timeline-actions {
        justify-content: center;
    }
    
    .trim-info {
        grid-template-columns: 1fr;
    }
    
    .extract-frame-btn {
        right: 10px;
        top: 50px;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.zoom-modal.active {
    animation: fadeIn 0.3s ease-out;
}

/* Dark mode */
[data-theme="dark"] .zoom-modal-content,
[data-theme="dark"] .timeline-editor {
    background: #1f2937;
}

[data-theme="dark"] .zoom-modal-header,
[data-theme="dark"] .zoom-modal-footer,
[data-theme="dark"] .timeline-controls,
[data-theme="dark"] .timeline-details {
    background: #111827;
}

[data-theme="dark"] .timeline-canvas-wrapper {
    background: #374151;
}

[data-theme="dark"] .trim-stat {
    background: #1f2937;
}