:root {
    --black: #000000;
    --dark: #1a1a1a;
    --darker: #111111;
    --gray-900: #1c1c1e;
    --gray-800: #2c2c2e;
    --gray-700: #3a3a3c;
    --gray-600: #48484a;
    --gray-500: #636366;
    --gray-400: #8e8e93;
    --gray-300: #aeaeb2;
    --white: #ffffff;
    --green: #34c759;
    --green-dark: #248a3d;
    --blue: #0a84ff;
    --red: #ff453a;
    --yellow: #ffd60a;
    --orange: #ff9f0a;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
    background: var(--black);
    color: var(--white);
    min-height: 100dvh;
    overflow-x: hidden;
}

/* Logo */
.logo {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.logo span {
    color: var(--green);
}

/* Login */
.login-container {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.login-card {
    width: 100%;
    max-width: 360px;
}

.login-logo {
    font-size: 3rem;
    font-weight: 900;
    text-align: center;
    margin-bottom: 0.5rem;
    letter-spacing: -0.03em;
}

.login-logo span {
    color: var(--green);
}

.login-tagline {
    text-align: center;
    color: var(--gray-400);
    font-size: 0.9rem;
    margin-bottom: 2.5rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--gray-400);
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 0.85rem 1rem;
    background: var(--gray-900);
    border: 1px solid var(--gray-700);
    border-radius: 12px;
    color: var(--white);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

.form-group input:focus, .form-group select:focus {
    border-color: var(--green);
}

.form-group input::placeholder {
    color: var(--gray-600);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.85rem 1.5rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    width: 100%;
}

.btn-primary {
    background: var(--green);
    color: var(--black);
}

.btn-primary:active {
    background: var(--green-dark);
    transform: scale(0.98);
}

.btn-secondary {
    background: var(--gray-800);
    color: var(--white);
}

.btn-secondary:active {
    background: var(--gray-700);
}

.btn-danger {
    background: var(--red);
    color: var(--white);
}

.btn-small {
    padding: 0.6rem 1.2rem;
    font-size: 0.85rem;
    border-radius: 10px;
}

/* User picker chips */
.user-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.user-chip {
    cursor: pointer;
}

.user-chip input {
    display: none;
}

.chip-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    padding: 0.75rem 0.5rem;
    background: var(--gray-900);
    border: 2px solid var(--gray-700);
    border-radius: 14px;
    transition: all 0.15s;
}

.user-chip input:checked + .chip-inner {
    border-color: var(--green);
    background: rgba(52, 199, 89, 0.08);
}

.chip-inner:active {
    transform: scale(0.95);
}

.chip-icon {
    font-size: 1.5rem;
}

.chip-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--white);
}

.error-msg {
    background: rgba(255, 69, 58, 0.15);
    color: var(--red);
    padding: 0.75rem 1rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    text-align: center;
}

/* App layout */
.app {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: var(--dark);
    border-bottom: 1px solid var(--gray-800);
    position: sticky;
    top: 0;
    z-index: 100;
}

.app-header .user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--gray-300);
}

.app-header a {
    color: var(--gray-400);
    text-decoration: none;
    font-size: 0.85rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Map */
.map-container {
    width: 100%;
    height: 300px;
    position: relative;
}

.map-container.full {
    height: 50dvh;
}

#map {
    width: 100%;
    height: 100%;
}

/* Ride request panel */
.panel {
    background: var(--dark);
    border-radius: 20px 20px 0 0;
    padding: 1.5rem;
    flex: 1;
    margin-top: -20px;
    position: relative;
    z-index: 10;
}

.panel-handle {
    width: 36px;
    height: 5px;
    background: var(--gray-600);
    border-radius: 3px;
    margin: 0 auto 1.25rem;
}

/* Location inputs */
.location-inputs {
    position: relative;
    margin-bottom: 1.25rem;
}

.location-dot {
    position: absolute;
    left: 0.9rem;
    top: 0;
    bottom: 0;
    width: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 2;
}

.dot-green {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--green);
    flex-shrink: 0;
}

.dot-line {
    width: 2px;
    height: 24px;
    background: var(--gray-600);
    margin: 4px 0;
}

.dot-red {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--red);
    flex-shrink: 0;
}

.location-inputs .form-group input {
    padding-left: 2.8rem;
}

.location-inputs .form-group {
    margin-bottom: 0.5rem;
}

/* Address suggestions */
.suggestions {
    position: absolute;
    left: 0;
    right: 0;
    background: var(--gray-900);
    border: 1px solid var(--gray-700);
    border-radius: 12px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 50;
    display: none;
}

.suggestions.active {
    display: block;
}

.suggestion-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--gray-800);
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:active {
    background: var(--gray-800);
}

.suggestion-name {
    color: var(--white);
    font-weight: 500;
}

.suggestion-address {
    color: var(--gray-400);
    font-size: 0.8rem;
    margin-top: 2px;
}

/* Current location button */
.current-location-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: none;
    border: 1px solid var(--gray-700);
    border-radius: 8px;
    color: var(--blue);
    font-size: 0.8rem;
    cursor: pointer;
    margin-bottom: 1rem;
}

.current-location-btn:active {
    background: var(--gray-900);
}

