/* --- COLOR PALETTE & BASE STYLES --- */
:root {
    --bg-primary: #f5f7fa;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f8f9fa;
    --bg-interactive: #e1e5e9;
    --bg-raw: #2d3748;
    --bg-modal-overlay: rgba(0,0,0,0.75);

    --text-primary: #333;
    --text-secondary: #666;
    --text-accent: #00568e;
    --text-accent-hover: #0073aa;
    --text-on-accent: #ffffff;
    --text-placeholder: #ccc;

    --border-primary: #e1e5e9;
    --border-accent: #0073aa;
    --border-interactive-focus: #0073aa;

    --shadow-sm: rgba(0,0,0,0.08);
    --shadow-md: rgba(0,0,0,0.1);
    --shadow-lg: rgba(0,0,0,0.15);

    /* Notice & Status Colors */
    --notice-error-bg: #f8d7da;
    --notice-error-text: #721c24;
    --notice-error-border: #dc3545;
    --notice-info-bg: #d1ecf1;
    --notice-info-text: #0c5460;
    --notice-info-border: #17a2b8;
}

/* --- DARK MODE FIX --- */
:root.dark,
html.dark { /* Apply dark mode styles when 'dark' class is present on root */
    --bg-primary: #111827;     /* Gray 900 */
    --bg-secondary: #1f2937;    /* Gray 800 */
    --bg-tertiary: #374151;    /* Gray 700 */
    --bg-interactive: #4b5563;  /* Gray 600 */
    --bg-raw: #2d3748;          /* Kept same, already dark */
    --bg-modal-overlay: rgba(0,0,0,0.85);

    --text-primary: #e5e7eb;    /* Gray 200 */
    --text-secondary: #9ca3af;   /* Gray 400 */
    --text-accent: #60a5fa;     /* Blue 400 */
    --text-accent-hover: #93c5fd;/* Blue 300 */
    --text-on-accent: #ffffff;
    --text-placeholder: #6b7280; /* Gray 500 */

    --border-primary: #374151;  /* Gray 700 */
    --border-accent: #60a5fa;    /* Blue 400 */
    --border-interactive-focus: #3b82f6; /* Blue 500 */

    --shadow-sm: rgba(0,0,0,0.2);
    --shadow-md: rgba(0,0,0,0.3);
    --shadow-lg: rgba(0,0,0,0.4);

    /* Notice & Status Colors (Dark) */
    --notice-error-bg: #450a0a;
    --notice-error-text: #fca5a5;
    --notice-error-border: #ef4444;
    --notice-info-bg: #164e63;
    --notice-info-text: #67e8f9;
    --notice-info-border: #06b6d4;
}
/* --- END DARK MODE FIX --- */

/* --- DARK MODE TOGGLE BUTTON --- */
.dark-mode-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

#toggle-dark-mode {
    padding: 12px 20px;
    border-radius: 10px;
    background: linear-gradient(135deg, #0073aa, #00568e);
    color: white;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 115, 170, 0.3);
    display: flex;
    align-items: center;
    gap: 8px;
}

#toggle-dark-mode:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 115, 170, 0.4);
}

#toggle-dark-mode:active {
    transform: translateY(0);
}

.dark #toggle-dark-mode {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.dark #toggle-dark-mode:hover {
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

/* Responsive dark mode button */
@media (max-width: 768px) {
    .dark-mode-toggle {
        top: 10px;
        right: 10px;
    }
    #toggle-dark-mode {
        padding: 10px 16px;
        font-size: 12px;
    }
}

