/* =========================================================
   GoGoLiberty Public Rider Web App
   Colors: White / Gold / Green
   File: public/app.css
   ========================================================= */

:root {
    --white: #ffffff;
    --green: #0b5127;
    --gold: #D4AF37;

    --bg: #f7f7f7;
    --text: #0f172a;
    --muted: #64748b;

    --card: #ffffff;
    --border: rgba(15, 23, 42, 0.10);

    --shadow: 0 10px 30px rgba(2, 6, 23, 0.10);
    --shadowSoft: 0 6px 18px rgba(2, 6, 23, 0.08);

    --radius: 16px;
    --radiusSm: 12px;

    --sidebarW: 240px;
    --gap: 14px;

    --btnH: 44px;
}

/* Reset */
* {
    box-sizing: border-box
}

html,
body {
    height: 100%
}

body {
    margin: 0;
    font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
    background: var(--bg);
    color: var(--text);
    overflow: hidden;
}

/* =========================================================
   Layout
   ========================================================= */

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebarW);
    background: var(--green);
    color: var(--white);
    padding: 18px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: 10px 0 30px rgba(2, 6, 23, 0.12);
}

.logo {
    font-weight: 900;
    font-size: 18px;
    letter-spacing: 0.5px;
    padding: 12px 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.16);
}

.sidebar button {
    height: var(--btnH);
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.08);
    color: var(--white);
    border-radius: 14px;
    padding: 0 12px;
    cursor: pointer;
    text-align: left;
    font-weight: 700;
    transition: 120ms ease;
}

.sidebar button:hover {
    background: rgba(255, 255, 255, 0.14);
    transform: translateY(-1px);
}

.sidebar button:active {
    transform: translateY(0px);
}

/* Main */
.main {
    position: fixed;
    left: var(--sidebarW);
    top: 0;
    right: 0;
    bottom: 0;
    padding: 18px;
    overflow: hidden;
}

/* Pages */
.page {
    height: 100%;
}

/* =========================================================
   Request Ride Page
   Map + Right Panel
   ========================================================= */

#requestPage {
    height: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 420px;
    gap: var(--gap);
    align-items: stretch;
}

#map {
    height: 100%;
    width: 100%;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadowSoft);
    border: 1px solid var(--border);
    background: #e5e7eb;
}

/* Right panel */
.ridePanel {
    height: 100%;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadowSoft);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow: hidden;
}

.ridePanel input,
.ridePanel select {
    height: 46px;
    border-radius: 14px;
    border: 1px solid var(--border);
    padding: 0 12px;
    font-size: 14px;
    outline: none;
    background: #fff;
}

.ridePanel input:focus,
.ridePanel select:focus {
    border-color: rgba(11, 81, 39, 0.50);
    box-shadow: 0 0 0 4px rgba(11, 81, 39, 0.12);
}

/* Predictions dropdown */
#predictions {
    border-radius: 14px;
    border: 1px solid var(--border);
    background: #fff;
    max-height: 240px;
    overflow: auto;
    box-shadow: var(--shadowSoft);
}

.prediction {
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
    font-size: 14px;
}

.prediction:hover {
    background: rgba(212, 175, 55, 0.14);
}

.prediction:last-child {
    border-bottom: none;
}

/* Primary button */
#requestRideBtn {
    height: 48px;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    background: linear-gradient(135deg, var(--gold), #f1d27a);
    color: #1b1b1b;
    font-weight: 900;
    letter-spacing: 0.2px;
    box-shadow: 0 10px 26px rgba(212, 175, 55, 0.25);
    transition: 120ms ease;
}

#requestRideBtn:hover {
    transform: translateY(-1px);
}

#requestRideBtn:active {
    transform: translateY(0px);
}

/* =========================================================
   Profile Page
   ========================================================= */

#profilePage {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadowSoft);
    padding: 18px;
    overflow: auto;
}

#profilePage h2 {
    margin: 0 0 10px 0;
    font-size: 20px;
}

#profilePhoto {
    width: 100%;
    height: 46px;
    border-radius: 14px;
    border: 1px solid var(--border);
    padding: 10px 12px;
    background: #fff;
}

/* =========================================================
   SOS Button (Fixed Pill)
   ========================================================= */

#sosBtn {
    position: fixed;
    right: 18px;
    bottom: 18px;
    height: 52px;
    padding: 0 18px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: linear-gradient(135deg, #b91c1c, #ef4444);
    color: #fff;
    font-weight: 900;
    letter-spacing: 0.4px;
    cursor: pointer;
    box-shadow: 0 18px 40px rgba(185, 28, 28, 0.28);
    z-index: 1000;
}

#sosBtn:hover {
    transform: translateY(-1px);
}

#sosBtn:active {
    transform: translateY(0px);
}

/* =========================================================
   Modal
   ========================================================= */

.modal {
    position: fixed;
    inset: 0;
    display: none;
    /* shown by JS */
    background: rgba(2, 6, 23, 0.55);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 18px;
}

.modal h3 {
    margin: 0 0 10px 0;
}

.modal>* {
    font-family: inherit;
}

.modal {
    display: none;
}

.modal[style*="display: block"] {
    display: flex !important;
}

.modalContent {
    width: min(420px, 100%);
    background: #fff;
    border-radius: 18px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    padding: 16px;
}

.modalContent input {
    width: 100%;
    height: 46px;
    border-radius: 14px;
    border: 1px solid var(--border);
    padding: 0 12px;
    margin-top: 10px;
    outline: none;
}

.modalContent input:focus {
    border-color: rgba(11, 81, 39, 0.50);
    box-shadow: 0 0 0 4px rgba(11, 81, 39, 0.12);
}

