/* JSG Theater Seating - Main Stylesheet */

:root {
    --primary-color: #8B0000;
    --primary-light: #A52A2A;
    --secondary-color: #FFD700;
    --bg-color: #f5f5f5;
    --card-bg: #ffffff;
    --text-color: #333333;
    --text-light: #666666;
    --border-color: #dddddd;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #17a2b8;
}

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

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

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

/* Header */
.main-header {
    background: var(--primary-color);
    color: white;
    padding: 15px 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 50;
}

.logo {
    text-decoration: none;
    display: flex;
    align-items: center;
}

.logo img {
    height: 40px;
    width: auto;
}

.admin-nav {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 4px;
    flex-wrap: nowrap;
}

.admin-nav > a {
    color: white;
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 4px;
    transition: background 0.3s;
    white-space: nowrap;
}

.admin-nav > a:hover {
    background: rgba(255,255,255,0.1);
}

/* Dropdown menus */
.nav-dropdown {
    position: relative;
    display: inline-block;
}

.nav-dropdown-trigger {
    display: inline-block;
    color: white;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s;
    user-select: none;
    white-space: nowrap;
}

.nav-dropdown-trigger:hover,
.nav-dropdown:hover .nav-dropdown-trigger {
    background: rgba(255,255,255,0.15);
}

.nav-dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--primary-color);
    min-width: 170px;
    border-radius: 0 0 6px 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 1000;
    padding: 4px 0;
}

.nav-dropdown:hover .nav-dropdown-content,
.nav-dropdown:focus-within .nav-dropdown-content,
.nav-dropdown.is-open .nav-dropdown-content {
    display: block;
}

.nav-dropdown-content a {
    display: block;
    color: white;
    text-decoration: none;
    padding: 8px 18px;
    transition: background 0.2s;
    white-space: nowrap;
}

.nav-dropdown-content a:hover {
    background: rgba(255,255,255,0.15);
}

/* Footer */
.main-footer {
    background: var(--primary-color);
    color: white;
    padding: 20px 0;
    margin-top: 40px;
}
.main-footer .container {
    display: flex;
    align-items: center;
}
.main-footer p {
    margin: 0;
    flex: 1;
    text-align: center;
}
.main-footer .footer-credit {
    font-size: 0.8rem;
    opacity: 0.85;
    white-space: nowrap;
}
.main-footer .footer-credit a {
    color: white;
    text-decoration: none;
}
.main-footer .footer-credit a:hover {
    text-decoration: underline;
}
@media (max-width: 600px) {
    .main-footer .container {
        flex-direction: column;
        text-align: center;
        gap: 5px;
    }
}

/* Flash Messages */
.flash-messages {
    margin: 20px 0;
}

.flash {
    padding: 12px 20px;
    border-radius: 4px;
    margin-bottom: 10px;
}

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

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

.flash-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 20px;
    margin-bottom: 20px;
}

.card-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
    margin-bottom: 15px;
}

.card-title {
    font-size: 1.25rem;
    color: var(--primary-color);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    font-size: 1rem;
    transition: all 0.3s;
}

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

.btn-primary:hover {
    background: var(--primary-light);
}

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

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

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

.btn-small {
    padding: 5px 10px;
    font-size: 0.875rem;
}

/* Forms */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

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

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

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.table th,
.table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    background: var(--bg-color);
    font-weight: 600;
}

.table tr:hover {
    background: #f8f9fa;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.stat-label {
    color: var(--text-light);
    margin-top: 5px;
}

/* Pagination */
.pagination {
    display: flex;
    gap: 5px;
    justify-content: center;
    margin-top: 20px;
}

.pagination a,
.pagination span {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    text-decoration: none;
    color: var(--text-color);
}

.pagination a:hover {
    background: var(--bg-color);
}

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

/* Filter Bar */
.filter-bar {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-bar .form-control {
    width: auto;
    min-width: 200px;
}

/* Seating Chart Styles */
.seating-chart-container {
    overflow-x: auto;
    padding: 20px 0;
}

.drama-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.drama-tab {
    padding: 10px 20px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    color: var(--text-color);
}

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

.seating-chart {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: max-content;
}

.seat-row {
    display: flex;
    align-items: center;
    gap: 3px;
}

.row-label {
    width: 30px;
    font-weight: bold;
    text-align: center;
    color: var(--text-light);
}

.seat {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    cursor: pointer;
    transition: transform 0.2s;
}

.seat:hover {
    transform: scale(1.2);
    z-index: 10;
}

.seat-available {
    background: #e9ecef;
    border: 1px solid #ced4da;
}

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

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

.seat-fixed {
    background: #6f42c1;
    color: white;
}

.fixed-row {
    background: rgba(111, 66, 193, 0.05);
    padding: 2px 5px;
    border-radius: 4px;
}

.row-separator {
    text-align: center;
    padding: 10px;
    margin: 15px 0;
    border-top: 2px dashed #6f42c1;
    border-bottom: 2px dashed var(--success-color);
    color: var(--text-light);
    font-size: 0.85rem;
}

.seat-staircase {
    background: transparent;
    border: 1px dashed #ccc;
    cursor: default;
}

.section-gap {
    width: 20px;
}

/* Seat Legend */
.seat-legend {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
}

/* Stage indicator */
.stage-indicator {
    text-align: center;
    padding: 15px;
    background: linear-gradient(to bottom, var(--primary-color), var(--primary-light));
    color: white;
    font-weight: bold;
    margin-bottom: 20px;
    border-radius: 4px;
}

/* Ticket View Styles */
.ticket-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

.ticket-header {
    text-align: center;
    padding: 30px 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    border-radius: 8px 8px 0 0;
}

.ticket-header h1 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.member-code {
    font-size: 2rem;
    font-weight: bold;
    color: var(--secondary-color);
}

.member-name {
    font-size: 1.1rem;
    opacity: 0.9;
}

.ticket-body {
    background: white;
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 8px 8px;
    padding: 20px;
}

.drama-list {
    list-style: none;
}

.drama-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
}

.drama-item:last-child {
    border-bottom: none;
}

.drama-info h3 {
    font-size: 1rem;
    margin-bottom: 5px;
}

.drama-date {
    font-size: 0.875rem;
    color: var(--text-light);
}

.seat-badge {
    padding: 8px 16px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 1.1rem;
}

.seat-badge.assigned {
    background: var(--success-color);
    color: white;
}

.seat-badge.blocked {
    background: var(--danger-color);
    color: white;
}

.seat-badge.pending {
    background: var(--warning-color);
    color: #333;
}

.qr-section {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px dashed var(--border-color);
}

.qr-section img {
    max-width: 150px;
}

.ticket-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

/* Login Page */
.login-container {
    max-width: 400px;
    margin: 100px auto;
}

.login-card {
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.login-card h1 {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 30px;
}

/* Responsive */
@media (max-width: 768px) {
    .main-header .container {
        flex-direction: column;
        gap: 15px;
    }

    .admin-nav {
        flex-wrap: wrap;
        justify-content: center;
    }

    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-bar .form-control {
        width: 100%;
    }

    .seat {
        width: 20px;
        height: 20px;
        font-size: 8px;
    }
}
