/**
 * Frontend Styles — Taxi Booking Manager
 *
 * @package Taxi_Booking_Manager
 */

/* ==========================================================
 * CSS VARIABLES
 * ========================================================== */
:root {
    --tbm-primary: #6c5ce7;
    --tbm-primary-dark: #5145cd;
    --tbm-accent: #16a34a;
    --tbm-danger: #dc2626;
    --tbm-text: #0f172a;
    --tbm-text-soft: #475569;
    --tbm-text-muted: #64748b;
    --tbm-text-light: #94a3b8;
    --tbm-bg: #ffffff;
    --tbm-bg-soft: #f8fafc;
    --tbm-border: #e2e8f0;
    --tbm-border-soft: #f0f0f1;
    --tbm-radius: 12px;
    --tbm-radius-sm: 8px;
    --tbm-radius-lg: 16px;
    --tbm-shadow: 0 4px 12px -4px rgba(16,24,40,.1);
    --tbm-shadow-lg: 0 18px 36px -20px rgba(16,24,40,.32);
    --tbm-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ==========================================================
 * RESET
 * ========================================================== */
.tbm-booking-form,
.tbm-vehicles-grid,
.tbm-booking-shortcode,
.tbm-modal-overlay {
    font-family: var(--tbm-font);
    color: var(--tbm-text);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}
.tbm-booking-form *,
.tbm-vehicles-grid *,
.tbm-modal-overlay * {
    box-sizing: border-box;
}

/* ==========================================================
 * FORM CONTAINER
 * ========================================================== */
.tbm-booking-shortcode { max-width: 900px; margin: 0 auto; }
.tbm-booking-form {
    background: #fff;
    border-radius: var(--tbm-radius-lg);
    padding: 30px;
    box-shadow: var(--tbm-shadow);
}
@media (max-width: 640px) {
    .tbm-booking-form { padding: 20px 16px; border-radius: var(--tbm-radius); }
}

/* ==========================================================
 * PROGRESS BAR
 * ========================================================== */
.tbm-form-progress {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
    padding: 16px 8px;
    background: var(--tbm-bg-soft);
    border-radius: var(--tbm-radius);
}
.tbm-progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: var(--tbm-text-light);
}
.tbm-progress-num {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid var(--tbm-border);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: var(--tbm-text-light);
}
.tbm-progress-label {
    font-size: 12px;
    font-weight: 600;
}
.tbm-progress-step.is-active .tbm-progress-num {
    background: linear-gradient(135deg, var(--tbm-primary), var(--tbm-primary-dark));
    color: #fff;
    border-color: var(--tbm-primary-dark);
}
.tbm-progress-step.is-active .tbm-progress-label { color: var(--tbm-primary); }
.tbm-progress-step.is-done .tbm-progress-num {
    background: var(--tbm-accent);
    border-color: var(--tbm-accent);
    color: #fff;
}
.tbm-progress-line {
    flex: 1;
    height: 2px;
    background: var(--tbm-border);
    margin: 0 10px;
    min-width: 20px;
    position: relative;
    top: -14px;
}

/* ==========================================================
 * STEPS
 * ========================================================== */
.tbm-step { display: none; }
.tbm-step.is-active { display: block; }
.tbm-step-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    margin: 0 0 22px;
    color: var(--tbm-text);
}
.tbm-step-title .dashicons { color: var(--tbm-primary); }

/* ==========================================================
 * FORM FIELDS
 * ========================================================== */
.tbm-form-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 12px;
    align-items: end;
    margin-bottom: 16px;
}
.tbm-form-row.tbm-row-3 { grid-template-columns: 1fr 1fr 1fr; }
.tbm-form-row.tbm-row-2 { grid-template-columns: 1fr 1fr; }
@media (max-width: 640px) {
    .tbm-form-row,
    .tbm-form-row.tbm-row-3,
    .tbm-form-row.tbm-row-2 { grid-template-columns: 1fr; }
}

.tbm-form-field { display: flex; flex-direction: column; }
.tbm-form-field > label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--tbm-text-soft);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.tbm-form-field label .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
    color: var(--tbm-text-light);
}

/* ==========================================================
 * INPUTS
 * ========================================================== */
