/* ==========================================================================
   TransVIP First Inc. — Driver Chauffeur Tactical PWA Styles (driver.css)
   Aesthetic: OLED Deep Night, High-Contrast Tactical Cockpit
   Optimized for Direct Florida Sunlight & One-Handed Vehicle Operation
   ========================================================================== */

:root {
    --drv-bg: #040711;
    --drv-card: #091124;
    --drv-card-hover: #0e1b38;
    --drv-border: rgba(255, 255, 255, 0.12);
    --drv-border-active: rgba(0, 210, 255, 0.5);
    
    --blue-tactical: #0084ff;
    --cyan-tactical: #00d2ff;
    --emerald-tactical: #10b981;
    --amber-tactical: #f59e0b;
    --rose-tactical: #f43f5e;
    
    --text-pure: #ffffff;
    --text-silver: #cbd5e1;
    --text-muted: #8899ac;
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-pill: 9999px;
    
    --shadow-tactical: 0 8px 24px rgba(0, 0, 0, 0.6);
    --shadow-glow-blue: 0 0 20px rgba(0, 132, 255, 0.45);
    --shadow-glow-green: 0 0 20px rgba(16, 185, 129, 0.45);
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--drv-bg);
    color: var(--text-pure);
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.45;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    user-select: none;
    overflow-x: hidden;
}

/* Offline Banner */
.offline-banner {
    display: none;
    background: var(--amber-tactical);
    color: #040711;
    text-align: center;
    padding: 0.45rem 1rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.offline-banner.active {
    display: block;
}

/* Main Container */
.driver-app-wrap {
    flex: 1;
    max-width: 480px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    position: relative;
    padding-bottom: 2rem;
}

/* ==========================================================================
   Screen 1: Tactical PIN Login
   ========================================================================== */
.login-screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2rem 1.5rem;
    animation: fadeIn 0.3s ease;
}

.login-brand {
    text-align: center;
    margin-bottom: 2rem;
}

.login-brand img {
    height: 38px;
    width: auto;
    margin-bottom: 0.75rem;
}

.login-brand h2 {
    font-size: 1.3rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.01em;
}

.login-brand p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.login-card {
    background: var(--drv-card);
    border: 1px solid var(--drv-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-tactical);
}

.form-group-drv {
    margin-bottom: 1.25rem;
}

.form-label-drv {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-silver);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.4rem;
}

.form-input-drv {
    width: 100%;
    background: #060b18;
    border: 1px solid var(--drv-border);
    border-radius: var(--radius-sm);
    color: #fff;
    font-family: inherit;
    font-size: 1.05rem;
    font-weight: 600;
    padding: 0.75rem 1rem;
    outline: none;
    transition: all 0.2s;
}

.form-input-drv:focus {
    border-color: var(--cyan-tactical);
    box-shadow: 0 0 12px rgba(0, 210, 255, 0.35);
}

.pin-input-group {
    display: flex;
    gap: 0.65rem;
    justify-content: center;
    margin: 0.75rem 0 1.25rem 0;
}

.pin-digit-box {
    width: 54px;
    height: 60px;
    background: #060b18;
    border: 2px solid var(--drv-border);
    border-radius: var(--radius-md);
    color: var(--cyan-tactical);
    font-size: 1.8rem;
    font-weight: 800;
    text-align: center;
    outline: none;
    caret-color: var(--cyan-tactical);
    transition: all 0.2s;
}

.pin-digit-box:focus {
    border-color: var(--cyan-tactical);
    box-shadow: 0 0 16px rgba(0, 210, 255, 0.4);
    background: #09142c;
}

