/* ============================================================
   SmartTrip Frontend Styles
   RTL Arabic – used across all 4 booking pages
   ============================================================ */

/* ── Reset & base ─────────────────────────────────────────── */
.st-wrap {
    direction: rtl;
    text-align: right;
    font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
    color: #1a1a1a;
    max-width: 900px;
    margin: 0 auto;
    padding: 20px 16px;
}

/* ── Colours ──────────────────────────────────────────────── */
:root {
    --st-red: #f59f0a;
    --st-navy: #0F667A;
    --st-light:  #f1faee;
    --st-border: #dde3ea;
    --st-radius: 8px;
}

/* ── Cards ────────────────────────────────────────────────── */
.st-card {
    background: #fff;
    border: 1px solid var(--st-border);
    border-radius: var(--st-radius);
    padding: 28px 24px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.st-card h2 {
    margin: 0 0 20px;
    font-size: 20px;
    color: var(--st-navy);
    border-bottom: 2px solid var(--st-red);
    padding-bottom: 10px;
}

/* ── Form elements ────────────────────────────────────────── */
.st-form-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    align-items: flex-end;
}

.st-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    min-width: 160px;
}

.st-form-group label {
    font-size: 13px;
    font-weight: 600;
    color: #555;
}

.st-form-group select,
.st-form-group input[type="date"],
.st-form-group input[type="text"],
.st-form-group input[type="tel"] {
    padding: 10px 14px;
    border: 1px solid var(--st-border);
    border-radius: 6px;
    font-size: 15px;
    background: #fff;
    color: #1a1a1a;
    direction: rtl;
    width: 100%;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.st-form-group select:focus,
.st-form-group input:focus {
    outline: none;
    border-color: var(--st-red);
    box-shadow: 0 0 0 3px rgba(230,57,70,0.12);
}

/* ── Buttons ──────────────────────────────────────────────── */
.st-btn {
    display: inline-block;
    padding: 11px 28px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: background 0.2s, transform 0.1s;
    text-decoration: none;
}

.st-btn:active { transform: scale(0.98); }

.st-btn-primary {
    background: var(--st-red);
    color: #fff;
}
.st-btn-primary:hover { background: #c1121f; color: #fff; }

.st-btn-secondary {
    background: var(--st-navy);
    color: #fff;
}
.st-btn-secondary:hover { background: #14253f; color: #fff; }

.st-btn-outline {
    background: #fff;
    color: var(--st-navy);
    border: 2px solid var(--st-navy);
}
.st-btn-outline:hover { background: var(--st-light); }

.st-btn:disabled,
.st-btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ── Notices ──────────────────────────────────────────────── */
.st-notice {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 14px;
}
.st-notice-error   { background: #fdecea; border: 1px solid #f5c2c7; color: #842029; }
.st-notice-success { background: #d1e7dd; border: 1px solid #badbcc; color: #0f5132; }
.st-notice-info    { background: #cff4fc; border: 1px solid #b6effb; color: #055160; }

/* ── Loading spinner ──────────────────────────────────────── */
.st-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid rgba(230,57,70,0.2);
    border-top-color: var(--st-red);
    border-radius: 50%;
    animation: st-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-left: 8px;
}
@keyframes st-spin { to { transform: rotate(360deg); } }

/* ── Trip result cards ────────────────────────────────────── */
.st-trip-card {
    background: #fff;
    border: 1px solid var(--st-border);
    border-radius: var(--st-radius);
    margin-bottom: 16px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.st-trip-header {
    background: var(--st-navy);
    color: #fff;
    padding: 12px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.st-trip-header .st-time { font-size: 22px; font-weight: 700; }
.st-trip-header .st-route { font-size: 13px; opacity: 0.85; }

.st-vehicle-options {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0;
    border-top: 1px solid var(--st-border);
}

.st-vehicle-option {
    padding: 14px 16px;
    border-left: 1px solid var(--st-border);
    cursor: pointer;
    transition: background 0.15s;
    text-align: center;
}

.st-vehicle-option:last-child { border-left: none; }
.st-vehicle-option:hover { background: var(--st-light); }

.st-vehicle-option.st-soldout {
    opacity: 0.45;
    cursor: not-allowed;
    background: #f8f8f8;
}

.st-vehicle-option.st-selected {
    background: var(--st-light);
    border-bottom: 3px solid var(--st-red);
}

.st-vehicle-name  { font-size: 13px; font-weight: 600; color: var(--st-navy); }
.st-vehicle-price { font-size: 18px; font-weight: 700; color: var(--st-red); margin: 4px 0; }
.st-vehicle-avail { font-size: 11px; color: #777; }
.st-vehicle-avail.st-low { color: #d97706; font-weight: 600; }

/* ── Seat map ─────────────────────────────────────────────── */
.st-seat-map-wrap { overflow-x: auto; }

.st-seat-map {
    display: inline-flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
    background: #f8f9fa;
    border-radius: var(--st-radius);
    border: 1px solid var(--st-border);
}

.st-seat-row {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.st-seat {
    width: 44px;
    height: 44px;
    border-radius: 6px;
    border: 2px solid var(--st-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
    background: #fff;
    color: var(--st-navy);
}

.st-seat:hover          { border-color: var(--st-red); background: var(--st-light); }
.st-seat.st-available   { border-color: #22c55e; background: #dcfce7; color: #166534; }
.st-seat.st-taken       { border-color: #ef4444; background: #fee2e2; color: #991b1b; cursor: not-allowed; }
.st-seat.st-selected    { border-color: var(--st-navy); background: var(--st-navy); color: #fff; }
.st-seat.st-driver      { background: #e5e7eb; color: #6b7280; cursor: default; border-style: dashed; }

.st-seat-legend {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 12px;
    font-size: 12px;
}

.st-seat-legend span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.st-legend-dot {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    display: inline-block;
}

/* ── OTP login panel ──────────────────────────────────────── */
.st-otp-panel {
    background: var(--st-light);
    border: 1px solid var(--st-border);
    border-radius: var(--st-radius);
    padding: 24px;
    margin-bottom: 20px;
    text-align: center;
}

.st-otp-panel h3 { margin: 0 0 8px; color: var(--st-navy); }
.st-otp-panel p  { margin: 0 0 16px; color: #555; font-size: 14px; }

.st-otp-input {
    letter-spacing: 6px;
    font-size: 24px;
    text-align: center;
    width: 180px !important;
}

/* ── Booking summary box ──────────────────────────────────── */
.st-summary {
    background: var(--st-light);
    border: 1px solid var(--st-border);
    border-radius: var(--st-radius);
    padding: 16px 20px;
    margin-bottom: 20px;
}

.st-summary table { width: 100%; border-collapse: collapse; }
.st-summary td { padding: 5px 0; font-size: 14px; }
.st-summary td:first-child { color: #666; width: 40%; }
.st-summary td:last-child  { font-weight: 600; color: var(--st-navy); }
.st-summary .st-total td   { font-size: 16px; color: var(--st-red); border-top: 1px solid var(--st-border); padding-top: 10px; }

/* ── Step progress bar ────────────────────────────────────── */
.st-steps {
    display: flex;
    justify-content: center;
    gap: 0;
    margin-bottom: 28px;
    overflow: hidden;
    border-radius: 6px;
    border: 1px solid var(--st-border);
}

.st-step {
    flex: 1;
    padding: 10px 8px;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    background: #f8f8f8;
    color: #999;
    border-left: 1px solid var(--st-border);
    position: relative;
}

.st-step:last-child { border-left: none; }
.st-step.st-step-active { background: var(--st-navy); color: #fff; }
.st-step.st-step-done   { background: var(--st-light); color: var(--st-navy); }

/* ── Responsive ───────────────────────────────────────────── */
@media ( max-width: 600px ) {
    .st-form-row { flex-direction: column; }
    .st-vehicle-options { grid-template-columns: 1fr 1fr; }
    .st-trip-header { flex-direction: column; align-items: flex-start; gap: 4px; }
}

/* ============================================================
   SmartTrip v1.3.0 — Additional Styles
   New: Login page, My Bookings, Swap button, Skeleton loaders,
   Aisle gap, Empty states, WhatsApp button, Booking cards
   ============================================================ */

/* ── Font upgrade (Tajawal Arabic) ─────────────────────────── */
.st-wrap, .st-wrap * {
    font-family: 'Tajawal', 'Segoe UI', Tahoma, Arial, sans-serif;
}

/* ── WhatsApp share button ──────────────────────────────────── */
.st-btn-whatsapp {
    background: #25d366;
    color: #fff;
}
.st-btn-whatsapp:hover { background: #1da851; color: #fff; }

/* ── Search: Swap button ────────────────────────────────────── */
.st-swap-col {
    display: flex;
    align-items: flex-end;
    padding-bottom: 2px;
    flex: 0 0 auto;
}

.st-swap-btn {
    background: #fff;
    border: 2px solid var(--st-border);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--st-navy);
    transition: all 0.2s;
    flex-shrink: 0;
}

.st-swap-btn:hover {
    border-color: var(--st-red);
    color: var(--st-red);
    background: var(--st-light);
}

.st-swap-btn.st-swap-spin {
    animation: st-swap-rotate 0.3s ease-in-out;
}

@keyframes st-swap-rotate {
    from { transform: rotate(0deg); }
    to   { transform: rotate(180deg); }
}

/* ── Skeleton loaders ───────────────────────────────────────── */
.st-skeleton-card {
    background: #f8f9fa;
    border: 1px solid var(--st-border);
    border-radius: var(--st-radius);
    padding: 20px;
    margin-bottom: 12px;
    animation: st-skeleton-pulse 1.4s ease-in-out infinite;
}

.st-skeleton-line {
    background: #e2e8f0;
    border-radius: 4px;
    height: 14px;
    margin-bottom: 10px;
}

.st-skeleton-wide   { width: 70%; }
.st-skeleton-med    { width: 50%; }
.st-skeleton-narrow { width: 35%; margin-bottom: 0; }

@keyframes st-skeleton-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.55; }
}

/* ── Results: header ─────────────────────────────────────────── */
.st-results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.st-results-header h2 {
    margin: 0;
    border: none;
    padding: 0;
    font-size: 18px;
}

.st-results-date {
    font-size: 13px;
    color: #777;
    background: var(--st-light);
    padding: 4px 10px;
    border-radius: 12px;
    border: 1px solid var(--st-border);
}

/* ── Results: sold-out label ────────────────────────────────── */
.st-soldout-label {
    color: #ef4444;
    font-weight: 700;
}

/* ── Empty state ────────────────────────────────────────────── */
.st-empty-state {
    text-align: center;
    padding: 48px 24px;
    color: #6b7280;
}

.st-empty-state .st-empty-icon {
    font-size: 52px;
    margin-bottom: 12px;
}

.st-empty-state h3 {
    font-size: 18px;
    color: var(--st-navy);
    margin: 0 0 8px;
}

.st-empty-state p {
    font-size: 14px;
    margin: 0 0 20px;
}

/* ── Seat map: aisle gap ────────────────────────────────────── */
.st-aisle {
    width: 20px;
    flex-shrink: 0;
}

/* Dot colours */
.st-legend-available { background: #dcfce7; border: 2px solid #22c55e; }
.st-legend-taken     { background: #fee2e2; border: 2px solid #ef4444; }
.st-legend-selected  { background: var(--st-navy); border: 2px solid var(--st-navy); }

/* ── Booking page: price display ────────────────────────────── */
.st-price-display {
    font-size: 18px;
    font-weight: 700;
    color: var(--st-navy);
    margin-bottom: 20px;
    padding: 12px 16px;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 6px;
    min-height: 20px;
}

/* ── OTP panel icon ─────────────────────────────────────────── */
.st-otp-panel__icon {
    font-size: 40px;
    margin-bottom: 8px;
}

/* ── Login page ─────────────────────────────────────────────── */
.st-login-page {
    max-width: 480px;
    margin: 0 auto;
}

.st-login-header {
    text-align: center;
    margin-bottom: 32px;
}

.st-login-title {
    font-size: 26px;
    color: var(--st-navy);
    font-weight: 700;
    margin: 0 0 8px;
}

.st-login-subtitle {
    color: #666;
    font-size: 15px;
    margin: 0;
}

.st-login-form-wrap {
    background: #fff;
    border: 1px solid var(--st-border);
    border-radius: 12px;
    padding: 32px 28px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.st-login-back {
    text-align: center;
    margin-top: 16px;
    font-size: 14px;
}

.st-login-back a {
    color: var(--st-navy);
    text-decoration: none;
}

.st-login-back a:hover { text-decoration: underline; }

/* Login prompt card (on /my-bookings when not logged in) */
.st-login-prompt-card {
    text-align: center;
    padding: 48px 24px;
}

.st-login-prompt-card .st-login-prompt__icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.st-login-prompt-card h3 {
    color: var(--st-navy);
    font-size: 20px;
    margin: 0 0 10px;
}

.st-login-prompt-card p {
    color: #666;
    margin: 0 0 20px;
}

/* ── My Bookings: booking cards ─────────────────────────────── */
.st-section-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--st-navy);
    margin: 0 0 12px;
    padding-bottom: 6px;
    border-bottom: 2px solid var(--st-border);
}

.st-booking-card {
    background: #fff;
    border: 1px solid var(--st-border);
    border-radius: var(--st-radius);
    margin-bottom: 14px;
    overflow: hidden;
    transition: box-shadow 0.15s;
}

.st-booking-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.st-booking-card__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 18px;
    background: var(--st-light);
    border-bottom: 1px solid var(--st-border);
}

.st-booking-number {
    font-weight: 700;
    color: var(--st-navy);
    letter-spacing: 0.5px;
    font-size: 14px;
}

.st-booking-card__body {
    padding: 14px 18px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 24px;
}

.st-booking-meta-item {
    font-size: 13px;
    color: #555;
    min-width: 180px;
}

.st-meta-label {
    color: #999;
    font-size: 11px;
    display: block;
    margin-bottom: 1px;
}

/* Status badges */
.st-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
}

.st-badge-confirmed { background: #d1fae5; color: #065f46; }
.st-badge-pending   { background: #fef3c7; color: #92400e; }
.st-badge-cancelled { background: #fee2e2; color: #991b1b; }
.st-badge-completed { background: #e0e7ff; color: #3730a3; }

/* Pay Now block — shows when booking is pending with active payment URL */
.st-pay-now-block {
    margin: 0 18px 14px;
    padding: 14px 16px;
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.st-countdown-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.st-countdown-label {
    color: #92400e;
    font-weight: 500;
}

.st-countdown {
    font-size: 20px;
    font-weight: 700;
    color: var(--st-navy);
    font-variant-numeric: tabular-nums;
    direction: ltr;
    display: inline-block;
    min-width: 48px;
    text-align: center;
}

.st-pay-now-btn {
    font-size: 14px;
    padding: 9px 20px;
    white-space: nowrap;
    text-decoration: none;
}

/* Cancel button inside card */
.st-booking-card .st-cancel-btn {
    margin: 0 18px 14px;
    padding: 7px 16px;
}

/* ── Admin-managed settings notice ─────────────────────────── */
.st-permissions-note {
    color: #777;
    font-size: 13px;
    margin-top: 8px;
}

/* ── Responsive additions ────────────────────────────────────── */
@media (max-width: 600px) {
    .st-swap-col {
        align-items: center;
        justify-content: center;
        width: 100%;
        padding: 4px 0;
    }

    .st-search-row {
        gap: 10px;
    }

    .st-booking-card__body {
        flex-direction: column;
        gap: 6px;
    }

    .st-booking-meta-item {
        min-width: unset;
    }

    .st-login-form-wrap {
        padding: 20px 16px;
    }

    .st-results-header {
        flex-direction: column;
        align-items: flex-start;
    }
}
