/**
 * assets/css/public.css – CSS för publik onlinebokning
 * ID: PUBLIC_CSS
 *
 * Design: mörk header, varm accentfärg, tydlig kontrast.
 * Tillgänglig: fokusmarkeringar, kontrastförhållanden, mönster på platser.
 */

/* === TYPOGRAFI & GRUNDLÄGGANDE === */
body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: #fafafa;
    color: #1a1a2e;
}

/* === HERO HEADER === */
.hero-header {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: white;
    padding: 2.5rem 0;
    margin-bottom: 2rem;
    border-bottom: 4px solid #e94560;
}

.hero-header h1 {
    color: #fff;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.hero-header .lead {
    color: rgba(255,255,255,0.8);
}

/* === EVENEMANGSKORT === */
.event-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    transition: box-shadow 0.2s;
}

.event-card:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
}

.event-card .card-title {
    color: #1a1a2e;
    font-weight: 700;
}

.show-item {
    border: 1px solid #e9ecef;
    transition: background 0.15s;
}

.show-item:hover {
    background: #e9ecef !important;
}

/* === BOKNINGSSIDA: SALONGSVYN === */
.booking-seatmap {
    overflow-x: auto;
    padding: 1rem;
}

.seatmap-container {
    display: inline-block;
    min-width: fit-content;
}

.seatmap-grid {
    display: inline-grid;
    gap: 5px;
    padding: 1rem;
    background: #f0f0f0;
    border-radius: 12px;
}

/* Platsceller – tillgängliga (färg + mönster för färgblinda) */
.seat-cell {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.15s ease;
    position: relative;
    user-select: none;
}

/* Fokus: tydlig markering för tangentbordsnavigering */
.seat-cell:focus-visible {
    outline: 3px solid #0d6efd;
    outline-offset: 3px;
    z-index: 1;
}

/* Ledig: grön bakgrund + solid kantlinje */
.seat-available {
    background: #c8e6c9;
    border-color: #2e7d32;
    color: #1b5e20;
}
.seat-available:hover {
    background: #2e7d32;
    color: white;
    transform: scale(1.15);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* Vald: blå med bock */
.seat-selected {
    background: #1565c0;
    border-color: #0d47a1;
    color: white;
    transform: scale(1.15);
    box-shadow: 0 2px 8px rgba(21,101,192,0.4);
}
.seat-selected::after {
    content: '✓';
    position: absolute;
    font-size: 0.9rem;
    font-weight: 900;
}

/* Reserverad: randig (för färgblinda) */
.seat-reserved {
    background: repeating-linear-gradient(
        45deg,
        #fff3cd,
        #fff3cd 3px,
        #ffc107 3px,
        #ffc107 6px
    );
    border-color: #f57f17;
    color: #795548;
    cursor: not-allowed;
}

/* Såld: korsad (synligt mönster) */
.seat-sold {
    background: #ef9a9a;
    border-color: #c62828;
    color: #b71c1c;
    cursor: not-allowed;
}
.seat-sold::before {
    content: '×';
    font-size: 1.2rem;
    font-weight: 900;
    line-height: 1;
}

/* Blockerad: prickad kant */
.seat-blocked {
    background: #bdbdbd;
    border: 2px dashed #616161;
    color: #424242;
    cursor: not-allowed;
}

/* Tom (gång) */
.seat-empty {
    background: transparent;
    border: none;
    cursor: default;
}

/* Scen */
.stage-bar {
    background: #1a1a2e;
    color: #e94560;
    text-align: center;
    padding: 0.6rem 2rem;
    border-radius: 0 0 12px 12px;
    font-weight: 800;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

/* Legend */
.seat-legend {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1rem;
    padding: 0.5rem 0;
}
.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
}
.legend-swatch {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    border: 2px solid;
    flex-shrink: 0;
}

/* === BOKNINGSSAMMANFATTNING === */
.booking-summary {
    background: #fff;
    border: 2px solid #1a1a2e;
    border-radius: 12px;
    padding: 1.5rem;
    position: sticky;
    top: 1rem;
}

.booking-summary h4 {
    color: #1a1a2e;
    font-weight: 700;
    border-bottom: 2px solid #e94560;
    padding-bottom: 0.5rem;
}

/* === RESERVATIONSTIMER === */
.reservation-timer {
    background: #e8f5e9;
    border: 2px solid #2e7d32;
    border-radius: 8px;
    padding: 0.75rem;
    text-align: center;
    font-weight: 600;
}
.reservation-timer.warning {
    background: #fff3cd;
    border-color: #f57f17;
    animation: pulse 1s infinite;
}
.reservation-timer.expired {
    background: #ffebee;
    border-color: #c62828;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* === BETALNINGSKNAPP === */
.btn-pay {
    background: #e94560;
    border-color: #e94560;
    color: white;
    font-weight: 700;
    font-size: 1.1rem;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    transition: all 0.2s;
}
.btn-pay:hover {
    background: #c73550;
    border-color: #c73550;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(233,69,96,0.3);
}

/* === BILJETT-SIDA (ticket.php) === */
.ticket-display {
    max-width: 500px;
    margin: 2rem auto;
    background: white;
    border: 3px solid #1a1a2e;
    border-radius: 16px;
    overflow: hidden;
}

.ticket-header {
    background: #1a1a2e;
    color: white;
    padding: 1.5rem;
    text-align: center;
}

.ticket-body {
    padding: 1.5rem;
}

.ticket-qr {
    text-align: center;
    padding: 1rem;
    border-top: 2px dashed #dee2e6;
}

.ticket-receipt {
    padding: 0 1.5rem 1rem;
    border-top: 1px solid #dee2e6;
}

.ticket-footer {
    background: #f0f0f0;
    border-top: 1px solid #dee2e6;
    padding: 0.6rem 1.5rem;
    font-size: 0.7rem;
    color: #555;
}

.ticket-qr canvas,
.ticket-qr img {
    max-width: 200px;
    margin: 0 auto;
}

/* === PRINT === */
@media print {
    .hero-header, footer, .no-print { display: none !important; }
    .booking-summary { position: static !important; }
    .ticket-display { border: 2px solid #000 !important; max-width: 100% !important; }
}

/* === RESPONSIVT === */
@media (max-width: 768px) {
    .seat-cell {
        width: 30px;
        height: 30px;
        font-size: 0.6rem;
        border-radius: 5px;
    }
    .seatmap-grid {
        gap: 3px;
    }
    .hero-header {
        padding: 1.5rem 0;
    }
    .hero-header h1 {
        font-size: 1.8rem;
    }
}
