/* ============================================================
   TicketPayGo Seating — frontend
   ============================================================ */

.tpg-seat-map { width: 100%; }

.tpg-seat-map-loading,
.tpg-seat-map-error {
    padding: 16px;
    text-align: center;
    color: #64748b;
    font-size: 14px;
}
.tpg-seat-map-error { color: #dc2626; }

/* ---- Trigger inside the ticket modal ---- */
.tpgseatd-trigger-wrap {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 4px 0;
}

/* High specificity + !important so a theme's global button styles can't
   recolor this (some themes paint every <button> with their accent). */
.tpg-seat-map .tpgseatd-open-btn,
.tpg-seat-map button.tpgseatd-open-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin: 0;
    padding: 13px 18px;
    border: none !important;
    border-radius: 10px !important;
    background: #2563eb !important;
    background-image: none !important;
    color: #ffffff !important;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
    text-transform: none !important;
    letter-spacing: normal;
    box-shadow: none !important;
    cursor: pointer;
    transition: background .15s, transform .05s;
}
.tpg-seat-map .tpgseatd-open-btn:hover,
.tpg-seat-map button.tpgseatd-open-btn:hover {
    background: #1d4ed8 !important;
    color: #ffffff !important;
}
.tpg-seat-map .tpgseatd-open-btn:active { transform: translateY(1px); }

.tpgseatd-chosen {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.tpgseatd-chosen-empty { color: #94a3b8; font-size: 13px; }
.tpgseatd-chip {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 600;
}
.tpgseatd-trigger-timer { font-size: 12px; color: #b45309; font-weight: 600; }

/* ---- Full-screen modal ---- */
body.tpgseatd-modal-open { overflow: hidden; }

.tpgseatd-modal-overlay {
    position: fixed;
    inset: 0;
    /* Match the core ticket modal's max z-index; appended later in the DOM so it
       stacks on top of it. */
    z-index: 2147483647;
    background: rgba(15, 23, 42, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2vh 2vw;
    /* The overlay is appended to <body>, so it would inherit the theme's font
       (often a serif). Force the same system stack the core ticket modal uses so
       the seat modal matches the rest of the plugin. */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.tpgseatd-modal {
    display: flex;
    flex-direction: column;
    width: min(1200px, 96vw);
    height: min(920px, 96vh);
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .35);
}

.tpgseatd-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 22px;
    border-bottom: 1px solid #e5e9f0;
}
.tpgseatd-modal-title { margin: 0; font-size: 18px; font-weight: 700; color: #0f172a; }
.tpgseatd-modal-close {
    border: none;
    background: transparent;
    font-size: 28px;
    line-height: 1;
    color: #64748b;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 8px;
}
.tpgseatd-modal-close:hover { background: #f1f5f9; color: #0f172a; }

.tpgseatd-modal-body {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: #f4f6fb;
    padding: 14px 16px 8px;
}

.tpgseatd-stage {
    align-self: center;
    margin: 4px 0 10px;
    padding: 8px 60px;
    border-radius: 6px 6px 30px 30px / 6px 6px 60px 60px;
    background: #cbd5e1;
    color: #334155;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .14em;
}

.tpgseatd-canvas-wrap {
    flex: 1;
    min-height: 0;
    background: #eef2f7;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
}
.tpgseatd-fsvg {
    width: 100%;
    height: 100%;
    display: block;
    cursor: grab;
    touch-action: none;
}
.tpgseatd-fsvg.tpgseatd-grabbing { cursor: grabbing; }

/* Seats */
.tpgseatd-fsvg .tpgseatd-seat { cursor: pointer; }
.tpgseatd-fsvg .tpgseatd-seat rect {
    fill: #3b82f6;
    stroke: #2563eb;
    stroke-width: 1px;
    transition: filter .1s;
}
.tpgseatd-fsvg .tpgseatd-seat:hover rect { filter: brightness(1.08); }
.tpgseatd-fsvg .tpgseatd-state-sold,
.tpgseatd-fsvg .tpgseatd-state-held,
.tpgseatd-fsvg .tpgseatd-type-blocked { cursor: not-allowed; }
.tpgseatd-fsvg .tpgseatd-state-selected rect {
    stroke: #b45309 !important;
    stroke-width: 3px !important;
    filter: drop-shadow(0 0 3px rgba(245, 158, 11, .6));
}
.tpgseatd-fsvg .tpgseatd-label {
    font-size: 11px;
    font-weight: 600;
    fill: #fff;
    pointer-events: none;
    font-family: inherit;
    user-select: none;
}
.tpgseatd-fsvg .tpgseatd-section-label {
    font-size: 13px;
    font-weight: 700;
    text-anchor: middle;
    font-family: inherit;
    paint-order: stroke;
    stroke: #fff;
    stroke-width: 3px;
    stroke-linejoin: round;
    pointer-events: none;
}

/* Legend */
.tpgseatd-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px;
    padding: 10px 6px 4px;
}
.tpgseatd-legend-item { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: #475569; }
.tpgseatd-legend-dot { width: 13px; height: 12px; border-radius: 3px; display: inline-block; }

/* Message toast */
.tpgseatd-modal-body .tpgseatd-message {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 6px 16px rgba(0,0,0,.12);
}

/* Footer */
.tpgseatd-modal-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 22px;
    border-top: 1px solid #e5e9f0;
    background: #fff;
}
.tpgseatd-foot-info { display: flex; flex-direction: column; gap: 2px; }
.tpgseatd-foot-count { font-size: 14px; font-weight: 600; color: #0f172a; }
.tpgseatd-foot-breakdown { font-size: 12.5px; color: #475569; font-weight: 500; }
.tpgseatd-modal-foot .tpgseatd-timer { font-size: 12px; color: #b45309; font-weight: 600; }
.tpgseatd-foot-actions { display: flex; align-items: center; gap: 16px; }
.tpgseatd-foot-total { font-size: 18px; font-weight: 800; color: #0f172a; }
.tpgseatd-modal .tpgseatd-confirm {
    border: none !important;
    border-radius: 10px !important;
    background: #2563eb !important;
    background-image: none !important;
    color: #fff !important;
    padding: 12px 26px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    text-transform: none !important;
    box-shadow: none !important;
    cursor: pointer;
    transition: background .15s;
}
.tpgseatd-modal .tpgseatd-confirm:hover { background: #1d4ed8 !important; color: #fff !important; }
.tpgseatd-modal .tpgseatd-confirm:disabled { background: #cbd5e1 !important; cursor: not-allowed; }

.tpgseatd-modal .tpgseatd-modal-close {
    background: transparent !important;
    background-image: none !important;
    border: none !important;
    box-shadow: none !important;
    color: #64748b !important;
}
.tpgseatd-modal .tpgseatd-modal-close:hover { background: #f1f5f9 !important; color: #0f172a !important; }

@media (max-width: 640px) {
    .tpgseatd-modal { width: 100vw; height: 100vh; border-radius: 0; }
    .tpgseatd-modal-overlay { padding: 0; }
    .tpgseatd-modal-foot { flex-direction: column; align-items: stretch; gap: 10px; }
    .tpgseatd-foot-actions { justify-content: space-between; }
    .tpgseatd-confirm { flex: 1; }
}