.tbm-input,
.tbm-form-field input[type="text"],
.tbm-form-field input[type="email"],
.tbm-form-field input[type="tel"],
.tbm-form-field input[type="number"],
.tbm-form-field input[type="date"],
.tbm-form-field input[type="time"],
.tbm-form-field select,
.tbm-form-field textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--tbm-border);
    border-radius: var(--tbm-radius-sm);
    font-size: 14px;
    font-family: inherit;
    background: #fff;
    color: var(--tbm-text);
    transition: border-color .18s;
    line-height: 1.4;
}
.tbm-input:focus,
.tbm-form-field input:focus,
.tbm-form-field select:focus,
.tbm-form-field textarea:focus {
    border-color: var(--tbm-primary);
    box-shadow: 0 0 0 3px rgba(108,92,231,.14);
    outline: none;
}
.tbm-input::placeholder { color: var(--tbm-text-light); }

/* ==========================================================
 * SWAP BUTTON
 * ========================================================== */
.tbm-swap-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #fff;
    border: 1.5px solid var(--tbm-border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--tbm-text-muted);
    margin-bottom: 1px;
    transition: all .18s;
}
.tbm-swap-btn:hover {
    background: #f8f7ff;
    color: var(--tbm-primary);
    border-color: var(--tbm-primary);
    transform: rotate(180deg);
}

/* ==========================================================
 * GEO BUTTON
 * ========================================================== */
.tbm-autocomplete-wrap { position: relative; }
.tbm-geo-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #f8f7ff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--tbm-primary);
    transition: all .18s;
}
.tbm-geo-btn:hover {
    background: var(--tbm-primary);
    color: #fff;
}

/* ==========================================================
 * TOGGLE
 * ========================================================== */
.tbm-toggle-wrap {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 8px 0;
    text-transform: none;
    letter-spacing: 0;
    font-size: 14px;
    color: var(--tbm-text);
    font-weight: 500;
}
.tbm-toggle-wrap input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}
.tbm-toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    background: #cbd5e1;
    border-radius: 24px;
    transition: all .2s;
    flex-shrink: 0;
}
.tbm-toggle-switch::before {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    left: 3px;
    top: 3px;
    transition: all .2s;
}
.tbm-toggle-wrap input:checked ~ .tbm-toggle-switch { background: var(--tbm-accent); }
.tbm-toggle-wrap input:checked ~ .tbm-toggle-switch::before { transform: translateX(20px); }

/* ==========================================================
 * BUTTONS
 * ========================================================== */
.tbm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: 1.5px solid transparent;
    border-radius: var(--tbm-radius-sm);
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: all .18s;
    background: transparent;
    color: var(--tbm-text);
}
.tbm-btn-primary {
    background: linear-gradient(135deg, var(--tbm-primary), var(--tbm-primary-dark));
    color: #fff;
    box-shadow: 0 6px 16px -6px rgba(81,69,205,.55);
}
.tbm-btn-primary:hover {
    transform: translateY(-1px);
    color: #fff;
}
.tbm-btn-secondary {
    background: #fff;
    border-color: var(--tbm-border);
    color: var(--tbm-text-soft);
}
.tbm-btn-secondary:hover {
    border-color: var(--tbm-primary);
    color: var(--tbm-primary);
}
.tbm-btn-lg { padding: 14px 28px; font-size: 15px; }
.tbm-btn:disabled { opacity: .65; cursor: not-allowed; }

/* ==========================================================
 * FORM ACTIONS
 * ========================================================== */
.tbm-form-actions {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--tbm-border-soft);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}
.tbm-form-actions.tbm-actions-between { justify-content: space-between; }

/* ==========================================================
 * VEHICLES GRID
 * ========================================================== */
.tbm-vehicles-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}
.tbm-vehicle-card {
    display: grid;
    grid-template-columns: 220px 1fr auto;
    background: #fff;
    border: 1.5px solid var(--tbm-border);
    border-radius: var(--tbm-radius);
    overflow: hidden;
    transition: all .18s;
}
.tbm-vehicle-card:hover {
    border-color: var(--tbm-primary);
    box-shadow: var(--tbm-shadow);
}
@media (max-width: 780px) {
    .tbm-vehicle-card { grid-template-columns: 1fr; }
}
.tbm-vc-image {
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
    background-size: cover;
    background-position: center;
    min-height: 160px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #cbd5e1;
}
.tbm-vc-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 10px;
    border-radius: 20px;
    background: var(--tbm-primary);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}