/* Ride type selector */
.ride-types {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.ride-type-card {
    flex: 1;
    padding: 1rem;
    background: var(--gray-900);
    border: 2px solid var(--gray-700);
    border-radius: 14px;
    cursor: pointer;
    text-align: center;
    transition: all 0.15s;
}

.ride-type-card.selected {
    border-color: var(--green);
    background: rgba(52, 199, 89, 0.08);
}

.ride-type-card:active {
    transform: scale(0.97);
}

.ride-type-icon {
    font-size: 2rem;
    margin-bottom: 0.3rem;
}

.ride-type-name {
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 0.15rem;
}

.ride-type-desc {
    font-size: 0.75rem;
    color: var(--gray-400);
}

/* Schedule toggle */
.schedule-toggle {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: var(--gray-900);
    border-radius: 12px;
    cursor: pointer;
}

.schedule-toggle input[type="checkbox"] {
    display: none;
}

.toggle-switch {
    width: 44px;
    height: 26px;
    background: var(--gray-600);
    border-radius: 13px;
    position: relative;
    transition: background 0.2s;
    flex-shrink: 0;
}

.toggle-switch::after {
    content: '';
    width: 22px;
    height: 22px;
    background: white;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: transform 0.2s;
}

.schedule-toggle input:checked + .toggle-switch {
    background: var(--green);
}

.schedule-toggle input:checked + .toggle-switch::after {
    transform: translateX(18px);
}

.schedule-time {
    display: none;
    margin-bottom: 1rem;
}

.schedule-time.active {
    display: block;
}

/* Ride cards */
.ride-card {
    background: var(--gray-900);
    border-radius: 14px;
    padding: 1.25rem;
    margin-bottom: 0.75rem;
}

.ride-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.rider-name {
    font-weight: 700;
    font-size: 1.1rem;
}

.ride-type-badge {
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-gride {
    background: rgba(52, 199, 89, 0.15);
    color: var(--green);
}

.badge-gride-xl {
    background: rgba(255, 159, 10, 0.15);
    color: var(--orange);
}

.ride-locations {
    margin-bottom: 1rem;
}

.ride-location {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.ride-location .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-top: 6px;
    flex-shrink: 0;
}

.ride-actions {
    display: flex;
    gap: 0.5rem;
}

.ride-actions .btn {
    flex: 1;
}

/* Status banner */
.status-banner {
    padding: 1rem 1.25rem;
    text-align: center;
    font-weight: 700;
    font-size: 1rem;
}

.status-requested {
    background: rgba(255, 214, 10, 0.12);
    color: var(--yellow);
}

.status-accepted, .status-arriving {
    background: rgba(10, 132, 255, 0.12);
    color: var(--blue);
}

.status-in-progress {
    background: rgba(52, 199, 89, 0.12);
    color: var(--green);
}

.status-completed {
    background: rgba(52, 199, 89, 0.12);
    color: var(--green);
}

/* Driver info card */
.driver-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--gray-900);
    border-radius: 14px;
    margin: 1rem 1.25rem;
}

.driver-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--gray-700);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.driver-details h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.15rem;
}

.driver-rating {
    color: var(--yellow);
    font-size: 0.85rem;
}

.driver-vehicle {
    color: var(--gray-400);
    font-size: 0.8rem;
}

/* Rating screen */
.rating-container {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    text-align: center;
}

.rating-prompt {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.rating-sub {
    color: var(--gray-400);
    margin-bottom: 2rem;
}

.stars {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.star {
    font-size: 2.5rem;
    cursor: pointer;
    color: var(--gray-600);
    transition: color 0.15s, transform 0.15s;
    user-select: none;
}

.star.active {
    color: var(--yellow);
}

.star:active {
    transform: scale(1.2);
}

.rating-comment {
    width: 100%;
    max-width: 360px;
    margin-bottom: 1.5rem;
}

.rating-comment textarea {
    width: 100%;
    padding: 0.85rem 1rem;
    background: var(--gray-900);
    border: 1px solid var(--gray-700);
    border-radius: 12px;
    color: var(--white);
    font-size: 0.95rem;
    resize: none;
    height: 80px;
    outline: none;
    font-family: inherit;
}

.rating-comment textarea:focus {
    border-color: var(--green);
}

.rating-submit {
    width: 100%;
    max-width: 360px;
}

/* Profile */
.profile-container {
    padding: 2rem 1.25rem;
    text-align: center;
}

.profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: var(--gray-700);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    margin: 0 auto 1rem;
}

.profile-name {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 0.25rem;
}

.profile-rating {
    font-size: 1.25rem;
    color: var(--yellow);
    margin-bottom: 0.25rem;
}

.profile-stats {
    color: var(--gray-400);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.profile-vehicle {
    background: var(--gray-900);
    border-radius: 14px;
    padding: 1.25rem;
    margin-bottom: 0.75rem;
}

.profile-vehicle h3 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-400);
    margin-bottom: 0.5rem;
}

.profile-vehicle p {
    font-size: 1.1rem;
    font-weight: 600;
}

/* Waiting animation */
.waiting {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem;
}

.waiting-text {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.waiting-sub {
    color: var(--gray-400);
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
}

.pulse-ring {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(52, 199, 89, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 2s ease-in-out infinite;
}

.pulse-ring .inner {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--green);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.15); opacity: 0.7; }
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--gray-400);
}

.empty-state .icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.empty-state h3 {
    color: var(--white);
    margin-bottom: 0.5rem;
}

/* Bottom action */
.bottom-action {
    padding: 1rem 1.25rem;
    padding-bottom: calc(1rem + env(safe-area-inset-bottom));
    background: var(--dark);
    border-top: 1px solid var(--gray-800);
    position: sticky;
    bottom: 0;
}

/* Utility */
.text-green { color: var(--green); }
.text-yellow { color: var(--yellow); }
.text-red { color: var(--red); }
.text-blue { color: var(--blue); }
.text-gray { color: var(--gray-400); }
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }

/* Mapbox overrides */
.mapboxgl-ctrl-attrib {
    display: none !important;
}
