/* ============================================================
   PAX West Hallway Displays — Admin Panel Styles
   ============================================================ */

/* ── Reset & Base ── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: #f0f2f5;
    color: #1a1a2e;
    line-height: 1.5;
    min-height: 100vh;
}

h1, h2, h3 {
    margin-bottom: 0.75rem;
    font-weight: 600;
}

h1 { font-size: 1.6rem; }
h2 { font-size: 1.25rem; margin-top: 1.5rem; }
h3 { font-size: 1.1rem; }

a { color: #3a7bd5; text-decoration: none; }
a:hover { text-decoration: underline; }

small { font-size: 0.85em; color: #666; }

/* ── Sidebar ── */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 220px;
    height: 100vh;
    background: #1a1a2e;
    color: #fff;
    display: flex;
    flex-direction: column;
    z-index: 100;
    overflow-y: auto;
}

.sidebar-header {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.sidebar-header h2 {
    font-size: 1.1rem;
    margin-bottom: 0.15rem;
    color: #fff;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.sidebar-subtitle {
    font-size: 0.75rem;
    opacity: 0.65;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.event-switcher {
    position: relative;
    margin-top: 0.6rem;
}
.event-switcher__toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.4rem 0.6rem;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.event-switcher__toggle:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.3);
}
.event-switcher__toggle svg {
    flex-shrink: 0;
    margin-left: 0.4rem;
    opacity: 0.6;
    transition: transform 0.2s;
}
.event-switcher.is-open .event-switcher__toggle svg {
    transform: rotate(180deg);
}
.event-switcher__menu {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    list-style: none;
    background: #252547;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    padding: 0.25rem 0;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    z-index: 200;
}
.event-switcher.is-open .event-switcher__menu {
    display: block;
}
.event-switcher__item {
    display: block;
    padding: 0.4rem 0.75rem;
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.8rem;
    text-decoration: none;
    border-radius: 4px;
    margin: 0 0.25rem;
    transition: background 0.12s, color 0.12s;
}
.event-switcher__item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    text-decoration: none;
}
.event-switcher__item.is-active {
    color: #03ff00;
}

.sidebar-nav {
    list-style: none;
    padding: 0.5rem 0;
    flex: 1;
}

.sidebar-nav li { margin: 0; }

.nav-link {
    display: block;
    padding: 0.65rem 1.25rem;
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.95rem;
    transition: background 0.15s, color 0.15s;
    text-decoration: none;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    text-decoration: none;
}

.nav-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 0.5rem 1rem;
}

.nav-logout {
    color: rgba(255, 120, 120, 0.85);
}

.nav-logout:hover {
    background: rgba(255, 80, 80, 0.15);
    color: #ff6b6b;
}

/* ── Main Content ── */
.main-content {
    margin-left: 240px;
    padding: 2rem 2.5rem;
    min-height: 100vh;
}

/* ── Login Page ── */
.login-page {
    background: #1a1a2e;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 1rem;
}

.login-card {
    background: #fff;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

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

.login-header h1 {
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #666;
    margin-bottom: 0.25rem;
}

.login-header h2 {
    font-size: 1.4rem;
    margin-top: 0;
    color: #1a1a2e;
}

.login-hint {
    font-size: 0.9rem;
    color: #666;
    margin-top: 0.5rem;
}

.login-form .form-group {
    margin-bottom: 1.25rem;
}

.login-form label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.35rem;
    color: #333;
}

.login-form input[type="password"] {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
}

.login-form input[type="password"]:focus {
    outline: none;
    border-color: #3a7bd5;
    box-shadow: 0 0 0 2px rgba(58, 123, 213, 0.15);
}

/* ── Buttons ── */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    color: #333;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s;
    line-height: 1.4;
    vertical-align: middle;
}

.btn:hover {
    background: #f5f5f5;
    text-decoration: none;
}

.btn-primary {
    background: #3a7bd5;
    color: #fff;
    border-color: #3a7bd5;
}

.btn-primary:hover {
    background: #2e6bc4;
    border-color: #2e6bc4;
}

.btn-danger {
    background: #e74c3c;
    color: #fff;
    border-color: #e74c3c;
}

.btn-danger:hover {
    background: #c0392b;
    border-color: #c0392b;
}

.btn-outline {
    background: transparent;
    color: #3a7bd5;
    border-color: #3a7bd5;
}

.btn-outline:hover {
    background: rgba(58, 123, 213, 0.06);
}

.btn-small {
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
}

.btn-block {
    display: block;
    width: 100%;
    text-align: center;
}

/* ── Tables ── */
.table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    margin-bottom: 1.5rem;
}

.table th,
.table td {
    padding: 0.6rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
    font-size: 0.9rem;
}

.table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #555;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.table tbody tr:nth-child(even) {
    background: #fafbfc;
}

.table tbody tr:hover {
    background: #f0f4ff;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.text-center { text-align: center; }
.text-mono { font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace; font-size: 0.85em; }

/* ── Badges ── */
.badge {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 3px;
    background: #e9ecef;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-active {
    background: #d4edda;
    color: #155724;
}

.badge-inactive {
    background: #f8d7da;
    color: #721c24;
}

/* ── Alerts ── */
.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

/* ── Stats Row ── */
.stats-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.stat-card {
    background: #fff;
    border-radius: 6px;
    padding: 1.25rem 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    min-width: 160px;
}

.stat-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1a1a2e;
}