.tbm-vc-body { padding: 20px 22px; display: flex; flex-direction: column; gap: 8px; }
.tbm-vc-title { margin: 0; font-size: 17px; font-weight: 700; color: var(--tbm-text); }
.tbm-vc-desc { margin: 0; font-size: 13px; color: var(--tbm-text-muted); line-height: 1.5; }
.tbm-vc-breakdown { margin: 6px 0 0; font-size: 12px; color: var(--tbm-text-light); }
.tbm-vc-features { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.tbm-vc-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: var(--tbm-bg-soft);
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--tbm-text-soft);
    border: 1px solid var(--tbm-border-soft);
}
.tbm-vc-chip .dashicons { font-size: 13px; width: 13px; height: 13px; color: var(--tbm-primary); }
.tbm-vc-chip.is-more { background: #f8f7ff; color: var(--tbm-primary-dark); }

.tbm-vc-footer {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: 12px;
    padding: 20px 22px;
    background: var(--tbm-bg-soft);
    border-left: 1px solid var(--tbm-border-soft);
    min-width: 180px;
}
@media (max-width: 780px) {
    .tbm-vc-footer {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        border-left: none;
        border-top: 1px solid var(--tbm-border-soft);
    }
}
.tbm-vc-price { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.tbm-vc-price-label {
    font-size: 11.5px;
    color: var(--tbm-text-light);
    text-transform: uppercase;
    letter-spacing: .05em;
    font-weight: 600;
}
.tbm-vc-price-value {
    font-size: 22px;
    font-weight: 800;
    color: var(--tbm-primary-dark);
    line-height: 1.1;
}
.tbm-vc-extra-total {
    display: none;
    margin-top: 4px;
    font-weight: 600;
    font-size: 11.5px;
    color: var(--tbm-accent);
}

/* ==========================================================
 * EXTRAS IN VEHICLE CARD
 * ========================================================== */
.tbm-vc-extras {
    margin-top: 12px;
    padding: 12px 14px;
    background: var(--tbm-bg-soft);
    border: 1px solid var(--tbm-border);
    border-radius: 10px;
}
.tbm-vc-extras-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    color: var(--tbm-text-soft);
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: 10px;
}
.tbm-vc-extras-title .dashicons { color: var(--tbm-primary); font-size: 14px; width: 14px; height: 14px; }
.tbm-vc-extras-list { display: flex; flex-direction: column; gap: 6px; }
.tbm-vc-extra-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    background: #fff;
    border: 1.5px solid var(--tbm-border);
    border-radius: 8px;
    cursor: pointer;
    transition: all .15s;
}
.tbm-vc-extra-item:hover { border-color: var(--tbm-primary); }
.tbm-vc-extra-item.is-checked { border-color: var(--tbm-accent); background: #f0fdf4; }
.tbm-vc-extra-item input[type="checkbox"] { accent-color: var(--tbm-accent); width: 18px; height: 18px; flex-shrink: 0; }
.tbm-vc-extra-info { flex: 1; }
.tbm-vc-extra-info strong { display: block; font-size: 13px; color: var(--tbm-text); }
.tbm-vc-extra-info small { display: block; font-size: 11.5px; color: var(--tbm-text-muted); margin-top: 2px; }
.tbm-vc-extra-price { font-size: 13px; font-weight: 700; color: var(--tbm-accent); white-space: nowrap; }

/* ==========================================================
 * EMPTY STATE
 * ========================================================== */
.tbm-no-vehicles {
    text-align: center;
    padding: 50px 20px;
    background: #fff;
    border: 1.5px dashed var(--tbm-border);
    border-radius: var(--tbm-radius);
    color: var(--tbm-text-muted);
}
.tbm-no-vehicles .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    color: var(--tbm-text-light);
    margin-bottom: 12px;
}

/* ==========================================================
 * CONFIRMATION SUMMARY (Step 3)
 * ========================================================== */
.tbm-confirm-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}
@media (max-width: 640px) {
    .tbm-confirm-grid { grid-template-columns: 1fr; }
}
.tbm-confirm-card {
    background: var(--tbm-bg-soft);
    border: 1.5px solid var(--tbm-border);
    border-radius: var(--tbm-radius);
    padding: 18px 20px;
}
.tbm-confirm-card h4 {
    margin: 0 0 12px;
    font-size: 12.5px;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--tbm-text-muted);
    font-weight: 700;
}
.tbm-cf-row { padding: 6px 0; font-size: 13.5px; color: var(--tbm-text); }
.tbm-cf-row.tbm-cf-muted { font-size: 13px; color: var(--tbm-text-muted); }
.tbm-cf-row.tbm-cf-success { font-size: 12.5px; color: var(--tbm-accent); }

