/* ═══════════════════════════════════════════════════════════════════════════
   EMV Booking Modal — modal-style.css (v5.0)
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── Modal Overlay ──────────────────────────────────────────────────────── */
#emv-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.75);
    z-index: 99999;
    overflow-y: auto;
    backdrop-filter: blur(4px);
    animation: emvFadeIn 0.2s ease;
}
#emv-modal-overlay.active { display: flex; align-items: flex-start; justify-content: center; padding: 2rem 1rem; }

@keyframes emvFadeIn { from { opacity:0; } to { opacity:1; } }
@keyframes emvSlideUp { from { transform: translateY(40px); opacity:0; } to { transform: translateY(0); opacity:1; } }

/* ─── Modal Box ──────────────────────────────────────────────────────────── */
#emv-modal-box {
    background: #1a1a2e;
    border-radius: 12px;
    width: 100%;
    max-width: 860px;
    position: relative;
    box-shadow: 0 25px 80px rgba(0,0,0,0.6);
    animation: emvSlideUp 0.3s ease;
    overflow: hidden;
}

/* ─── Header ─────────────────────────────────────────────────────────────── */
#emv-modal-header {
    background: linear-gradient(135deg, #e63946 0%, #c1121f 100%);
    padding: 1.5rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
#emv-modal-header h2 { color: #fff; margin: 0; font-size: 1.25rem; font-weight: 700; letter-spacing: 0.04em; }
#emv-modal-header .emv-modal-subtitle { color: rgba(255,255,255,0.8); font-size: 0.85rem; margin: 0.2rem 0 0; }

#emv-modal-close {
    background: rgba(255,255,255,0.2);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #fff;
    font-size: 1.2rem;
    flex-shrink: 0;
    transition: background 0.2s;
}
#emv-modal-close:hover { background: rgba(255,255,255,0.35); }

/* ─── Progress Bar ───────────────────────────────────────────────────────── */
.emv-modal-progress { display: flex; background: #111827; overflow: hidden; }
.emv-modal-progress-step {
    flex: 1;
    text-align: center;
    padding: 0.75rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(255,255,255,0.35);
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.emv-modal-progress-step.active { color: #e63946; border-bottom-color: #e63946; }
.emv-modal-progress-step.done   { color: rgba(255,255,255,0.6); border-bottom-color: rgba(255,255,255,0.2); }

/* ─── Body ───────────────────────────────────────────────────────────────── */
#emv-modal-body { padding: 2rem; max-height: 75vh; overflow-y: auto; }
#emv-modal-body::-webkit-scrollbar { width: 6px; }
#emv-modal-body::-webkit-scrollbar-track { background: #111; }
#emv-modal-body::-webkit-scrollbar-thumb { background: #e63946; border-radius: 3px; }

/* ─── Step Panels ────────────────────────────────────────────────────────── */
.emv-modal-step-panel { display: none; }
.emv-modal-step-panel.active { display: block; animation: emvFadeIn 0.25s ease; }

.emv-modal-step-title {
    color: #fff; font-size: 1rem; font-weight: 700; margin: 0 0 1.5rem;
    padding-bottom: 0.75rem; border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex; align-items: center; gap: 0.75rem;
}
.emv-modal-step-badge {
    background: #e63946; color: #fff; width: 28px; height: 28px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 0.8rem; font-weight: 800; flex-shrink: 0;
}

/* ─── Form cards inside modal (dark theme) ──────────────────────────────── */
#emv-modal-body .emv-step-card {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1.25rem;
}
#emv-modal-body .emv-step-card:last-child { margin-bottom: 0; }
#emv-modal-body .emv-step-header { margin-bottom: 1rem; display: flex; align-items: center; gap: 0.75rem; }
#emv-modal-body .emv-step-header h3 { color: #fff; margin: 0; font-size: 0.95rem; }
#emv-modal-body .emv-step-num {
    background: #e63946; color: #fff; width: 28px; height: 28px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 0.8rem; flex-shrink: 0;
}
#emv-modal-body .emv-step-num.emv-step-optional { background: rgba(255,255,255,0.15); }

#emv-modal-body .emv-form-row { display: flex; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
#emv-modal-body .emv-form-row:last-child { margin-bottom: 0; }
#emv-modal-body .emv-form-row-3 > .emv-form-group { flex: 1 1 30%; }
#emv-modal-body .emv-form-group { flex: 1 1 45%; display: flex; flex-direction: column; gap: 0.4rem; }
#emv-modal-body .emv-form-group label { color: rgba(255,255,255,0.7); font-size: 0.8rem; font-weight: 600; }
#emv-modal-body .emv-form-group label small { color: rgba(255,255,255,0.4); font-weight: 400; }
#emv-modal-body .emv-form-group .req { color: #e63946; }
#emv-modal-body .emv-form-group input,
#emv-modal-body .emv-form-group select {
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.12);
    color: #fff;
    padding: 0.6rem 0.75rem;
    border-radius: 6px;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
}
#emv-modal-body .emv-form-group input:focus,
#emv-modal-body .emv-form-group select:focus { border-color: #e63946; }
#emv-modal-body .emv-form-group input::placeholder { color: rgba(255,255,255,0.3); }
#emv-modal-body .emv-form-group select option { background: #1a1a2e; color: #fff; }

/* Collapsible Passenger 2 */
.emv-collapsible-trigger { cursor: pointer; justify-content: space-between; }
.emv-collapsible-trigger .emv-optional-tag {
    font-size: 0.65rem; background: rgba(255,255,255,0.1); color: rgba(255,255,255,0.5);
    padding: 0.15rem 0.5rem; border-radius: 4px; margin-left: 0.5rem; text-transform: uppercase; font-weight: 600;
}
.emv-collapsible-trigger .emv-chevron { color: rgba(255,255,255,0.4); margin-left: auto; transition: transform 0.2s; }
.emv-collapsible-trigger .emv-chevron.rotated { transform: rotate(180deg); }