/* --- GENERAL STYLES --- */
* { box-sizing: border-box; }
body { 
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; 
    background: var(--bg-primary); 
    margin: 0; 
    padding: 20px; 
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}
.wrap { 
    max-width: 1400px; 
    margin: 0 auto; 
    padding-top: 2rem;
}
.main-header { 
    text-align: center; 
    margin-bottom: 40px; 
    color: var(--text-accent);
    padding: 20px 0;
}
.main-header a { 
    text-decoration: none;
    color: inherit; 
    transition: opacity 0.2s ease;
}
.main-header a:hover {
    opacity: 0.8;
}
.main-header h1 { 
    font-size: clamp(2em, 5vw, 2.8em); 
    margin: 0 0 10px 0; 
    text-shadow: 0 2px 4px var(--shadow-md);
    font-weight: 700;
}
.main-header p {
    margin: 8px 0;
    font-size: 1.1em;
    color: var(--text-secondary);
}
.form-section { 
    margin-bottom: 30px; 
    padding: 30px; 
    background: var(--bg-secondary); 
    border-radius: 16px; 
    box-shadow: 0 8px 32px var(--shadow-md);
    transition: box-shadow 0.3s ease, transform 0.2s ease;
}
.form-section:hover {
    box-shadow: 0 12px 40px var(--shadow-lg);
}
.form-section h2 { 
    margin-top: 0; 
    margin-bottom: 20px;
    color: var(--text-accent);
    font-size: 1.5em;
    font-weight: 600;
}
.form-controls { 
    display: flex; 
    flex-wrap: wrap; 
    gap: 20px; 
    align-items: flex-end; 
}
.form-group { 
    flex: 1; 
    min-width: 200px; 
}
.form-group label { 
    display: block; 
    margin-bottom: 10px; 
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95em;
}
.form-group select, 
.form-group input[type="date"],
.form-group input[type="text"] { 
    width: 100%; 
    padding: 12px 16px; 
    border-radius: 8px; 
    border: 2px solid var(--border-primary); 
    background-color: var(--bg-secondary); 
    color: var(--text-primary); 
    font-size: 16px; 
    transition: all 0.2s ease;
    font-family: inherit;
}
.form-group select:focus, 
.form-group input[type="date"]:focus,
.form-group input[type="text"]:focus { 
    outline: none; 
    border-color: var(--border-interactive-focus);
    box-shadow: 0 0 0 3px var(--shadow-sm);
}
.form-group input[type="date"] {
    width: 100% !important;
    max-width: 250px;
}
.button-primary { 
    background: var(--gradient-primary); 
    color: var(--text-inverse); 
    border: none; 
    padding: var(--space-3) var(--space-6); 
    border-radius: var(--radius-md); 
    cursor: pointer; 
    font-weight: 700; 
    font-size: var(--text-base); 
    transition: all var(--transition-fast);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    letter-spacing: 0.01em;
}
.button-primary:hover { 
    transform: translateY(-1px); 
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
    filter: brightness(1.05);
}
.button-secondary { 
    background: var(--bg-elevated); 
    color: var(--text-primary); 
    border: 1px solid var(--border-light); 
    padding: var(--space-3) var(--space-6); 
    border-radius: var(--radius-md); 
    cursor: pointer; 
    font-weight: 700; 
    font-size: var(--text-base); 
    transition: all var(--transition-fast);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
.button-secondary:hover { 
    background-color: var(--bg-tertiary);
    border-color: var(--theme-primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Double Feature Styles */
.select-double-feature-btn {
    display: none; /* Hidden by default, shown when double feature mode is on */
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s ease;
    margin-top: 8px;
    width: 100%;
}
.select-double-feature-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}
.dark .select-double-feature-btn {
    background: linear-gradient(135deg, #a78bfa, #8b5cf6);
}

.double-feature-movie-slot {
    flex: 1;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 2px solid var(--border-primary);
    min-height: 200px;
}
.double-feature-movie-slot h3 {
    margin-top: 0;
    color: var(--text-accent);
    font-size: 1.2em;
}
.double-feature-movie-slot .no-selection {
    color: var(--text-secondary);
    font-style: italic;
    text-align: center;
    padding: 40px 20px;
}
/* Enhanced Dropdown Styling */
.movie-select-dropdown {
    width: 100%;
    padding: 14px 16px;
    border-radius: 12px;
    border: 2px solid var(--border-primary);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 12px;
    padding-right: 40px;
}
.movie-select-dropdown:hover {
    border-color: var(--border-interactive-focus);
    background-color: var(--bg-tertiary);
}
.movie-select-dropdown:focus {
    outline: none;
    border-color: var(--border-interactive-focus);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
    background-color: var(--bg-tertiary);
}
.movie-select-dropdown option {
    padding: 12px;
    background: var(--bg-secondary);
    color: var(--text-primary);
}
.movie-selection-controls {
    width: 100%;
}

/* Double Feature Modal Enhancements */
.double-feature-modal .modal-content {
    max-width: 900px;
    width: 95%;
    max-height: 95vh;
    overflow-y: auto;
}
#double-feature-selection-area {
    display: flex;
    align-items: stretch;
    gap: 20px;
    margin: 20px 0;
    flex-wrap: wrap;
}
.double-feature-movie-slot {
    flex: 1;
    min-width: 280px;
}
.double-feature-arrow {
    font-size: 2em;
    color: var(--text-accent);
    display: flex;
    align-items: center;
    padding: 0 10px;
    font-weight: bold;
    flex-shrink: 0;
}
.selected-movie-info > div {
    background: var(--bg-tertiary);
    padding: 16px;
    border-radius: 12px;
    border: 2px solid var(--border-accent);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin-top: 12px;
}

/* Mobile Optimizations for Double Feature Modal */
@media (max-width: 768px) {
    .double-feature-modal .modal-content {
        max-width: 95%;
        padding: 20px 15px;
        margin: 10px;
    }
    #double-feature-selection-area {
        flex-direction: column;
        gap: 15px;
    }
    .double-feature-arrow {
        transform: rotate(90deg);
        padding: 10px 0;
        justify-content: center;
    }
    .double-feature-movie-slot {
        min-width: 100%;
    }
    .movie-select-dropdown {
        padding: 12px 14px;
        padding-right: 38px;
        font-size: 14px;
    }
    #double-feature-actions {
        flex-direction: column;
    }
    #double-feature-actions .button-primary,
    #double-feature-actions .button-secondary {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .double-feature-modal .modal-content {
        padding: 15px 12px;
    }
    .double-feature-movie-slot h3 {
        font-size: 1.1em;
    }
    .movie-select-dropdown {
        font-size: 13px;
        padding: 10px 12px;
        padding-right: 36px;
    }
}
.double-feature-arrow {
    font-size: 2em;
    color: var(--text-accent);
    display: flex;
    align-items: center;
    padding: 0 20px;
    font-weight: bold;
}
#double-feature-selection-area {
    display: flex;
    align-items: stretch;
    gap: 20px;
    margin-bottom: 20px;
}
@media (max-width: 768px) {
    #double-feature-selection-area {
        flex-direction: column;
    }
    .double-feature-arrow {
        transform: rotate(90deg);
        padding: 10px 0;
    }
}


