:root {
    /* NOTE: Primary theme colors are dynamically loaded from header.php
       based on the selected color scheme. Do NOT hardcode them here. */

    /* Universal colors - not theme-dependent */
    --secondary-color: #1a1a1a;
    --background-color: #000000; /* Black */
    --background-light: #5a5e64;
    --background-dark: #3a3e44;
    --text-color: #f0f0f0;
    --text-dark: #1a1a1a;
    --border-color: #6a6e74;
    --card-bg: #f8f9fa;
    --shadow-light: 0 2px 8px rgba(0,0,0,0.15);
    --shadow-medium: 0 4px 16px rgba(0,0,0,0.20);
    --shadow-heavy: 0 8px 32px rgba(0,0,0,0.25);
    --border-radius: 12px;
    --transition: all 0.3s ease;

    /* Gradient colors - Will be overridden by header.php after color variables load */
    --gradient-primary: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    --gradient-success: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    --gradient-info: linear-gradient(135deg, var(--color-bg-dark) 0%, var(--color-bg-medium) 100%);
    --gradient-warning: linear-gradient(135deg, var(--color-primary-light) 0%, var(--color-primary) 100%);
    --gradient-danger: linear-gradient(135deg, var(--color-primary-dark) 0%, #7a6330 100%);
}

[data-theme="dark"] {
    --background-color: #1a1a1a;
    --background-light: #2d2d2d;
    --background-dark: #0d0d0d;
    --text-color: #f0f0f0;
    --border-color: #3a3a3a;
    --secondary-color: #1a1a1a;
    --card-bg: #2d2d2d;
    --card-border: #3a3a3a;
    --input-bg: #2d2d2d;
    --input-border: #3a3a3a;
    --modal-bg: #2d2d2d;
    --header-text: #ffffff;
}

/* Dark Mode Specific Styles */
[data-theme="dark"] body {
    background: var(--background-color);
    color: var(--text-color);
}

[data-theme="dark"] .page-header {
    background: linear-gradient(135deg, var(--color-primary-dark) 0%, #7a6330 100%);
    border: 2px solid var(--color-primary);
    color: #ffffff !important;
}

[data-theme="dark"] .page-header h1,
[data-theme="dark"] .page-header h2,
[data-theme="dark"] .page-header h3 {
    color: #ffffff !important;
    text-shadow: 2px 2px 6px rgba(0,0,0,0.8);
}

[data-theme="dark"] .breadcrumb,
[data-theme="dark"] .breadcrumb a {
    color: rgba(255,255,255,0.95) !important;
}

[data-theme="dark"] .stats-grid .stat-box,
[data-theme="dark"] .project-card,
[data-theme="dark"] .scene-card,
[data-theme="dark"] .shot-card,
[data-theme="dark"] .asset-card,
[data-theme="dark"] .timeline-item {
    background: linear-gradient(135deg, #1a1a1a 0%, #222 100%);
    border: 2px solid #2a2a2a;
    color: #f0f0f0;
}

[data-theme="dark"] .stat-value {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

[data-theme="dark"] .stat-label {
    color: #a0a0a0;
}

[data-theme="dark"] .modal {
    background-color: rgba(0,0,0,0.9);
}

[data-theme="dark"] .modal-content {
    background: linear-gradient(135deg, #1a1a1a 0%, #222 100%);
    border: 3px solid #444;
    color: #f0f0f0;
}

[data-theme="dark"] .modal-header {
    background: linear-gradient(135deg, rgba(201, 169, 97, 0.15) 0%, transparent 100%);
    border-bottom-color: #444;
}

[data-theme="dark"] .modal-header h2 {
    color: #ffffff;
}

[data-theme="dark"] .modal-body {
    color: #f0f0f0;
}

[data-theme="dark"] .modal-footer {
    background: linear-gradient(135deg, transparent 0%, rgba(201, 169, 97, 0.1) 100%);
    border-top-color: #444;
}

[data-theme="dark"] .form-control,
[data-theme="dark"] input,
[data-theme="dark"] textarea,
[data-theme="dark"] select {
    background: #1a1a1a;
    border-color: #333;
    color: #f0f0f0;
}

[data-theme="dark"] .form-control:focus,
[data-theme="dark"] input:focus,
[data-theme="dark"] textarea:focus,
[data-theme="dark"] select:focus {
    background: #222;
    border-color: var(--color-primary);
    color: #fff;
}

[data-theme="dark"] .form-group label {
    color: #e0e0e0;
}

[data-theme="dark"] .btn-primary {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: #ffffff;
    border: 2px solid rgba(255,255,255,0.1);
}

[data-theme="dark"] .btn-secondary {
    background: linear-gradient(135deg, #2a2a2a 0%, #3a3a3a 100%);
    color: #ffffff;
    border: 2px solid #444;
}

[data-theme="dark"] .navbar {
    background: linear-gradient(135deg, #0d0d0d 0%, #1a1a1a 100%);
    border-bottom: 2px solid #333;
}

[data-theme="dark"] .nav-link {
    color: #e0e0e0;
}

[data-theme="dark"] .nav-link:hover,
[data-theme="dark"] .nav-link.active {
    color: var(--color-primary);
    background: rgba(var(--color-primary-rgb), 0.1);
}

[data-theme="dark"] .editor-sidebar,
[data-theme="dark"] .editor-main {
    background: linear-gradient(135deg, #1a1a1a 0%, #222 100%);
    border: 2px solid #2a2a2a;
}

[data-theme="dark"] .tabs {
    background: linear-gradient(135deg, #1a1a1a 0%, #222 100%);
    border-bottom-color: #444;
}

[data-theme="dark"] .tab {
    color: #a0a0a0;
}

[data-theme="dark"] .tab:hover {
    color: var(--color-primary);
    background: rgba(var(--color-primary-rgb), 0.1);
}

[data-theme="dark"] .tab.active {
    background: #2a2a2a;
    color: var(--color-primary);
}

[data-theme="dark"] .empty-state {
    background: linear-gradient(135deg, #1a1a1a 0%, #222 100%);
    border: 2px dashed #444;
    color: #999;
}

[data-theme="dark"] .upload-zone {
    background: linear-gradient(135deg, #1a1a1a 0%, #222 100%);
    border-color: #444;
}

[data-theme="dark"] .upload-zone.drag-over {
    border-color: var(--color-primary);
    background: linear-gradient(135deg, rgba(var(--color-primary-rgb), 0.1) 0%, rgba(var(--color-primary-rgb), 0.05) 100%);
}

[data-theme="dark"] .scene-info-bar,
[data-theme="dark"] .sidebar-section {
    background: linear-gradient(135deg, #1a1a1a 0%, #222 100%);
    border-color: #2a2a2a;
}

[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] h5,
[data-theme="dark"] h6 {
    color: #ffffff;
}

[data-theme="dark"] .text-muted,
[data-theme="dark"] .info-item {
    color: #a0a0a0;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.navbar {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    box-shadow: var(--shadow-medium);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 2px solid var(--color-primary);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
}

.nav-brand {
    display: flex;
    align-items: center;
}

.nav-brand a {
    color: white;
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-brand i {
    color: var(--color-primary);
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-link {
    color: #ccc;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-link:hover {
    background-color: rgba(255,255,255,0.1);
    color: white;
}

.nav-link.active {
    background-color: var(--color-primary);
    color: #ffffff;
    font-weight: 600;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-name {
    color: white;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.theme-toggle {
    background: none;
    border: none;
    color: #ccc;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0.5rem;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background: white;
    margin: 3px 0;
    transition: var(--transition);
}

.main-content {
    min-height: calc(100vh - 140px);
    padding: 2rem 0;
}

.page-header {
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    color: #666;
}

.breadcrumb a {
    color: var(--color-primary);
    text-decoration: none;
}

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

.stat-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-light);
    display: flex;
    align-items: center;
    gap: 1rem;
}

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

.stat-content h3 {
    font-size: 2rem;
    color: var(--secondary-color);
}

.stat-content p {
    color: #666;
    font-size: 0.9rem;
}

.filter-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.form-control {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    width: 100%;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(229, 9, 20, 0.1);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

.scenes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 2rem;
    padding: 2rem 0;
}

.project-card,
.scene-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
    overflow: hidden;
    transition: var(--transition);
    position: relative;
}

.project-card:hover,
.scene-card:hover {
    box-shadow: var(--shadow-medium);
    transform: translateY(-2px);
}

.project-header,
.scene-thumbnail {
    padding: 1.5rem;
    background: linear-gradient(135deg, #f5f5f5, #e0e0e0);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.scene-thumbnail {
    height: 200px;
    position: relative;
    padding: 0;
}

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

.no-thumbnail {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #999;
}

.scene-number {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-weight: bold;
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.status-pre-production {
    background: #ffc107;
    color: #000;
}

.status-production {
    background: #28a745;
    color: white;
}

.status-post-production {
    background: #17a2b8;
    color: white;
}

.status-completed {
    background: #6c757d;
    color: white;
}

.project-info,
.scene-content {
    padding: 1.5rem;
}

.project-info p,
.scene-location,
.scene-time {
    margin: 0.5rem 0;
    color: #666;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.project-stats,
.scene-stats {
    padding: 1rem 1.5rem;
    background: #f8f9fa;
    display: flex;
    justify-content: space-around;
}

.project-stats .stat,
.scene-stats span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #666;
    font-size: 0.9rem;
}

.project-actions,
.scene-actions {
    padding: 1rem 1.5rem;
    display: flex;
    gap: 0.5rem;
}

.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 0.9rem;
    transition: var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

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

.btn-primary:hover {
    background: #c50812;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-danger {
    background: linear-gradient(135deg, var(--color-primary-dark) 0%, #7a6330 100%);
    color: white;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #7a6330 0%, var(--color-primary-dark) 100%);
    box-shadow: 0 8px 25px rgba(240, 147, 251, 0.4);
}

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

.btn-success:hover {
    background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary) 100%);
    box-shadow: 0 8px 25px rgba(67, 233, 123, 0.4);
}

.btn-sm {
    padding: 0.6rem 1.25rem;
    font-size: 0.85rem;
    letter-spacing: 0.3px;
    border-radius: 10px;
    text-transform: none;
}

.btn-sm:hover {
    transform: translateY(-2px);
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.15rem;
    border-radius: 14px;
}

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

.btn-icon {
    background: linear-gradient(135deg, white 0%, #f8f9fa 100%);
    border: 2px solid #e9ecef;
    padding: 0.5rem;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    color: #6c757d;
    text-transform: none;
    letter-spacing: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: white;
    border-color: transparent;
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(var(--color-primary-rgb), 0.4);
}

.btn-icon.btn-danger {
    border-color: #dc3545;
    color: #dc3545;
}

.btn-icon.btn-danger:hover {
    background: #dc3545;
    color: white;
}

.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    margin: 50px auto;
    padding: 0;
    border-radius: 20px;
    width: 90%;
    max-width: 650px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3), 0 0 0 1px rgba(255,255,255,0.1) inset;
    border: 3px solid rgba(201, 169, 97, 0.2);
    animation: slideUp 0.4s ease;
    position: relative;
}

.modal-content::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    border-radius: 20px;
    z-index: -1;
    opacity: 0.5;
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-lg {
    max-width: 950px;
}

.modal-header {
    padding: 2rem 2rem 1.5rem 2rem;
    border-bottom: 2px solid rgba(201, 169, 97, 0.15);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, rgba(201, 169, 97, 0.08) 0%, transparent 100%);
    border-radius: 20px 20px 0 0;
}

.modal-header h2 {
    font-size: 1.75rem;
    color: #2c3e50;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.modal-header h2 i {
    font-size: 1.5rem;
    color: var(--color-primary);
}

.modal-close {
    background: linear-gradient(135deg, var(--color-primary-dark) 0%, #7a6330 100%);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(240, 147, 251, 0.3);
}

.modal-close:hover {
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 4px 12px rgba(240, 147, 251, 0.5);
}

.modal-body {
    padding: 2rem;
}

.modal-body .form-group {
    margin-bottom: 1.75rem;
}

.modal-body .form-group label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modal-body .form-control {
    border: 2px solid #e9ecef;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.modal-body .form-control:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px rgba(var(--color-primary-rgb), 0.1);
    outline: none;
}

.modal-body textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

.modal-footer {
    padding: 1.5rem 2rem 2rem 2rem;
    border-top: 2px solid rgba(201, 169, 97, 0.15);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    background: linear-gradient(135deg, transparent 0%, rgba(201, 169, 97, 0.05) 100%);
    border-radius: 0 0 20px 20px;
}

.modal-footer .btn {
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.modal-footer .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
}

.modal-footer .btn-primary {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    border: none;
    color: white;
}

.modal-footer .btn-secondary {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid #dee2e6;
    color: #6c757d;
}

.modal-footer .btn-secondary:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    border-color: #adb5bd;
}

.form-group {
    margin-bottom: 1.75rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: #495057;
    font-size: 0.95rem;
}

.form-group label span.required {
    color: #dc3545;
    margin-left: 2px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.75rem;
}

.form-row .form-group {
    margin-bottom: 0;
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: #999;
}

.empty-state i {
    color: #ddd;
    margin-bottom: 1rem;
}

.empty-state h2 {
    margin-bottom: 0.5rem;
}

.editor-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
    min-height: 600px;
}

.editor-sidebar {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
}

.sidebar-section {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-section:last-child {
    border-bottom: none;
}

.sidebar-section h3 {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.editor-main {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
    overflow: hidden;
}

.tab-container {
    height: 100%;
}

.tabs {
    display: flex;
    background: #f8f9fa;
    border-bottom: 1px solid var(--border-color);
}

.tab {
    background: none;
    border: none;
    padding: 1rem 1.5rem;
    cursor: pointer;
    position: relative;
    color: #666;
    transition: var(--transition);
}

.tab:hover {
    background: rgba(0,0,0,0.05);
}

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

.tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--color-primary);
}

.tab-content {
    display: none;
    padding: 1.5rem;
    height: calc(100% - 53px);
    overflow-y: auto;
}

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

.script-editor {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.editor-toolbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
}

.toolbar-btn {
    background: white;
    border: 1px solid var(--border-color);
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
}

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

.toolbar-separator {
    width: 1px;
    height: 20px;
    background: var(--border-color);
}

.save-status {
    margin-left: auto;
    color: #28a745;
    font-size: 0.9rem;
}

.script-textarea-container {
    flex: 1;
}

.script-textarea,
.notes-textarea {
    width: 100%;
    height: 100%;
    min-height: 400px;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    line-height: 1.8;
    resize: vertical;
}

.assets-manager {
    padding: 1rem 0;
}

.asset-type-section {
    margin-bottom: 2rem;
}

.asset-type-section h3 {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius);
    padding: 1rem;
    transition: var(--transition);
}

.upload-zone.drag-over {
    border-color: var(--color-primary);
    background: rgba(229, 9, 20, 0.05);
}

.upload-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
}

.asset-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-light);
}

.asset-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.asset-item:hover .asset-actions {
    opacity: 1;
}

.asset-actions {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    opacity: 0;
    transition: var(--transition);
}

.upload-placeholder {
    aspect-ratio: 1;
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    background: #f8f9fa;
}

.upload-placeholder:hover {
    border-color: var(--color-primary);
    background: rgba(229, 9, 20, 0.05);
}

.upload-placeholder p {
    margin-top: 0.5rem;
    color: #666;
    font-size: 0.9rem;
}

.drag-handle {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    cursor: move;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-medium);
    z-index: 3001;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transform: translateX(400px);
    transition: transform 0.3s ease;
}

.notification.show {
    transform: translateX(0);
}

.notification-success {
    background: #28a745;
    color: white;
}

.notification-error {
    background: #dc3545;
    color: white;
}

.alert {
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-dismissible {
    position: relative;
    padding-right: 2.5rem;
}

.alert-close {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0.5;
}

.alert-close:hover {
    opacity: 1;
}

.footer {
    background: #2a2e34;
    color: var(--color-primary);
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
    border-top: 2px solid var(--color-primary);
}

@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background: var(--secondary-color);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0,0,0,0.05);
        padding: 2rem 0;
    }

    .nav-menu.active {
        left: 0;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .projects-grid,
    .scenes-grid {
        grid-template-columns: 1fr;
    }

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

    .editor-sidebar {
        order: 2;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

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

/* ==============================================
   CONTRAST AND READABILITY FIXES
   ============================================== */

/* Fix page headers to have proper contrast */
.page-header {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%) !important;
    color: #ffffff !important;
    padding: 2rem !important;
    border-radius: 15px;
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 50%;
    height: 200%;
    background: rgba(255,255,255,0.1);
    transform: rotate(35deg);
}

/* Ensure ALL text in page headers is white */
.page-header * {
    color: #ffffff !important;
    position: relative;
    z-index: 1;
}

.page-header h1,
.page-header h2,
.page-header h3 {
    text-shadow: 2px 2px 6px rgba(0,0,0,0.3);
    font-weight: 700;
}

.page-header .breadcrumb,
.page-header .breadcrumb a,
.page-header .breadcrumb span {
    color: rgba(255,255,255,0.95) !important;
}

.page-header .header-actions .btn {
    background: rgba(255,255,255,0.2) !important;
    border: 2px solid rgba(255,255,255,0.3) !important;
    color: #ffffff !important;
}

.page-header .header-actions .btn:hover {
    background: rgba(255,255,255,0.3) !important;
}

/* Project and Scene Card Headers */
.project-card .project-header,
.scene-card .scene-header {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    padding: 1rem;
}

.project-card .project-header *,
.scene-card .scene-header * {
    color: #ffffff !important;
}

.project-card .status,
.scene-card .scene-number {
    background: rgba(255,255,255,0.2);
    color: #ffffff !important;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
}

/* Fix stat values contrast */
.stat-value {
    color: #2c3e50 !important;
}

[data-theme="light"] .stat-value {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Dark mode page header adjustments */
[data-theme="dark"] .page-header {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%) !important;
    border: 2px solid #2a2a2a;
}

[data-theme="dark"] .page-header * {
    color: #ffffff !important;
}

[data-theme="dark"] .project-card .project-header,
[data-theme="dark"] .scene-card .scene-header {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-bottom: 2px solid #333;
}

/* Ensure form labels are readable */
.form-group label {
    color: #495057;
    font-weight: 600;
}

[data-theme="dark"] .form-group label {
    color: #e0e0e0;
}

/* Fix button text contrast */
.btn {
    font-weight: 600 !important;
}

.btn-primary,
.btn-success,
.btn-danger {
    color: #ffffff !important;
}

/* Navigation contrast fixes */
.navbar {
    background: linear-gradient(135deg, #141414 0%, #2a2a2a 100%) !important;
}

.nav-brand a,
.nav-link {
    color: #e0e0e0 !important;
}

.nav-brand a:hover,
.nav-link:hover {
    color: var(--color-primary) !important;
}

.nav-link.active {
    color: #ffffff !important;
    background-color: var(--color-primary);
}

[data-theme="dark"] .navbar {
    border-bottom: 2px solid #333;
}

/* Theme toggle button visibility */
.theme-toggle {
    background: rgba(255,255,255,0.1);
    border: 2px solid rgba(255,255,255,0.2);
    color: #e0e0e0;
    padding: 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    background: rgba(255,255,255,0.2);
    color: #ffffff;
    transform: scale(1.1);
}