/* ─── Tour Summary bar ───────────────────────────────────────────────────── */
.emv-modal-tour-summary {
    background: rgba(230,57,70,0.15);
    border: 1px solid rgba(230,57,70,0.3);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}
.emv-modal-tour-summary .emv-mts-name { color: #fff; font-weight: 700; font-size: 1rem; flex: 1; }
.emv-modal-tour-summary .emv-mts-detail { color: rgba(255,255,255,0.6); font-size: 0.85rem; }

/* ─── Nav Buttons ────────────────────────────────────────────────────────── */
.emv-modal-nav {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    padding: 1.5rem 2rem; background: #111827; border-top: 1px solid rgba(255,255,255,0.08);
}
.emv-modal-nav-back {
    background: transparent; border: 1px solid rgba(255,255,255,0.2); color: rgba(255,255,255,0.6);
    padding: 0.7rem 1.5rem; border-radius: 6px; cursor: pointer; font-size: 0.9rem; font-weight: 600; transition: all 0.2s;
}
.emv-modal-nav-back:hover { border-color: rgba(255,255,255,0.5); color: #fff; }
.emv-modal-nav-next {
    background: #e63946; border: none; color: #fff; padding: 0.7rem 2rem; border-radius: 6px; cursor: pointer;
    font-size: 0.9rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; transition: background 0.2s;
    display: flex; align-items: center; gap: 0.5rem;
}
.emv-modal-nav-next:hover:not(:disabled) { background: #c1121f; }
.emv-modal-nav-next:disabled { background: #555; cursor: not-allowed; opacity: 0.7; }

/* ─── Order Summary (Step 3) ─────────────────────────────────────────────── */
.emv-order-summary { background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.1); border-radius: 8px; overflow: hidden; }
.emv-order-summary-row {
    display: flex; justify-content: space-between; align-items: center; padding: 0.75rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.06); color: rgba(255,255,255,0.7); font-size: 0.9rem;
}
.emv-order-summary-row:last-child { border-bottom: none; }
.emv-order-summary-row strong { color: #fff; }
.emv-order-summary-total {
    background: rgba(230,57,70,0.15); padding: 1rem 1.25rem; display: flex; justify-content: space-between;
    align-items: center; font-weight: 700; color: #fff; font-size: 1.1rem;
}
.emv-order-summary-total .emv-price-big { font-size: 1.6rem; color: #e63946; font-weight: 800; }

/* ─── Payment redirect step ──────────────────────────────────────────────── */
.emv-payment-redirect-wrap { text-align: center; padding: 3rem 2rem; color: #fff; }
.emv-payment-redirect-wrap p { font-size: 1.1rem; margin-bottom: 1.5rem; color: rgba(255,255,255,0.8); }
.emv-payment-secure-note {
    margin-top: 1.5rem; font-size: 0.8rem; color: rgba(255,255,255,0.4);
    display: flex; align-items: center; justify-content: center; gap: 0.4rem;
}

/* ─── Spinner ────────────────────────────────────────────────────────────── */
.emv-spinner {
    width: 36px; height: 36px; border: 3px solid rgba(230,57,70,0.2); border-top-color: #e63946;
    border-radius: 50%; animation: emvSpin 0.8s linear infinite; margin: 0 auto;
}
@keyframes emvSpin { to { transform: rotate(360deg); } }

/* ─── Confirmation page ──────────────────────────────────────────────────── */
.emv-confirm-wrapper { max-width: 600px; margin: 4rem auto; padding: 1rem; text-align: center; }
.emv-confirm-success, .emv-confirm-error {
    background: #1a1a2e; border-radius: 12px; padding: 3rem 2rem; box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}
.emv-confirm-icon {
    width: 72px; height: 72px; border-radius: 50%; background: #2ecc71; color: #fff; font-size: 2.2rem;
    display: flex; align-items: center; justify-content: center; margin: 0 auto 1.5rem;
}
.emv-icon-error { background: #e63946; }
.emv-icon-warn  { background: #f39c12; }
.emv-confirm-success h2, .emv-confirm-error h2 { color: #fff; font-size: 1.75rem; margin-bottom: 0.75rem; }
.emv-confirm-success p, .emv-confirm-error p { color: rgba(255,255,255,0.7); margin-bottom: 1rem; }
.emv-confirm-details { background: rgba(255,255,255,0.05); border-radius: 8px; margin: 1.5rem 0; overflow: hidden; }
.emv-confirm-row { display: flex; justify-content: space-between; padding: 0.75rem 1.25rem; border-bottom: 1px solid rgba(255,255,255,0.06); font-size: 0.9rem; }
.emv-confirm-row span { color: rgba(255,255,255,0.5); }
.emv-confirm-row strong { color: #fff; }

/* ─── Admin status badges ────────────────────────────────────────────────── */
.emv-status-paid    { color: #2ecc71; font-weight: 700; }
.emv-status-pending { color: #f39c12; font-weight: 700; }
.emv-status-failed  { color: #e63946; font-weight: 700; }

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
    #emv-modal-body { padding: 1.25rem; }
    .emv-modal-nav  { padding: 1rem 1.25rem; }
    .emv-modal-progress-step { font-size: 0.65rem; }
    #emv-modal-body .emv-form-row,
    #emv-modal-body .emv-form-row-3 { flex-direction: column; }
    #emv-modal-body .emv-form-row-3 > .emv-form-group,
    #emv-modal-body .emv-form-group { flex: 1 1 100%; }
}