.notice { padding: 20px; margin-bottom: 25px; border-radius: 8px; border-left: 5px solid; }
.notice-error { background: var(--notice-error-bg); color: var(--notice-error-text); border-color: var(--notice-error-border); }
.notice-info { background: var(--notice-info-bg); color: var(--notice-info-text); border-color: var(--notice-info-border); }
.raw-response { background: var(--bg-raw); color: #e2e8f0; border: 1px solid #4a5568; padding: 16px; border-radius: 6px; font-family: monospace; white-space: pre-wrap; max-height: 300px; overflow-y: auto; }

/* --- MOVIE CARD STYLES --- */
.theatre-header { 
    background: linear-gradient(135deg, #00568e, #0073aa); 
    color: var(--text-on-accent); 
    padding: 30px; 
    border-radius: 16px; 
    margin-bottom: 40px; 
    text-align: center; 
    box-shadow: 0 8px 24px var(--shadow-lg);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
}
.theatre-header:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px var(--shadow-lg);
}
.dark .theatre-header { 
    background: linear-gradient(135deg, #2563eb, #3b82f6); 
}
.theatre-header h1 { 
    margin: 0; 
    font-size: clamp(1.8em, 4vw, 2.2em);
    font-weight: 700;
}
.date-section { 
    margin-bottom: 50px; 
}
.date-header { 
    padding: 20px 24px; 
    border-radius: 12px; 
    margin-bottom: 30px; 
    border-left: 5px solid var(--border-accent); 
    background-color: var(--bg-secondary); 
    color: var(--text-primary);
    box-shadow: 0 2px 8px var(--shadow-sm);
    transition: box-shadow 0.2s ease;
}
.date-header:hover {
    box-shadow: 0 4px 12px var(--shadow-md);
}
.date-header h2 {
    margin: 0;
    font-size: 1.3em;
    font-weight: 600;
}
.movies-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr)); 
    gap: 30px;
}
@media (max-width: 768px) {
    .movies-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* --- MOVIE CARD LAYOUT FIX --- */
.movie-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 16px;
    padding: 28px;
    box-shadow: 0 4px 16px var(--shadow-sm);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: text;
    position: relative;
    overflow: hidden;
}
.movie-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--border-accent), var(--text-accent-hover));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}
.movie-card:hover::before {
    transform: scaleX(1);
}
/* --- END MOVIE CARD LAYOUT FIX --- */

.movie-card:hover { 
    transform: translateY(-6px); 
    box-shadow: 0 16px 40px var(--shadow-lg); 
    border-color: var(--border-accent);
}

