/* Font Import */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    /* Color Palette - Premium Dark & Gold */
    --primary: #FBBF24;
    /* Amber 400 */
    --primary-hover: #F59E0B;
    /* Amber 500 */
    --primary-fade: rgba(251, 191, 36, 0.2);

    --bg-dark: #0f172a;
    /* Slate 900 */
    --surface-dark: #1e293b;
    /* Slate 800 */
    --surface-glass: rgba(30, 41, 59, 0.7);
    --surface-glass-border: rgba(255, 255, 255, 0.1);

    --text-main: #f8fafc;
    /* Slate 50 */
    --text-muted: #94a3b8;
    /* Slate 400 */

    --success: #10b981;
    --error: #ef4444;

    /* Spacing & Layout */
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 12px;

    --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    --shadow-float: 0 10px 15px -3px rgba(0, 0, 0, 0.5);

    /* Transitions */
    --ease-elastic: cubic-bezier(0.68, -0.55, 0.265, 1.55);
    --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow: hidden;
    /* Prevent scrolling on mobile map app */
    height: 100vh;
    height: 100dvh;
    /* Dynamic viewport height for mobile */
    width: 100vw;
}

/* Map Container */
#map-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

#map {
    width: 100%;
    height: 100%;
}

/* Center Pin */
.center-pin {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
    pointer-events: none;
    transition: opacity 0.3s var(--ease-smooth);
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.3));
}

.center-pin i {
    font-size: 2.5rem;
    color: var(--primary);
    transform: translateY(-50%);
    /* Align tip to center */
}

/* Glassmorphism Utilities */
.glass-panel {
    background: var(--surface-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--surface-glass-border);
    box-shadow: var(--shadow-glass);
}

/* UI Controls Area (Zoom, Reset) */
.ui-controls {
    position: absolute;
    top: max(1rem, env(safe-area-inset-top));
    /* Handle notch */
    left: 1rem;
    right: 1rem;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
    /* Let clicks pass through empty space */
}

.control-btn {
    pointer-events: auto;
    background: var(--surface-dark);
    color: var(--text-main);
    border: 1px solid var(--surface-glass-border);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: var(--shadow-float);
    transition: all 0.2s var(--ease-smooth);
}

.control-btn:active {
    transform: scale(0.95);
}

.reset-btn {
    pointer-events: auto;
    background: var(--surface-dark);
    color: var(--text-main);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full, 9999px);
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid var(--surface-glass-border);
    box-shadow: var(--shadow-float);
    cursor: pointer;
    transition: all 0.3s var(--ease-smooth);
}

/* Bottom Panels */
.bottom-panel {
    position: fixed;
    bottom: 0;
    left: 50%;
    /* Center horizontally */
    width: 100%;
    max-width: 600px;
    /* Tablet/Desktop constraint */
    z-index: 20;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: 1.5rem;
    padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
    /* Handle home indicator */

    transform: translateX(-50%) translateY(110%);
    transition: transform 0.4s var(--ease-elastic);

    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.bottom-panel.active {
    transform: translateX(-50%) translateY(0);
}

/* Input Fields */
.input-group {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(0, 0, 0, 0.2);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    transition: border-color 0.2s;
}

.input-group:focus-within {
    border-color: var(--primary);
}

.input-icon {
    color: var(--primary);
    width: 24px;
    text-align: center;
}

.panel-input {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--text-main);
    padding: 0.75rem 0;
    font-size: 1rem;
    font-family: inherit;
    outline: none;
}

.panel-input::placeholder {
    color: var(--text-muted);
}

/* Buttons */
.btn-primary {
    width: 100%;
    background: var(--primary);
    color: #1a202c;
    /* Intentionally dark for contrast on yellow */
    font-weight: 700;
    padding: 1rem;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    font-size: 1rem;
    transition: transform 0.2s, background 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--text-muted);
    color: var(--text-main);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 600;
}

/* Vehicle Options */
.vehicle-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 40vh;
    overflow-y: auto;
    padding-right: 0.25rem;
}

.vehicle-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--surface-glass-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
}

.vehicle-card.selected {
    background: var(--primary-fade);
    border-color: var(--primary);
    box-shadow: 0 0 0 1px var(--primary);
}

.vehicle-info h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.vehicle-info p {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.vehicle-price {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--primary);
}

/* Trip Stats */
.trip-stats {
    display: flex;
    justify-content: space-around;
    background: rgba(0, 0, 0, 0.2);
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 0.5rem;
}

.stat-item {
    text-align: center;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
}

/* Utilities */
.hidden {
    display: none !important;
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}