/* ==========================================
   L'amour Seat Booking — Frontend Styles
   Multi-seat sidebar + Zoom/Pan + Success Modal
   ========================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/icon?family=Material+Icons');

.material-icons { font-size: inherit; vertical-align: middle; line-height: 1; }

.lsb-app {
    font-family: 'Inter', -apple-system, sans-serif;
    max-width: 100%;
    margin: 0 auto;
    color: #1E293B;
    overflow-x: hidden;
}
.lsb-loading {
    text-align: center;
    padding: 60px 20px;
    color: #64748B;
}
.lsb-spinner {
    width: 40px; height: 40px;
    border: 4px solid #E2E8F0;
    border-top: 4px solid #EF4444;
    border-radius: 50%;
    animation: lsb-spin 0.8s linear infinite;
    margin: 0 auto 16px;
}
@keyframes lsb-spin { to { transform: rotate(360deg); } }

/* ---- Layout ---- */
.lsb-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 20px;
    align-items: start;
}
.lsb-map-col {
    min-width: 0;
    overflow: hidden;
    position: relative;
}

/* ---- Stage ---- */
.lsb-stage {
    background:
        radial-gradient(ellipse at 20% 50%, rgba(0,0,0,0.3) 0%, transparent 70%),
        radial-gradient(ellipse at 80% 30%, rgba(0,0,0,0.25) 0%, transparent 60%),
        radial-gradient(ellipse at 50% 80%, rgba(139,0,0,0.4) 0%, transparent 50%),
        linear-gradient(135deg, #8B0000 0%, #B91C1C 30%, #991B1B 50%, #7F1D1D 80%, #450a0a 100%);
    color: #fff;
    text-align: center;
    padding: 16px;
    border-radius: 12px 12px 0 0;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    position: sticky;
    top: 0;
    z-index: 100;
    overflow: hidden;
}
.lsb-stage::after {
    content: '';
    position: absolute;
    bottom: 0; left: 50%;
    transform: translateX(-50%);
    width: 60%; height: 3px;
    background: linear-gradient(90deg, transparent, #EF4444, #F59E0B, #10B981, transparent);
    border-radius: 2px;
}

/* Stage bar inside grid */
.lsb-stage-bar {
    background:
        radial-gradient(ellipse at 30% 50%, rgba(0,0,0,0.3) 0%, transparent 70%),
        radial-gradient(ellipse at 70% 40%, rgba(0,0,0,0.2) 0%, transparent 60%),
        linear-gradient(135deg, #8B0000 0%, #B91C1C 30%, #991B1B 60%, #7F1D1D 100%);
    color: #fff;
    text-align: center;
    padding: 10px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    border-radius: 8px;
    margin-bottom: 8px;
}

/* ---- Legend ---- */
.lsb-legend {
    display: flex; flex-wrap: wrap; gap: 12px;
    padding: 14px 16px;
    background: #F8FAFC;
    margin-bottom: 0;
    justify-content: flex-start;
    border: 1px solid #E2E8F0;
    border-top: none;
}
.lsb-legend-item {
    display: flex; align-items: center; gap: 6px;
    font-size: 12px; font-weight: 500; color: #475569;
}
.lsb-legend-dot {
    width: 14px; height: 14px; border-radius: 3px;
    display: inline-block; flex-shrink: 0;
    border: 1px solid rgba(0,0,0,0.1);
}

/* ---- Zoom Toolbar ---- */
.lsb-zoom-toolbar {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 8px;
    background: #F1F5F9;
    border: 1px solid #E2E8F0;
    border-top: none;
}
.lsb-zoom-btn {
    width: 36px; height: 36px;
    border: 1px solid #CBD5E1;
    background: #fff;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.15s;
    color: #475569;
}
.lsb-zoom-btn:hover { background: #E2E8F0; border-color: #94A3B8; }
.lsb-zoom-btn:active { transform: scale(0.95); }

/* ---- Seat Grid ---- */
.lsb-grid-wrapper {
    background: linear-gradient(180deg, #F1F5F9 0%, #E2E8F0 100%);
    border-radius: 0 0 12px 12px;
    padding: 12px;
    border: 1px solid #CBD5E1;
    border-top: none;
    overflow: hidden;
    cursor: grab;
    position: relative;
    max-width: 100%;
    min-height: 500px;
}
.lsb-app:fullscreen {
    background: #1E293B;
    overflow: auto;
}
.lsb-app:fullscreen .lsb-grid-wrapper {
    background: transparent;
    border: none;
    min-height: calc(100vh - 100px);
}
.lsb-app:fullscreen .lsb-sidebar {
    background: rgba(30,41,59,0.95);
    border-color: #475569;
}
.lsb-grid-inner {
    transform-origin: top left;
    transition: transform 0.1s ease-out;
}
.lsb-seat-grid {
    display: grid; gap: 4px;
    justify-content: center;
    min-width: fit-content;
    margin: 0 auto;
}

/* ---- Seat ---- */
.lsb-seat {
    width: 20px; height: 20px;
    border-radius: 4px 4px 2px 2px;
    display: flex; align-items: center; justify-content: center;
    font-size: 6px; font-weight: 700; color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid rgba(255,255,255,0.2);
    user-select: none;
    overflow: hidden;
}
.lsb-seat:hover:not(.is-reserved):not(.is-disabled) {
    transform: translateY(-2px) scale(1.08);
    box-shadow: 0 6px 16px rgba(0,0,0,0.25);
    z-index: 2; border-color: #fff;
}
.lsb-seat.is-selected {
    background: #1E293B !important;
    color: #fff !important;
    border: 2px solid #EF4444;
    transform: scale(1.05);
    box-shadow: 0 0 4px rgba(239,68,68,0.5);
    z-index: 3;
}
.lsb-seat.is-reserved {
    background: #94A3B8 !important;
    cursor: not-allowed; opacity: 0.5;
    border-color: transparent; box-shadow: none;
}
.lsb-seat.is-disabled { visibility: hidden; }
.lsb-row-label {
    width: 20px; height: 20px;
    display: flex; align-items: center; justify-content: center;
    font-size: 8px; font-weight: 700; color: #64748B;
}

/* ========== SIDEBAR ========== */
.lsb-sidebar {
    position: sticky;
    top: 0;
    align-self: start;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.lsb-sidebar-card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #E2E8F0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    overflow: hidden;
}
.lsb-sidebar-title {
    margin: 0;
    padding: 12px 16px;
    font-size: 15px;
    font-weight: 700;
    color: #1E293B;
    border-bottom: 1px solid #F1F5F9;
    background: #F8FAFC;
    flex-shrink: 0;
}
.lsb-sidebar-empty {
    padding: 20px;
    text-align: center;
    color: #94A3B8;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
}
.lsb-sidebar-empty p { margin: 0 0 6px; font-size: 14px; }
.lsb-sidebar-hint { font-size: 12px !important; color: #CBD5E1; }

.lsb-selected-list {
    flex: 0 0 auto;
    height: 200px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #CBD5E1 transparent;
}
.lsb-selected-list::-webkit-scrollbar { width: 4px; }
.lsb-selected-list::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 4px; }
.lsb-selected-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-bottom: 1px solid #F1F5F9;
    transition: background 0.15s;
}
@keyframes lsb-fadeInItem {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}
.lsb-selected-item:hover { background: #F8FAFC; }
.lsb-selected-badge {
    width: 36px; height: 36px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 12px; color: #fff; flex-shrink: 0;
}
.lsb-selected-info { flex: 1; min-width: 0; }
.lsb-selected-label { display: block; font-weight: 600; font-size: 14px; color: #1E293B; }
.lsb-selected-type { display: block; font-size: 11px; color: #94A3B8; }
.lsb-selected-price { font-weight: 700; font-size: 14px; color: #EF4444; white-space: nowrap; }
.lsb-selected-remove {
    width: 16px; height: 16px;
    min-width: 16px; min-height: 16px;
    border: none;
    background: #EF4444;
    color: #fff;
    border-radius: 50%;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: all 0.15s;
    flex-shrink: 0;
    padding: 0;
    margin: 0;
    overflow: hidden;
}
.lsb-selected-remove .material-icons { font-size: 10px; line-height: 1; display: block; }
.lsb-selected-remove:hover { background: #DC2626; transform: scale(1.15); }

.lsb-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #fff;
    border: 1px solid #E2E8F0;
    font-size: 14px; font-weight: 600; color: #1E293B;
    flex-shrink: 0;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}
.lsb-total-price { font-size: 18px; font-weight: 700; color: #EF4444; }

/* Customer form */
.lsb-customer-form {
    padding: 12px 14px 14px;
    flex-shrink: 0;
}
.lsb-form-group { margin-bottom: 8px; }
.lsb-form-group label { display: block; font-size: 11px; font-weight: 600; color: #475569; margin-bottom: 2px; }
.lsb-form-group input {
    width: 100%; padding: 8px 10px;
    border: 1.5px solid #E2E8F0; border-radius: 8px;
    font-size: 13px; font-family: 'Inter', sans-serif;
    transition: border-color 0.2s; outline: none; box-sizing: border-box;
}
.lsb-form-group input:focus { border-color: #EF4444; box-shadow: 0 0 0 3px rgba(239,68,68,0.1); }
.lsb-form-group input::placeholder { color: #CBD5E1; }

.lsb-btn {
    padding: 14px 24px; border: none; border-radius: 12px;
    font-size: 15px; font-weight: 600; cursor: pointer;
    transition: all 0.2s; font-family: 'Inter', sans-serif;
}
.lsb-btn-primary {
    background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(239,68,68,0.4);
}
.lsb-btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(239,68,68,0.5); }
.lsb-btn-primary:disabled, .lsb-btn-disabled {
    background: linear-gradient(135deg, #94A3B8 0%, #64748B 100%);
    opacity: 0.5; cursor: not-allowed; transform: none;
    box-shadow: none;
    pointer-events: none;
}
.lsb-btn-full { width: 100%; display: block; text-align: center; margin-top: 4px; }

/* ========== SUCCESS MODAL ========== */
.lsb-success-overlay {
    position: fixed; inset: 0;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(8px);
    z-index: 100001;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
    animation: lsb-fadeIn 0.3s ease;
}
@keyframes lsb-fadeIn { from { opacity: 0; } to { opacity: 1; } }
.lsb-success-modal {
    background: #fff;
    border-radius: 24px;
    padding: 36px 32px;
    width: 100%; max-width: 440px;
    text-align: center;
    box-shadow: 0 25px 60px rgba(0,0,0,0.3);
    animation: lsb-popIn 0.35s ease;
}
@keyframes lsb-popIn {
    from { transform: scale(0.85); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
.lsb-success-icon { font-size: 48px; margin-bottom: 12px; }
.lsb-success-modal h3 { margin: 0 0 8px; font-size: 22px; font-weight: 700; color: #1E293B; }
.lsb-success-msg { color: #64748B; font-size: 15px; margin: 0 0 16px; }
.lsb-success-warning {
    background: #FEF3C7;
    border: 1px solid #FDE68A;
    color: #92400E;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    margin-bottom: 20px;
}
.lsb-bank-section {
    margin-bottom: 20px;
    text-align: center;
}
.lsb-bank-section h4 {
    font-size: 15px;
    font-weight: 700;
    color: #1E293B;
    margin: 0 0 12px;
}
.lsb-qr-img {
    max-width: 260px;
    width: 100%;
    border-radius: 12px;
    border: 2px solid #E2E8F0;
}

/* ---- Toast ---- */
.lsb-toast {
    position: fixed; top: 20px; right: 20px;
    padding: 16px 24px; border-radius: 12px;
    font-size: 14px; font-weight: 500;
    z-index: 100002;
    animation: lsb-slideIn 0.3s ease;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    font-family: 'Inter', sans-serif;
    max-width: 380px;
}
@keyframes lsb-slideIn {
    from { transform: translateX(100px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
.lsb-toast-success { background: #10B981; color: #fff; }
.lsb-toast-error { background: #EF4444; color: #fff; }

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .lsb-layout {
        grid-template-columns: 1fr;
        gap: 0;
    }
    .lsb-sidebar {
        position: relative;
        bottom: auto; left: auto; right: auto;
        top: auto;
        z-index: 10;
        gap: 6px;
        padding: 6px;
        background: #E2E8F0;
        border-radius: 12px;
        box-shadow: 0 -2px 12px rgba(0,0,0,0.08);
        overflow-y: visible;
        max-height: none;
    }
    .lsb-sidebar-card {
        border-radius: 8px;
        border: none;
        box-shadow: none;
    }
    .lsb-sidebar-title {
        padding: 8px 12px;
        font-size: 13px;
    }
    /* Selected seats: compact wrap grid, no price */
    .lsb-selected-list {
        height: auto;
        max-height: none;
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        padding: 8px 12px;
        overflow: visible;
    }
    .lsb-selected-item {
        padding: 0;
        border: none;
        gap: 0;
        position: relative;
        flex: none;
    }
    .lsb-selected-item:hover { background: transparent; }
    .lsb-selected-badge {
        width: 44px; height: 32px;
        font-size: 11px;
        border-radius: 6px;
    }
    .lsb-selected-price { display: none; }
    .lsb-selected-remove {
        position: absolute;
        top: -4px; right: -4px;
        width: 14px; height: 14px;
        min-width: 14px; min-height: 14px;
    }
    .lsb-selected-remove .material-icons { font-size: 8px; }
    .lsb-sidebar-empty {
        height: auto;
        padding: 10px;
    }
    .lsb-sidebar-empty p { font-size: 12px; }
    /* Total */
    .lsb-total {
        padding: 8px 12px;
        font-size: 12px;
        border-radius: 8px;
        border: none;
        box-shadow: none;
    }
    .lsb-total-price { font-size: 16px; }
    /* Form */
    .lsb-customer-form {
        padding: 8px 12px 10px;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 5px 8px;
    }
    .lsb-form-group { margin-bottom: 0; }
    .lsb-form-group label { font-size: 10px; }
    .lsb-form-group input { padding: 7px 8px; font-size: 12px; border-radius: 6px; }
    .lsb-btn { padding: 10px 16px; font-size: 13px; border-radius: 8px; grid-column: 1 / -1; }
    /* Map */
    .lsb-map-col { padding-bottom: 10px; }
    .lsb-seat { width: 22px; height: 22px; font-size: 6px; border-radius: 4px 4px 2px 2px; }
    .lsb-row-label { width: 22px; height: 22px; font-size: 8px; }
    .lsb-seat-grid { gap: 3px; }
    .lsb-grid-wrapper { padding: 8px 4px; }
    .lsb-stage {
        padding: 10px;
        font-size: 14px;
        letter-spacing: 1px;
        position: sticky;
        top: 0;
        z-index: 100;
        border-radius: 0;
    }
    .lsb-stage-bar { padding: 6px; font-size: 10px; letter-spacing: 1px; }
    /* Legend: 3 per row, scroll if overflow */
    .lsb-legend {
        padding: 6px 8px;
        gap: 3px 6px;
        font-size: 10px;
        display: grid;
        grid-template-columns: repeat(3, max-content);
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .lsb-legend-item {
        font-size: 10px; gap: 4px;
        white-space: nowrap;
    }
    .lsb-legend-dot { width: 10px; height: 10px; flex-shrink: 0; }
    /* Zoom: floating bar — inside map area */
    .lsb-zoom-toolbar {
        position: absolute;
        top: 120px;
        bottom: auto;
        right: 4px;
        transform: none;
        z-index: 100;
        gap: 2px;
        padding: 0;
        background: none;
        border: none;
        box-shadow: none;
        flex-direction: column;
        align-items: center;
    }
    .lsb-zoom-btn {
        width: 20px; height: 20px;
        min-width: 20px; min-height: 20px;
        padding: 0;
        background: #fff;
        border: 1px solid #CBD5E1;
        box-shadow: 0 1px 3px rgba(0,0,0,0.15);
        border-radius: 4px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .lsb-zoom-btn .material-icons { font-size: 12px; line-height: 1; color: #334155; }
    .lsb-zoom-btn:hover { background: #F1F5F9; }
}