/* New Movie Card Header for accordion */
.movie-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    padding: 0 0 16px 0;
    margin-bottom: 16px;
    border-bottom: 2px solid var(--border-primary);
    transition: border-color 0.2s ease;
}
.movie-card-header:hover {
    border-bottom-color: var(--border-accent);
}
.movie-card-header .movie-title {
    margin-bottom: 0;
    border-bottom: none;
    padding-bottom: 0;
    font-size: 1.3em;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
}
.movie-card-header .movie-runtime {
    margin-bottom: 0;
    margin-left: auto;
    margin-right: 12px;
    font-size: 0.9em;
    color: var(--text-secondary);
    font-weight: 500;
}
.movie-collapse-icon {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.9em;
    color: var(--text-secondary);
    flex-shrink: 0;
}
.movie-collapse-icon.expanded {
    transform: rotate(90deg);
}

/* --- MOVIE CARD LAYOUT FIX & ANIMATION --- */
body#admin .movie-content-collapsible {
    max-height: 100%;
}
.movie-content-collapsible {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    /* flex: 1; <-- FIX: REMOVED */
    scrollbar-width: thin;
    scrollbar-color: var(--bg-interactive) transparent;
}
/* --- END MOVIE CARD LAYOUT FIX & ANIMATION --- */


.experience-header { 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    cursor: pointer; 
    padding: 14px 18px; 
    background: var(--bg-tertiary); 
    border-radius: 10px; 
    margin-bottom: 10px; 
    color: var(--text-primary);
    transition: all 0.2s ease;
    border: 1px solid transparent;
}
.experience-header:hover { 
    background-color: var(--bg-interactive);
    border-color: var(--border-primary);
    transform: translateX(4px);
}
.experience-type { 
    font-weight: 600; 
    color: #d63384; 
    font-size: 13px; 
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.dark .experience-type { 
    color: #f9a8d4; 
}
.collapse-icon { 
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text-secondary);
    font-size: 0.85em;
}
.collapse-icon.expanded { 
    transform: rotate(90deg); 
}

/* --- ANIMATION UPDATE --- */
.sessions-list {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out, padding 0.3s ease-in-out;
    padding: 0 14px; /* Collapsed padding */
}
/* --- END ANIMATION UPDATE --- */

.session-item { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 14px; 
    font-size: 14px; 
    padding: 12px 0;
    border-bottom: 1px solid var(--border-primary);
    transition: padding 0.2s ease;
}
.session-item:hover {
    padding-left: 8px;
    border-bottom-color: var(--border-accent);
}
.auditorium { 
    font-weight: 600; 
    color: #28a745;
    font-size: 0.95em;
}
.dark .auditorium { 
    color: #4ade80; 
}
.view-seats-btn { 
    background: linear-gradient(135deg, #10b981, #059669);
    color: white; 
    border: none; 
    padding: 10px 16px; 
    font-size: 13px; 
    font-weight: 600; 
    border-radius: 8px; 
    cursor: pointer; 
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}
.view-seats-btn:hover { 
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}
.view-seats-btn:active {
    transform: translateY(0);
}

/* --- MODAL AND SEAT MAP STYLES --- */
.modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background-color: var(--bg-modal-overlay); display: flex; align-items: center; justify-content: center; z-index: 1050; opacity: 0; visibility: hidden; transition: opacity 0.3s ease, visibility 0.3s ease; }
.modal-overlay.visible { opacity: 1; visibility: visible; }
.modal-content { 
    position: relative; 
    background: var(--bg-secondary); 
    padding: 2rem; 
    border-radius: 12px; 
    width: 95%; 
    max-width: 1400px; 
    max-height: 95vh; 
    overflow-y: auto; 
    transform: scale(0.95); 
    transition: transform 0.3s ease; 
}
/* Special styling for seat map modal */
#live-map-modal .modal-content {
    max-width: 95vw;
    max-height: 95vh;
    width: 95vw;
    height: 95vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
}
.modal-overlay.visible .modal-content { transform: scale(1); }
.modal-close { position: absolute; top: 1rem; right: 1rem; font-size: 1.5rem; line-height: 1; font-weight: bold; color: var(--text-secondary); cursor: pointer; }
.spinner { border: 4px solid var(--bg-tertiary); border-top: 4px solid var(--border-accent); border-radius: 50%; width: 40px; height: 40px; animation: spin 1s linear infinite; margin: 2rem auto; }
.spinner-large { border: 6px solid var(--bg-tertiary); border-top: 6px solid var(--border-accent); border-radius: 50%; width: 60px; height: 60px; animation: spin 1s linear infinite; margin: 0 auto 20px; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(4px);
}
.loading-spinner-container {
    background: var(--bg-secondary);
    padding: 40px;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    color: var(--text-primary);
}
.loading-spinner-container p {
    margin-top: 20px;
    font-size: 1.1em;
    font-weight: 500;
}