.modalActions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.modalActions button {
    flex: 1;
    height: 46px;
    border-radius: 14px;
    border: 1px solid var(--border);
    cursor: pointer;
    font-weight: 900;
}

.modalActions .primary {
    background: linear-gradient(135deg, var(--gold), #f1d27a);
    border: none;
}

.modalActions .secondary {
    background: rgba(11, 81, 39, 0.10);
    color: var(--green);
}

/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 980px) {

    body {
        overflow: auto;
    }

    .sidebar {
        position: static;
        width: auto;
        flex-direction: row;
        align-items: center;
        overflow: auto;
        border-radius: 0;
    }

    .main {
        position: static;
        left: auto;
        padding: 12px;
    }

    #requestPage {
        grid-template-columns: 1fr;
    }

    #map {
        height: 360px;
    }

}

/* =========================
   Ride: Vehicle Cards + Breakdown
   ========================= */
.vehicleList {
    display: grid;
    gap: 10px;
    margin-top: 10px;
}

.vehicleCard {
    border: 1px solid rgba(0, 0, 0, .12);
    border-radius: 14px;
    background: #fff;
    padding: 12px;
    cursor: pointer;
    transition: transform .08s ease, box-shadow .08s ease, border-color .08s ease;
}

.vehicleCard:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 26px rgba(0, 0, 0, .10);
}

.vehicleCard.isSelected {
    border-color: rgba(11, 81, 39, .55);
    box-shadow: 0 14px 30px rgba(11, 81, 39, .14);
}

.vehicleTopRow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.vehicleMeta {
    display: flex;
    align-items: center;
    gap: 10px;
}

.vehicleIcon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: rgba(11, 81, 39, .08);
    font-size: 18px;
    font-weight: 900;
}

.vehicleTitle {
    font-weight: 900;
    line-height: 1.1;
}

.vehicleSub {
    font-size: 12px;
    opacity: .72;
    margin-top: 2px;
    font-weight: 700;
}

.vehiclePrice {
    font-weight: 1000;
    font-size: 16px;
    white-space: nowrap;
}

.breakdownBox {
    margin-top: 10px;
    border-radius: 14px;
    border: 1px solid rgba(0, 0, 0, .12);
    background: rgba(0, 0, 0, .02);
    padding: 10px;
}

.breakdownGrid {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 6px 10px;
    font-size: 13px;
}

.breakdownGrid .label {
    font-weight: 800;
    opacity: .75;
}

.breakdownGrid .val {
    font-weight: 950;
}

.breakdownTotal {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed rgba(0, 0, 0, .22);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 1000;
}

.pillRow {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.pill {
    border: 1px solid rgba(0, 0, 0, .12);
    background: #fff;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
    opacity: .85;
}

/* =========================
   White Modal (replaces alert/prompt/confirm)
   ========================= */
.modalOverlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .40);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.modalOverlay.isOpen {
    display: flex;
}

.modalCard {
    width: min(520px, calc(100vw - 24px));
    background: #fff;
    border-radius: 18px;
    border: 1px solid rgba(0, 0, 0, .12);
    box-shadow: 0 18px 50px rgba(0, 0, 0, .25);
    overflow: hidden;
}

.modalHeader {
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(0, 0, 0, .08);
}

.modalHeader h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 1000;
}

.modalBody {
    padding: 14px 16px;
}

.modalActions {
    padding: 12px 16px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    border-top: 1px solid rgba(0, 0, 0, .08);
}

/* Trip Summary */
.tsList {
    margin-top: 14px;
    display: grid;
    gap: 12px;
}

.tsCard {
    border: 1px solid rgba(0, 0, 0, .10);
    border-radius: 14px;
    padding: 12px 14px;
    background: #fff;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .06);
}

.tsRow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.tsTitle {
    font-weight: 900;
}

.tsPill {
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(0, 0, 0, .10);
    background: rgba(0, 0, 0, .03);
    font-size: 12px;
    font-weight: 800;
}

.tsMut {
    opacity: .72;
    font-size: 12px;
    margin-top: 4px;
}

.tsLine {
    margin-top: 6px;
    font-size: 13px;
}

.tsActions {
    margin-top: 10px;
    display: flex;
    justify-content: flex-end;
}

.tsBtn {
    border: 0;
    border-radius: 12px;
    padding: 10px 12px;
    font-weight: 900;
    cursor: pointer;
}

.tsHint {
    padding: 14px;
    opacity: .8;
}

.tsErr {
    color: #b00020;
}

/* Modal */
.tsModal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 9999;
}

.tsModalCard {
    width: min(920px, 96vw);
    max-height: 88vh;
    overflow: auto;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 20px 80px rgba(0, 0, 0, .35);
}

.tsModalHeader {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(0, 0, 0, .10);
}

.tsModalTitle {
    font-weight: 950;
}

.tsX {
    border: 0;
    background: transparent;
    font-size: 18px;
    cursor: pointer;
}

.tsModalBody {
    padding: 14px;
}

.tsDetailGrid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.tsSpan2 {
    grid-column: span 2;
}

.tsLabel {
    font-size: 12px;
    opacity: .72;
    font-weight: 800;
}

.tsVal {
    font-size: 13px;
    font-weight: 800;
}

.tsSection {
    margin-top: 14px;
}

.tsLink {
    font-weight: 900;
    text-decoration: underline;
}

.tsEvidenceList {
    display: grid;
    gap: 10px;
    margin-top: 8px;
}

.tsEvidenceItem {
    padding: 10px;
    border: 1px solid rgba(0, 0, 0, .10);
    border-radius: 12px;
}