.tbm-confirm-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    background: linear-gradient(135deg, var(--tbm-primary), var(--tbm-primary-dark));
    border-radius: var(--tbm-radius);
    color: #fff;
    margin-bottom: 20px;
}
.tbm-confirm-total span {
    font-size: 13.5px;
    text-transform: uppercase;
    letter-spacing: .05em;
    opacity: .85;
    font-weight: 600;
}
.tbm-confirm-total strong { font-size: 26px; font-weight: 800; color: #fff; }

/* ==========================================================
 * MESSAGES
 * ========================================================== */
.tbm-form-message {
    display: none;
    margin-top: 14px;
    padding: 12px 16px;
    border-radius: var(--tbm-radius-sm);
    font-size: 13.5px;
}
.tbm-form-message.is-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
    display: block;
}
.tbm-form-message.is-success {
    background: #f0fdf4;
    color: #065f46;
    border: 1px solid #bbf7d0;
    display: block;
}

/* ==========================================================
 * MODAL — Booking Overlay
 * ========================================================== */
.tbm-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
}
.tbm-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 22, 40, .75);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}
.tbm-modal-box {
    position: relative;
    z-index: 1;
    background: #fff;
    border-radius: 20px;
    padding: 30px 28px;
    max-width: 520px;
    width: 100%;
    max-height: 92vh;
    overflow-y: auto;
    box-shadow: 0 25px 60px -20px rgba(0, 0, 0, .5);
}
.tbm-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f1f5f9;
    border: none;
    font-size: 22px;
    line-height: 1;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.tbm-modal-close:hover { background: #e2e8f0; color: #334155; }

.tbm-modal-title {
    margin: 0 0 20px;
    font-size: 20px;
    font-weight: 800;
    color: #0a1628;
    padding-right: 30px;
}

.tbm-modal-summary {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px 18px;
    margin-bottom: 20px;
}
.tbm-modal-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 14px;
    border-bottom: 1px dashed #e2e8f0;
    gap: 10px;
}
.tbm-modal-row:last-child { border-bottom: none; }
.tbm-modal-row span { color: #64748b; flex-shrink: 0; }
.tbm-modal-row strong { color: #0a1628; text-align: right; font-weight: 700; }
.tbm-modal-row.is-total {
    padding-top: 14px;
    margin-top: 6px;
    border-top: 2px solid #ffcc00;
    border-bottom: none;
    font-size: 15px;
}
.tbm-modal-row.is-total span { color: #0a1628; font-weight: 700; }
.tbm-modal-row.is-total strong { color: #0a1628; font-size: 22px; font-weight: 900; }

.tbm-modal-field { margin-bottom: 16px; }
.tbm-modal-field label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: #475569;
    margin-bottom: 8px;
}
.tbm-modal-field .req { color: #dc2626; }
.tbm-modal-field input {
    width: 100%;
    padding: 13px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 15px;
    font-family: inherit;
    background: #fff;
    color: #0f172a;
    box-sizing: border-box;
}
.tbm-modal-field input:focus {
    border-color: #ffcc00;
    outline: none;
    box-shadow: 0 0 0 4px rgba(255, 204, 0, .15);
}

.tbm-modal-msg {
    display: none;
    margin-top: 10px;
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 13.5px;
}
.tbm-modal-msg.is-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
    display: block;
}
.tbm-modal-msg.is-success {
    background: #f0fdf4;
    color: #065f46;
    border: 1px solid #bbf7d0;
    display: block;
}

.tbm-modal-btn {
    width: 100%;
    padding: 16px;
    margin-top: 12px;
    background: linear-gradient(135deg, #ffcc00, #f5b800);
    color: #0a1628;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 800;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 8px 20px -6px rgba(255, 204, 0, .6);
    transition: all .15s;
}
.tbm-modal-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px -6px rgba(255, 204, 0, .7);
}
.tbm-modal-btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }

@media (max-width: 500px) {
    .tbm-modal-box { padding: 24px 20px; border-radius: 16px; }
    .tbm-modal-title { font-size: 18px; }
    .tbm-modal-row.is-total strong { font-size: 20px; }
}

/* ==========================================================
 * SPINNER
 * ========================================================== */
.tbm-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: tbm-spin .8s linear infinite;
}
@keyframes tbm-spin { to { transform: rotate(360deg); } }