/* Skeleton Loader */
.skeleton {
    background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-interactive) 50%, var(--bg-tertiary) 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; }
}
.skeleton-card {
    height: 200px;
    margin-bottom: 20px;
}

/* Seat Map Refresh Button */
.seat-map-refresh-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
}
.seat-map-refresh-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}
.seat-map-refresh-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
/* Seat Map Legend */
.seat-legend {
    display: flex;
    justify-content: center;
    gap: 15px;
    padding: 10px;
    background: var(--bg-secondary);
    border-radius: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9em;
    color: var(--text-primary);
}
.legend-seat {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    border: 1px solid rgba(0,0,0,0.1);
}
.legend-seat.available { background-color: #10b981; }
.legend-seat.occupied { background-color: #ef4444; }
.legend-seat.broken { background-color: #f59e0b; }
.legend-seat.selected { background-color: #3b82f6; border: 2px solid #2563eb; }

.screen { 
    background: linear-gradient(180deg, #1f2937 0%, #374151 100%);
    color: #fff; 
    padding: 12px; 
    text-align: center; 
    border-radius: 8px; 
    margin-bottom: 15px; 
    font-weight: 700; 
    letter-spacing: 2px; 
    text-transform: uppercase; 
    box-shadow: 0 8px 24px rgba(0,0,0,0.3), inset 0 -4px 8px rgba(0,0,0,0.2);
    font-size: clamp(0.9em, 2vw, 1.2em);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}
.screen::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
}

.seat-chart-container {
    overflow: auto;
    padding: 10px;
    background: var(--bg-secondary);
    border-radius: 12px;
    box-shadow: 0 4px 12px var(--shadow-md);
    flex: 1;
    min-height: 0;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.seat-chart { 
    display: grid; 
    gap: 6px; 
    padding: 10px; 
    background-color: var(--bg-primary); 
    border-radius: 12px; 
    width: fit-content;
    max-width: 100%;
    margin: 0 auto;
    overflow: visible;
}

.row-label-side {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--text-primary);
    font-size: clamp(10px, 1.5vw, 0.95em);
    padding: 0 8px;
    background: var(--bg-tertiary);
    border-radius: 6px;
    width: 100%;
    text-align: center;
    border: 2px solid var(--border-primary);
    flex-shrink: 0;
}
.row-label-side.empty-label {
    background: transparent;
    border: none;
}

.seat { 
    aspect-ratio: 1 / 1; 
    width: 100%;
    height: 100%;
    border-radius: 6px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: clamp(8px, 1.2vw, 12px); 
    font-weight: 700; 
    color: #fff; 
    cursor: pointer; 
    transition: all 0.2s ease; 
    position: relative;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
    border: 2px solid transparent;
}
.seat.available { 
    background: linear-gradient(135deg, #10b981, #059669);
    border-color: rgba(16, 185, 129, 0.3);
} 
.seat.available:hover { 
    background: linear-gradient(135deg, #059669, #047857);
    transform: scale(1.1);
    z-index: 10;
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.5);
    border-color: #10b981;
}
.seat.occupied { 
    background: linear-gradient(135deg, #ef4444, #dc2626);
    border-color: rgba(239, 68, 68, 0.3);
    cursor: not-allowed; 
    opacity: 0.8;
}
.seat.broken { 
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border-color: rgba(245, 158, 11, 0.3);
    cursor: not-allowed; 
    opacity: 0.75;
}
.seat.selected { 
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    transform: scale(1.15);
    z-index: 10;
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.7);
    border: 3px solid #60a5fa;
    animation: pulse-selected 2s ease-in-out infinite;
}
@keyframes pulse-selected {
    0%, 100% { box-shadow: 0 6px 20px rgba(59, 130, 246, 0.7); }
    50% { box-shadow: 0 6px 24px rgba(59, 130, 246, 0.9); }
}
.seat.empty { 
    background-color: transparent; 
    cursor: default; 
    border: none;
}
.walkway { 
    grid-column: 1 / -1; 
    text-align: center; 
    color: var(--text-secondary); 
    padding: 16px 0; 
    font-size: 13px; 
    background: linear-gradient(90deg, transparent, var(--bg-tertiary), transparent);
    border-radius: 6px; 
    font-weight: 600;
    margin: 8px 0;
    border-top: 2px dashed var(--border-primary);
    border-bottom: 2px dashed var(--border-primary);
}
.dark .walkway { 
    background: linear-gradient(90deg, transparent, var(--bg-tertiary), transparent);
}
.tooltip { 
    position: absolute; 
    background-color: var(--bg-tertiary); 
    color: var(--text-primary); 
    padding: 6px 10px; 
    border-radius: 6px; 
    font-size: 12px; 
    z-index: 1100; 
    white-space: nowrap; 
    display: none; 
    pointer-events: none; 
    border: 1px solid var(--border-primary);
    box-shadow: 0 2px 8px var(--shadow-md);
}

/* Custom Alert Modal Styles */
.custom-alert-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--bg-modal-overlay);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.custom-alert-overlay.visible {
    opacity: 1;
    visibility: visible;
}
.custom-alert-content {
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    text-align: center;
    width: 90%;
    max-width: 400px;
    transform: translateY(-20px);
    transition: transform 0.3s ease;
    color: var(--text-primary);
}
.custom-alert-overlay.visible .custom-alert-content {
    transform: translateY(0);
}
.custom-alert-content h3 {
    margin-top: 0;
    color: var(--text-accent);
    font-size: 1.5rem;
    margin-bottom: 1rem;
}
.custom-alert-content p {
    margin-bottom: 1.5rem;
    line-height: 1.5;
}
.custom-alert-content button {
    background: linear-gradient(135deg, #0073aa, #00568e);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.2s ease;
}
.dark .custom-alert-content button {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}
.custom-alert-content button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,115,170,0.3);
}
.dark .custom-alert-content button:hover {
    box-shadow: 0 4px 10px rgba(59,130,246,0.3);
}

/* Movie Reordering Modal Styles */
.reorder-modal-content {
    max-width: 600px;
}
.reorder-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.reorder-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-tertiary);
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 8px;
    color: var(--text-primary);
    cursor: grab; /* Indicate draggable */
    transition: background-color 0.2s ease;
}
.reorder-list-item:last-child {
    margin-bottom: 0;
}
.reorder-list-item.dragging {
    opacity: 0.5;
    border: 2px dashed var(--border-accent);
    background-color: var(--bg-interactive);
}
.reorder-item-title {
    font-weight: 600;
}
.reorder-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

/* --- ADMIN STATS PAGE STYLES --- */
.admin-stats-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    box-shadow: 0 4px 12px var(--shadow-sm);
    border-top: 4px solid var(--border-accent);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-accent);
    margin-bottom: 8px;
}