.stat-label {
    font-size: 0.8rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0.25rem;
}

/* ── Forms ── */
.form {
    background: #fff;
    border-radius: 6px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    margin-bottom: 1.5rem;
}

.form-fieldset {
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 1.25rem;
    margin-bottom: 1.25rem;
    background: #fff;
}

.form-fieldset legend {
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0 0.5rem;
    color: #333;
}

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

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.3rem;
    color: #333;
    font-size: 0.9rem;
}

.form-group label input[type="checkbox"] {
    margin-right: 0.4rem;
    vertical-align: middle;
}

.form-input {
    padding: 0.45rem 0.65rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.9rem;
    font-family: inherit;
    transition: border-color 0.15s;
}

.form-input:focus {
    outline: none;
    border-color: #3a7bd5;
    box-shadow: 0 0 0 2px rgba(58, 123, 213, 0.12);
}

.form-input-wide {
    width: 100%;
}

.form-input-narrow {
    width: 120px;
}

.form-input-tiny {
    width: 80px;
}

.form-input-table {
    width: 100%;
    min-width: 80px;
    padding: 0.3rem 0.5rem;
    font-size: 0.85rem;
}

.form-input-color {
    width: 50px;
    height: 36px;
    padding: 2px;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    vertical-align: middle;
}

.form-input-range {
    width: 100%;
    max-width: 300px;
}

.form-textarea {
    resize: vertical;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.85rem;
    line-height: 1.5;
}

.form-hint {
    display: block;
    font-size: 0.8rem;
    color: #888;
    margin-top: 0.2rem;
}

.form-row {
    display: flex;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.form-row .form-group {
    flex: 1;
    min-width: 140px;
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
}

.form-inline {
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
    flex-wrap: wrap;
}

.inline-form {
    display: inline-block;
    margin: 0;
}

.color-value {
    font-size: 0.8rem;
    color: #888;
    font-family: "SFMono-Regular", Consolas, monospace;
    margin-left: 0.35rem;
    vertical-align: middle;
}

/* ── Actions ── */
.table-actions {
    margin-bottom: 1rem;
}

.actions-cell {
    white-space: nowrap;
}

.actions-cell .btn,
.actions-cell .inline-form {
    margin-right: 0.25rem;
}

/* ── Upload ── */
.upload-result {
    margin-top: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    font-size: 0.9rem;
}

.upload-result:empty {
    display: none;
}

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

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

/* ── Empty State ── */
.empty-state {
    padding: 2rem;
    text-align: center;
    color: #888;
    font-size: 0.95rem;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

/* ── Responsive ── */
@media (max-width: 900px) {
    .sidebar {
        width: 180px;
    }

    .main-content {
        margin-left: 200px;
        padding: 1.5rem 1rem;
    }
}

@media (max-width: 700px) {
    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
        flex-direction: row;
        flex-wrap: wrap;
    }

    .sidebar-header {
        width: 100%;
        padding: 0.75rem 1rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .sidebar-nav {
        display: flex;
        flex-wrap: wrap;
        padding: 0;
        width: 100%;
    }

    .sidebar-nav li {
        flex: none;
    }

    .nav-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }

    .nav-divider {
        display: none;
    }

    .main-content {
        margin-left: 0;
        padding: 1rem;
    }

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

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

/* ── Uploaded Asset Gallery ── */
.bg-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, 192px);
    gap: 1rem;
    margin-top: 1rem;
}
.bg-card {
    width: 192px;
    height: 108px;
    background: #000;
    background-image: linear-gradient(45deg, #111 25%, transparent 25%),
                      linear-gradient(-45deg, #111 25%, transparent 25%),
                      linear-gradient(45deg, transparent 75%, #111 75%),
                      linear-gradient(-45deg, transparent 75%, #111 75%);
    background-size: 10px 10px;
    background-position: 0 0, 0 5px, 5px 5px, 5px 0;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    border: 1px solid #e9ecef;
}
.bg-thumb {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.bg-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    opacity: 0;
    transition: opacity 0.2s;
    color: #fff;
    pointer-events: none;
}
.bg-card:hover .bg-overlay {
    opacity: 1;
    pointer-events: auto;
}
.bg-name {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    background: rgba(0,0,0,0.7);
    color: #fff;
    padding: 2px 6px;
    font-size: 0.7rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    z-index: 5;
    pointer-events: none;
}
.bg-actions {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    width: 100%;
}
.bg-replace,
.bg-delete,
.bg-preview {
    width: 100%;
    cursor: pointer;
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    text-transform: uppercase;
    font-weight: 600;
    text-align: center;
}
.bg-preview {
    color: #fff;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.35);
}
.bg-preview:hover { background: #2ecc71; border-color: #2ecc71; }
.bg-replace {
    color: #fff;
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.4);
}
.bg-replace:hover { background: #3a7bd5; border-color: #3a7bd5; }
.bg-delete {
    color: #ff8a8a;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,138,138,0.4);
}
.bg-delete:hover { background: #e74c3c; color: #fff; border-color: #e74c3c; }
.upload-zone {
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    background: #fcfcfc;
    transition: border-color 0.2s, background 0.2s;
    cursor: pointer;
    margin-bottom: 1rem;
}
.upload-zone:hover, .upload-zone.drag-over {
    border-color: #3a7bd5;
    background: #f0f7ff;
}
.upload-zone p { color: #666; margin-bottom: 0.5rem; }
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e9ecef;
}