.btn-tactical-submit {
    width: 100%;
    min-height: 52px;
    background: linear-gradient(135deg, var(--blue-tactical), #0056b3);
    border: none;
    border-radius: var(--radius-md);
    color: #fff;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    cursor: pointer;
    box-shadow: var(--shadow-glow-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

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

/* ==========================================================================
   Screen 2: Chauffeur Active Cockpit
   ========================================================================== */
.cockpit-screen {
    display: none;
    flex-direction: column;
    padding: 1rem 1rem calc(80px + env(safe-area-inset-bottom, 0px)) 1rem;
    gap: 1rem;
    animation: fadeIn 0.3s ease;
}

.driver-pane {
    padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
}

.cockpit-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--drv-border);
}

.driver-profile-pill {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.driver-avatar-img {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 2px solid var(--cyan-tactical);
    object-fit: cover;
}

.driver-meta-info strong {
    display: block;
    font-size: 0.9rem;
    color: #fff;
}

.driver-meta-info span {
    font-size: 0.7rem;
    color: var(--emerald-tactical);
    font-weight: 700;
    text-transform: uppercase;
}

.btn-logout-sm {
    background: transparent;
    border: 1px solid var(--drv-border);
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.72rem;
    padding: 0.35rem 0.65rem;
    border-radius: var(--radius-pill);
    cursor: pointer;
}

/* Active Leg Hero Card */
.active-leg-card {
    background: var(--drv-card);
    border: 1px solid var(--drv-border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: var(--shadow-tactical);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.leg-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding-bottom: 0.75rem;
}

.booking-code-pill {
    font-family: monospace;
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--cyan-tactical);
    background: rgba(0, 210, 255, 0.12);
    border: 1px solid rgba(0, 210, 255, 0.3);
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-sm);
}

.leg-phase-badge {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-pill);
    background: rgba(16, 185, 129, 0.15);
    color: var(--emerald-tactical);
    border: 1px solid rgba(16, 185, 129, 0.4);
}

/* Passenger Contact Panel */
.passenger-tactical-box {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-md);
    padding: 0.85rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pax-names h4 {
    font-size: 1rem;
    color: #fff;
    font-weight: 700;
    margin-bottom: 0.15rem;
}