.stat-label {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.admin-detailed-list h2 {
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-primary);
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.admin-detailed-list .movie-card {
    background: var(--bg-secondary);
    margin-bottom: 15px;
}

.admin-detailed-list .experience-header {
    background: var(--bg-tertiary);
}

.admin-detailed-list .session-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.session-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.session-stats {
    text-align: right;
}

.occupancy-result {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-top: 5px;
}

.occupancy-result .stats-occupied {
    color: var(--text-primary);
    font-size: 1.1rem;
}
.occupancy-result .stats-percentage {
    color: var(--text-accent);
    font-weight: 700;
}
.occupancy-result .stats-broken {
    color: #f59e0b;
    font-size: 0.8rem;
}
.occupancy-result .error-text {
    color: var(--notice-error-text);
}
.occupancy-result .loading-text {
    color: var(--text-secondary);
}

.admin-detailed-list .button-secondary {
    padding: 8px 12px;
    font-size: 13px;
}

/* --- ADMIN SCREEN SCHEDULE STYLES --- */
.admin-screen-schedule h2 {
    margin-bottom: 25px;
}

.screen-card {
    background: var(--bg-secondary);
    border-radius: 12px;
    margin-bottom: 25px;
    box-shadow: 0 4px 12px var(--shadow-sm);
    border: 1px solid var(--border-primary);
    overflow: hidden; /* Prevent shadows leaking */
}

.screen-header {
    background: var(--bg-tertiary);
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-primary);
}

.screen-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
}

.screen-content .sessions-list {
    padding-top: 0 !important; /* Adjust padding */
}

