/**
 * Event tabs, archived events, sidebar, and responsive nav.
 *
 * Split from public/css/cashier.css (2,091 lines). Cascade order matters:
 * load these in the numbered order, exactly as the original file was ordered.
 */

/* ===== EVENT TABS STYLES ===== */
.event-tabs {
    display: flex;
    border-bottom: 1px solid #dee2e6;
    background: white;
    margin-bottom: 5px;
}

.event-tab {
    flex: 1;
    padding: 10px 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    color: #6c757d;
    border-bottom: 2px solid transparent;
    font-size: 1.1em;
}

.event-tab.active {
    color: #007bff;
    border-bottom-color: #007bff;
    background: #f8f9fa;
}

.event-tab:hover:not(.active) {
    background: #e9ecef;
    color: #495057;
}

.event-menu[data-tab-content] {
    display: none;
}

.event-menu[data-tab-content].active {
    display: block;
}

.archived-event {
    opacity: 0.7;
}

.archived-event .event-name {
    color: #6c757d;
}

.archived-event .event-time {
    color: #adb5bd;
    font-style: italic;
}

/* ===== ARCHIVED EVENT STYLES ===== */
.archived-notice {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    color: #6c757d;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
    border: 1px solid #dee2e6;
}

.archived-seating {
    opacity: 0.8;
    pointer-events: none;
}


/* ===== CANCELLED EVENT STYLES =====
   Red, where archived is grey, and for the opposite reason: an archived showing is
   finished and out of the way, a cancelled one is the thing still needing work. The
   notice has to be readable across the room from the desk. */
.cancelled-notice {
    background: linear-gradient(135deg, #fdecea, #f9d6d2);
    color: #8f2419;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
    border: 1px solid #e9a49b;
}

.event-cancelled-badge {
    display: inline-block;
    margin-right: 6px;
    padding: 1px 6px;
    border-radius: 10px;
    background: #c0392b;
    color: white;
    font-size: 0.7em;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    vertical-align: middle;
}

.event-item.cancelled-event .event-name {
    color: #8f2419;
}

.event-item.cancelled-event.active .event-cancelled-badge {
    background: rgba(255, 255, 255, 0.9);
    color: #8f2419;
}

/* The reinstate button sits at the right-hand end of the edit window's header, where
   the heading alone used to be. */
.modal-header-with-action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.modal-header-with-action .reinstate-btn {
    background: #c0392b;
    color: white;
    border: none;
    flex: 0 0 auto;
    width: auto;
}

.modal-header-with-action .reinstate-btn:hover {
    background: #a93226;
}

/* Paired with `hidden` on the element would be redundant; the codebase toggles this
   class elsewhere (.crud-nav.is-hidden) and consistency beats a second mechanism. */
.reinstate-btn.is-hidden {
    display: none;
}

/* The cancel modal's supporting lines. `modal-note` is the quieter one, `modal-warning`
   the line an operator must not skim - reinstating does not un-refund anybody. */
.modal-body .modal-note {
    font-size: 0.92em;
    color: #6c757d;
}

.modal-body .modal-warning {
    color: #8f2419;
    font-weight: 600;
}


/* ===== WORKSPACE & RAIL =====
   The same two-column arrangement the Productions screen uses (.workspace there), and
   the panels are the house panel: white, 15px, the softer 0 5px 15px shadow. */
.workspace {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 20px;
    align-items: start;
}

.sidebar {
    background: var(--bg-white);
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    position: sticky;
    top: 20px;
}

/* The per-page icon row that used to sit here is gone; navigation is the shared
   admin.partials.nav-dropdown, which carries its own styles. */

.crud-nav {
    padding: 15px 20px;
    border-bottom: 1px solid #dee2e6;
    background: white;
    display: flex;
    gap: 8px;
    justify-content: center;
}

.crud-nav.is-hidden {
    display: none;
}

.crud-btn {
    display: inline-block;
    padding: 6px 12px;
    text-decoration: none;
    color: white;
    background: #e9ecef;
    border: none;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 0.85em;
    cursor: pointer;
    flex: 1;
    max-width: 70px;
}

.crud-btn:hover:not(:disabled) {
    background: #007bff;
    color: white;
    border-color: #007bff;
    transform: translateY(-1px);
}

.crud-btn:disabled {
    background: #f8f9fa;
    color: #6c757d;
    cursor: not-allowed;
    border-color: #dee2e6;
}

/* Admin panel button colors */
#new-event-btn {
    background: var(--success-color);
}

#edit-event-btn {
    background: #f39c12;
}

#delete-event-btn {
    background: var(--error-color);
}

.main-content {
    background: var(--bg-white);
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

/* A section label inside the rail, not a second page header. The gradient bar that used
   to sit above it held the greeting and the logout button; both are in the page header
   now, where every other admin screen keeps them. */
.sidebar-header {
    background: var(--bg-light);
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 5px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.sidebar-header h3 {
    margin: 0;
    font-size: 0.75em;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* Leaves the whole rail inside the viewport, so the sticky position has somewhere to
   stick to. Same allowance the Productions rail makes. */
.event-menu {
    max-height: calc(100vh - 220px);
    overflow-y: auto;
}

.event-item {
    padding: 5px 15px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

.event-item:hover {
    background: #f8f9fa;
}

.event-item.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.event-item.active .event-name {
    color: white;
}

.event-item.active .event-details {
    color: rgba(255, 255, 255, 0.8);
}

.event-name {
    font-weight: 600;
    font-size: 1.1em;
    margin-bottom: 5px;
    color: #2c3e50;
}

.event-details {
    font-size: 0.9em;
    color: var(--text-secondary);
}

.event-time {
    margin-top: 2px;
}

.no-events {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-secondary);
}

.no-events p {
    margin: 0;
    font-style: italic;
}

/* ===== MOBILE RESPONSIVE STYLES ===== */
@media (max-width: 1024px) {
    .container {
        padding: 10px;
    }

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

    /* Nothing left to stick to once the rail is a full-width block above the seat map. */
    .sidebar {
        position: static;
    }

    .event-menu {
        max-height: 200px;
    }

    .header {
        flex-wrap: wrap;
        gap: 15px;
    }

    .header-right {
        min-width: 0;
    }
}