.pax-names span {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.pax-comm-buttons {
    display: flex;
    gap: 0.45rem;
}

.btn-comm-action {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-comm-phone { background: var(--blue-tactical); color: #fff; }
.btn-comm-wa { background: #25d366; color: #fff; }

/* Itinerary Details */
.itinerary-step {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

.step-marker {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 800;
    flex-shrink: 0;
    margin-top: 0.15rem;
}

.marker-pickup { background: var(--blue-tactical); color: #fff; }
.marker-dropoff { background: var(--emerald-tactical); color: #fff; }

.step-details strong {
    display: block;
    font-size: 0.72rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.04em;
}

.step-details p {
    font-size: 0.95rem;
    color: #fff;
    font-weight: 600;
    line-height: 1.35;
}

.nav-gps-row {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.4rem;
}

.btn-gps-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--drv-border);
    border-radius: var(--radius-xs);
    color: var(--text-silver);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.25rem 0.55rem;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-gps-chip:hover {
    background: rgba(0, 132, 255, 0.2);
    border-color: var(--blue-tactical);
    color: #fff;
}

/* Vehicle & Flight Specs Row */
.specs-tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.spec-tag {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    font-size: 0.72rem;
    color: var(--text-silver);
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.spec-tag strong {
    color: #fff;
}

/* MASTER ACTION BUTTON (Single Sequential State Trigger) */
.master-action-container {
    margin-top: 0.5rem;
}

.btn-sequential-trigger {
    width: 100%;
    min-height: 60px;
    border: none;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 1.05rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #fff;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.btn-sequential-trigger span.subtext {
    font-size: 0.68rem;
    font-weight: 600;
    opacity: 0.85;
    text-transform: none;
}

/* Button State Themes */
.state-theme-accept {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    box-shadow: 0 0 25px rgba(245, 158, 11, 0.45);
}

.state-theme-enroute {
    background: linear-gradient(135deg, var(--blue-tactical), #0056b3);
    box-shadow: var(--shadow-glow-blue);
}

.state-theme-onsite {
    background: linear-gradient(135deg, #00d2ff, #0077b6);
    box-shadow: 0 0 25px rgba(0, 210, 255, 0.45);
}

.state-theme-pob {
    background: linear-gradient(135deg, #10b981, #059669);
    box-shadow: var(--shadow-glow-green);
}

.state-theme-complete {
    background: linear-gradient(135deg, #8b5cf6, #6d28d9);
    box-shadow: 0 0 25px rgba(139, 92, 246, 0.45);
}

.btn-sequential-trigger:active {
    transform: scale(0.97);
}

/* ==========================================================================
   Tolls & Parking Settlement Modal
   ========================================================================== */
.modal-overlay-drv {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 1.25rem;
}

.modal-overlay-drv.active {
    display: flex;
}

.modal-card-drv {
    background: #091228;
    border: 1px solid var(--drv-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    width: 100%;
    max-width: 440px;
    box-shadow: var(--shadow-tactical);
    animation: fadeIn 0.2s ease;
}

.modal-card-drv h3 {
    font-size: 1.15rem;
    color: #fff;
    margin-bottom: 0.35rem;
}

.modal-card-drv p {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   Duty Status Button & Cockpit Additions
   ========================================================================== */
.btn-duty-toggle {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid var(--emerald-tactical);
    color: #10b981;
    font-family: inherit;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 0.4rem 0.65rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-duty-toggle.off-duty {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--text-muted);
}

/* ==========================================================================
   Driver Panes & Content
   ========================================================================== */
.driver-pane {
    flex: 1;
    display: none;
    flex-direction: column;
    padding-bottom: 70px; /* Space for bottom nav */
    animation: fadeIn 0.25s ease;
}

.driver-pane.active {
    display: flex;
}

.pane-header-box {
    margin-bottom: 1.25rem;
}

.pane-header-box h4 {
    font-size: 1.2rem;
    color: #fff;
    margin-bottom: 0.25rem;
}

.pane-header-box p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* History Card */
.history-leg-card {
    background: var(--drv-card);
    border: 1px solid var(--drv-border);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 0.75rem;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.4rem;
}

.history-code {
    font-family: monospace;
    font-weight: 700;
    color: var(--cyan-tactical);
}

.history-date {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.history-route {
    font-size: 0.82rem;
    color: var(--text-silver);
    line-height: 1.4;
    margin-bottom: 0.5rem;
}

.history-payout-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: 0.4rem;
    margin-top: 0.4rem;
}

/* Earnings Summary Grid */
.earnings-summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.earn-card {
    background: var(--drv-card);
    border: 1px solid var(--drv-border);
    border-radius: var(--radius-md);
    padding: 1rem;
    text-align: center;
}

.earn-label {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.earn-val {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--emerald-tactical);
}

/* Profile Card */
.profile-card-drv {
    background: var(--drv-card);
    border: 1px solid var(--drv-border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
}

.driver-avatar-lg {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--cyan-tactical);
    background: #060b18;
}

.profile-spec-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.82rem;
}

.profile-spec-row span {
    color: var(--text-muted);
}

.profile-spec-row strong {
    color: #fff;
}

.btn-logout-full {
    width: 100%;
    padding: 0.75rem;
    background: rgba(244, 63, 94, 0.15);
    border: 1px solid var(--rose-tactical);
    color: #f43f5e;
    font-family: inherit;
    font-weight: 700;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

/* ==========================================================================
   Bottom Tactical Navigation Bar
   ========================================================================== */
.driver-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    height: calc(60px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: rgba(4, 7, 17, 0.98);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--drv-border);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 99999;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    box-sizing: border-box;
}

.nav-tab-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: inherit;
    cursor: pointer;
    padding: 0.4rem 0;
    transition: all 0.2s ease;
}

.nav-tab-icon {
    font-size: 1.25rem;
    line-height: 1;
}

.nav-tab-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.nav-tab-btn.active {
    color: var(--cyan-tactical);
}

.nav-tab-btn.active .nav-tab-icon {
    transform: translateY(-2px);
    filter: drop-shadow(0 0 6px var(--cyan-tactical));
}