.screen-session-item {
    padding: 15px 20px; /* Add padding to session items */
    margin-bottom: 0; /* Remove margin */
    border-bottom: 1px solid var(--border-primary);
    align-items: flex-start; /* Align items top */
}
.screen-session-item:last-child {
    border-bottom: none;
}

.screen-session-info {
    flex-grow: 1; /* Allow info to take more space */
    margin-right: 15px; /* Space before stats */
}

.screen-session-info .time-range {
    font-weight: 600;
    font-size: 1.1em;
    color: var(--text-accent);
    display: block; /* Make time prominent */
    margin-bottom: 5px;
}
.screen-session-info .movie-name {
     font-weight: 500;
     display: block;
     margin-bottom: 8px;
}

.experience-type-list {
    font-size: 0.8em;
    color: var(--text-secondary);
}

.experience-tag {
    display: inline-block;
    background-color: var(--bg-interactive);
    color: var(--text-secondary);
    padding: 2px 6px;
    border-radius: 4px;
    margin-right: 5px;
    margin-bottom: 3px;
    font-weight: 500;
}

.no-sessions-text {
    padding: 20px;
    color: var(--text-secondary);
    font-style: italic;
}

/* --- ADMIN SUMMARY SECTION STYLES --- */
.admin-summary-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); /* Adjust minmax as needed */
    gap: 30px;
    margin-bottom: 40px;
    padding: 20px;
    background-color: var(--bg-secondary);
    border-radius: 12px;
    box-shadow: 0 4px 12px var(--shadow-sm);
}

.summary-column h2 {
    color: var(--text-accent);
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.3rem;
    border-bottom: 2px solid var(--border-primary);
    padding-bottom: 8px;
}

.summary-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 400px; /* Limit height if lists get very long */
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--bg-interactive) transparent;
}

.summary-list li {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-primary);
    font-size: 0.95rem;
}
.summary-list li:last-child {
    border-bottom: none;
}

.summary-label {
    color: var(--text-primary);
    font-weight: 500;
    margin-right: 10px;
    flex-shrink: 1; /* Prevent label from shrinking too much */
}

.summary-value {
    color: var(--text-secondary);
    font-weight: 600;
    text-align: right;
}

/* Adjustments for Screen Header */
.screen-header {
    display: flex; /* Enable flexbox */
    justify-content: space-between; /* Space title and utilization */
    align-items: center; /* Align items vertically */
    background: var(--bg-tertiary);
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-primary);
}
.screen-utilization {
    font-size: 0.9em;
    font-weight: 500;
    color: var(--text-secondary);
    flex-shrink: 0; /* Prevent shrinking */
    margin-left: 15px; /* Add space */
}

/* --- Screen Schedule Timeline (Consolidated) --- */
.admin-timeline-section {
    /* Uses .form-section styles (padding, background, etc) */
    margin-bottom: 20px;
    overflow-x: auto; /* Allow horizontal scroll on small screens */
}

.consolidated-timeline {
    width: 100%;
    min-width: 800px; /* Min width to keep layout reasonable */
    display: table; /* Use table layout for rigid column alignment */
    border-spacing: 0;
}

.timeline-header-row,
.timeline-screen-row {
    display: table-row;
    width: 100%;
}

.timeline-row-label {
    display: table-cell;
    vertical-align: middle;
    width: 120px; /* Fixed width for auditorium labels */
    padding-right: 15px;
    font-size: 0.9em;
    font-weight: 500;
    color: var(--text-color);
    white-space: nowrap;
}

.timeline-ticks-container,
.timeline-bar-track {
    display: table-cell;
    vertical-align: middle;
    position: relative;
    width: 100%; /* Take up remaining space */
}

.timeline-ticks-container {
    height: 30px;
    border: none;
    border-bottom: 1px solid var(--border-color);
}

.timeline-bar-track {
    height: 34px; /* Height of the track for bars */
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 4px; /* Space between rows */
}

/* --- Timeline Bars --- */
.timeline-bar {
    position: absolute;
    top: 0;
    height: 100%;
    display: flex;
    flex-direction: row;
    cursor: move;
    user-select: none;
    transition: all 0.2s ease-in-out;
    border-radius: 3px;
    border: 1px solid rgba(0,0,0,0.2);
    box-sizing: border-box;
}
.timeline-bar:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 10;
}
.timeline-bar.dragging {
    opacity: 0.5;
    z-index: 1000;
}
.timeline-placeholder {
    background: rgba(59, 130, 246, 0.3);
    border: 2px dashed #3b82f6;
    pointer-events: none;
    position: absolute;
    top: 0;
    height: 100%;
}

.timeline-bar-preroll {
    height: 100%;
    background-color: var(--preroll-color, #718096);
    opacity: 0.6;
    border-top-left-radius: 2px;
    border-bottom-left-radius: 2px;
}

.timeline-bar-movie {
    height: 100%;
    background-color: var(--accent-color, #00568e);
    display: flex;
    align-items: center;
    justify-content: flex-start;
    overflow: hidden;
    white-space: nowrap;
    border-top-right-radius: 2px;
    border-bottom-right-radius: 2px;
}

.timeline-bar-label {
    padding-left: 8px;
    font-size: 0.75em;
    font-weight: 500;
    color: white;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.4);
}

/* --- Timeline Ticks --- */
.timeline-tick {
    position: absolute;
    height: 100%;
    top: 0;
}

.timeline-tick::before {
    content: '';
    position: absolute;
    bottom: 0; /* Move line to bottom of header row */
    left: 0;
    width: 1px;
    height: 100%;
    background-color: var(--border-color);
}

.timeline-tick-label {
    position: absolute;
    bottom: 0; /* Align label to bottom of header row */
    left: 0;
    transform: translateX(-50%);
    font-size: 0.75em;
    color: var(--text-color-light);
    background: var(--bg-primary);
    padding: 0 2px;
}

.timeline-ticks-container .timeline-tick:first-child .timeline-tick-label {
    transform: translateX(0);
}
.timeline-ticks-container .timeline-tick:last-child .timeline-tick-label {
    transform: translateX(-100%);
}

/* --- RESPONSIVE IMPROVEMENTS --- */
@media (max-width: 1024px) {
    .wrap {
        padding: 15px;
    }
    .form-section {
        padding: 20px;
    }
    .movies-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 20px;
    }
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    .wrap {
        padding-top: 1rem;
    }
    .main-header h1 {
        font-size: 2em;
    }
    .form-section {
        padding: 20px;
        margin-bottom: 20px;
    }
    .form-controls {
        flex-direction: column;
        gap: 15px;
    }
    .form-group {
        min-width: 100%;
    }
    .button-primary,
    .button-secondary {
        width: 100%;
    }
    .theatre-header {
        padding: 20px;
    }
    .movie-card {
        padding: 20px;
    }
    .session-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .view-seats-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .main-header h1 {
        font-size: 1.6em;
    }
    .form-section h2 {
        font-size: 1.2em;
    }
    .movie-card-header {
        flex-wrap: wrap;
    }
    .movie-card-header .movie-runtime {
    }
}

/* Lazy Loading Styles */
.movie-card {
    opacity: 1;
    transition: opacity 0.3s ease;
}

.movie-card.lazy-loaded {
    opacity: 1;
}

/* Mobile Touch Improvements */
.touch-device button,
.touch-device .movie-card-header,
.touch-device .experience-header {
    min-height: 44px;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
}

.touch-device .view-seats-btn,
.touch-device .select-double-feature-btn {
    padding: 12px 20px;
    font-size: 16px; /* Prevent zoom on iOS */
}

@media (max-width: 768px) {
    .movie-card-header .movie-runtime {
        margin-left: 0;
        margin-right: 0;
        width: 100%;
        margin-top: 8px;
    }
}

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

/* --- FOCUS VISIBLE FOR ACCESSIBILITY --- */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 2px solid var(--border-interactive-focus);
    outline-offset: 2px;
}

/* --- LOADING STATES --- */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* --- NO RESULTS MESSAGE --- */
.no-results-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
    font-style: italic;
}

/* --- SIDEBAR DASHBOARD LAYOUT --- */
.app-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.sidebar {
    width: 250px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    box-shadow: var(--shadow-sm);
    z-index: 100;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-light);
}

.sidebar-header h1 {
    font-size: 1.5rem;
    margin: 0;
    color: var(--theme-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-header p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin: 5px 0 0 0;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    text-decoration: none;
    color: var(--text-primary);
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.sidebar-nav a:hover {
    background: var(--bg-tertiary);
    transform: translateX(3px);
}

.sidebar-nav a.active {
    background: var(--theme-primary);
    color: white;
    box-shadow: var(--shadow-sm);
}

.main-content {
    flex: 1;
    padding: 30px;
    background: var(--bg-primary);
    overflow-y: auto;
}