:root {
    --bg-deep: #060913;
    --bg-card: rgba(14, 19, 36, 0.76);
    --bg-card-hover: rgba(21, 28, 51, 0.9);
    --border-color: rgba(255, 255, 255, 0.1);
    --border-color-focus: rgba(10, 132, 255, 0.4);
    
    --apple-blue: #0A84FF;
    --apple-blue-rgb: 10, 132, 255;
    --apple-gold: #FFD60A;
    --apple-gold-rgb: 255, 214, 10;
    --apple-green: #30D158;
    --apple-green-rgb: 48, 209, 88;
    --apple-red: #FF453A;
    --apple-red-rgb: 255, 69, 58;
    --apple-purple: #BF5AF2;
    --apple-gray: #8E8E93;
    
    --text-main: #FFFFFF;
    --text-muted: #8E8E93;
    --text-secondary: #C7C7CC;
}

/* Custom Reset & Base Styles */
body {
    background-color: var(--bg-deep);
    background-image: radial-gradient(circle at 50% -10%, rgba(10, 132, 255, 0.16) 0%, transparent 45%),
                      radial-gradient(circle at 0% 100%, rgba(48, 209, 88, 0.055) 0%, transparent 34%),
                      linear-gradient(145deg, #060913 0%, #0c1428 52%, #020617 100%);
    color: var(--text-main);
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", sans-serif;
    min-height: 100vh;
    padding: 0 0 80px 0;
    margin: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    
    /* Disable text selection to mimic native app */
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Re-enable selection for inputs and search boxes */
input, textarea {
    user-select: text !important;
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
}

/* Safe Area Insets for Modern iPhone Screen Fit */
@support (padding-top: env(safe-area-inset-top)) {
    body {
        padding-top: env(safe-area-inset-top);
        padding-bottom: calc(80px + env(safe-area-inset-bottom));
    }
}

.main-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 16px;
}

/* Premium Top Navigation Bar */
.app-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(6, 9, 19, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    padding: 12px 16px;
}

.app-bar-content {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-icon {
    font-size: 1.4rem;
    color: var(--apple-blue);
    transform: rotate(45deg);
    display: inline-block;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #FFF 60%, var(--apple-blue) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.app-bar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-name {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Buttons System */
.btn-action-outline {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-main);
    padding: 8px 14px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-action-outline:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-action-primary {
    background: var(--apple-blue);
    border: none;
    border-radius: 12px;
    color: #FFFFFF;
    padding: 8px 14px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 12px rgba(10, 132, 255, 0.3);
}

.btn-action-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* Info Badges (Weather, Time, Intensity) */
.info-badge-bar {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.info-pill {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 100px;
    padding: 6px 14px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
}

.weather-pill {
    background: linear-gradient(135deg, rgba(10, 132, 255, 0.1) 0%, var(--bg-card) 100%);
}

.time-pill {
    background: linear-gradient(135deg, rgba(255, 214, 10, 0.05) 0%, var(--bg-card) 100%);
}

/* Location Header Section */
.current-airport-section {
    margin-top: 10px;
}

.airport-title {
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 4px;
}

.btn-gps-pill {
    background: transparent;
    border: none;
    color: var(--apple-blue);
    font-size: 0.85rem;
    font-weight: 700;
    padding: 4px 12px;
    transition: opacity 0.2s;
}

.btn-gps-pill:hover {
    opacity: 0.8;
}

.btn-refresh-gold {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    max-width: 480px;
    margin: 10px auto 4px auto;
    padding: 12px 20px;
    border-radius: 14px;
    background: linear-gradient(135deg, #FFB800 0%, #FF9500 100%);
    border: none;
    color: #000000 !important;
    font-size: 0.95rem;
    font-weight: 700;
    box-shadow: 0 4px 16px rgba(255, 184, 0, 0.3);
    cursor: pointer;
    transition: transform 0.15s, opacity 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.btn-refresh-gold:active {
    transform: scale(0.97);
    opacity: 0.9;
}

/* Ergonomic Uber Staging Lot Button for Drivers */
.btn-uber-lot-driver {
    display: flex;
    width: 100%;
    max-width: 480px;
    margin: 12px auto 6px auto;
    padding: 14px 20px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(255, 184, 0, 0.18) 0%, rgba(255, 149, 0, 0.25) 100%);
    border: 1.5px solid rgba(255, 214, 10, 0.5);
    color: #ffd60a;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.2px;
    box-shadow: 0 6px 20px rgba(255, 184, 0, 0.15);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.btn-uber-lot-driver:hover {
    background: linear-gradient(135deg, rgba(255, 184, 0, 0.28) 0%, rgba(255, 149, 0, 0.35) 100%);
    border-color: rgba(255, 214, 10, 0.8);
    box-shadow: 0 8px 24px rgba(255, 184, 0, 0.25);
    color: #ffffff;
}

.btn-uber-lot-driver:active {
    transform: scale(0.97);
    opacity: 0.9;
}

.status-error-text {
    font-size: 0.8rem;
    color: var(--apple-red);
    margin-top: 6px;
}

/* Segmented Control iOS Style */
.ios-segmented-control {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 14px;
    padding: 3px;
    display: flex;
    border: 1px solid var(--border-color);
}

.segment-btn {
    flex: 1;
    background: transparent;
    border: none;
    border-radius: 11px;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.9rem;
    padding: 10px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
}

.segment-btn.active {
    background: var(--bg-card);
    color: #FFFFFF;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255,255,255,0.05);
}

/* Premium Card Panels */
.premium-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.035);
    backdrop-filter: blur(22px) saturate(150%);
    -webkit-backdrop-filter: blur(22px) saturate(150%);
}

.card-header-slim {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-title-text {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.card-subtitle-text {
    font-size: 0.75rem;
    color: var(--apple-blue);
    cursor: pointer;
}

.card-body-slim {
    padding: 12px;
}

/* Forecast 24h custom style */
.forecast-bars-container {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 16px 4px 4px 4px;
    align-items: flex-end;
    height: 100px;
}

.forecast-bars-container::-webkit-scrollbar {
    display: none;
}

.forecast-bar-wrapper {
    flex: 1;
    min-width: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    cursor: pointer;
}

.forecast-bar-pill {
    width: 8px;
    border-radius: 100px;
    background: linear-gradient(180deg, var(--bar-color, var(--apple-blue)) 0%, rgba(var(--apple-blue-rgb), 0.1) 100%);
    transition: height 0.4s cubic-bezier(0.4, 0, 0.2, 1), transform 0.2s ease;
}

.forecast-bar-wrapper:hover .forecast-bar-pill {
    transform: scaleX(1.3);
    filter: brightness(1.2);
}

.forecast-bar-time {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 6px;
    font-weight: 500;
}

.forecast-tooltip {
    position: absolute;
    top: -24px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.85);
    border: 1px solid var(--border-color);
    color: white;
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 4px;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
    white-space: nowrap;
    z-index: 10;
}

/* Adjust first and last column tooltips to prevent clipping at the screen edges */
.forecast-bar-wrapper:first-child .forecast-tooltip {
    left: 0;
    transform: none;
}

.forecast-bar-wrapper:last-child .forecast-tooltip {
    left: auto;
    right: 0;
    transform: none;
}

.forecast-bar-wrapper:hover .forecast-tooltip {
    opacity: 1;
}

/* Input Fields & Search Wrappers */
.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 2px 2px 2px 12px;
    transition: border-color 0.2s ease;
}

.search-input-wrapper:focus-within {
    border-color: var(--apple-blue);
    background: rgba(255, 255, 255, 0.07);
}

.search-icon-left {
    color: var(--text-muted);
    font-size: 1rem;
    margin-right: 8px;
}

.search-input {
    background: transparent;
    border: none;
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
    outline: none;
    width: 100%;
    padding: 8px 0;
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-action-btn {
    background: var(--apple-blue);
    border: none;
    border-radius: 11px;
    color: white;
    font-weight: 700;
    font-size: 0.8rem;
    padding: 6px 12px;
    transition: opacity 0.2s;
}

.search-action-btn:hover {
    opacity: 0.9;
}

.btn-premium-gps {
    background: rgba(10, 132, 255, 0.1);
    border: 1px solid rgba(10, 132, 255, 0.25);
    color: var(--apple-blue);
    border-radius: 14px;
    font-weight: 700;
    font-size: 0.85rem;
    width: 100%;
    padding: 10px;
    transition: all 0.2s;
}

.btn-premium-gps:hover {
    background: rgba(10, 132, 255, 0.18);
}

/* View toggle line */
.view-toggle-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-view-toggle {
    background: transparent;
    border: none;
    color: var(--apple-blue);
    font-size: 0.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
}

.view-toggle-info {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* List group / choices modal */
.choices-container .list-group-item {
    background: transparent;
    color: white;
    border-bottom: 1px solid var(--border-color);
    padding: 16px;
    transition: background 0.2s;
}

.choices-container .list-group-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* Flight Cards - premium iOS look */
.flights-list-wrapper {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.flight-card {
    background: linear-gradient(145deg, rgba(20, 28, 49, 0.84) 0%, rgba(9, 13, 27, 0.76) 100%);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 16px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.035);
    transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.25s ease;
}

.flight-card:hover {
    background-color: var(--bg-card-hover);
    border-color: rgba(var(--status-color-rgb), 0.3);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28), 0 0 26px rgba(var(--status-color-rgb), 0.055);
    transform: translateY(-2px);
}

.flight-card:active {
    transform: scale(0.992);
}

/* Restored premium board entrance: one calm reveal per airport/mode. */
.flight-card.board-enter {
    animation: flight-card-enter 0.72s cubic-bezier(0.22, 1, 0.36, 1) both;
    animation-delay: calc(var(--card-index, 0) * 55ms);
}

@keyframes flight-card-enter {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.985);
        filter: saturate(0.75);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: saturate(1);
    }
}

/* Status indicator bar on the left */
.flight-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 4px;
    background-color: var(--status-color, var(--apple-blue));
}

.flight-card-main {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

.flight-route-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-shrink: 0;
}

.flight-time-box {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.flight-time {
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.5px;
}

.flight-time-tag {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--status-color, var(--text-muted));
    text-transform: uppercase;
}

.flight-route {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.route-arrow {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.flight-number-box {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    text-align: right;
    flex-grow: 1;
    min-width: 0;
}

.flight-number {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main);
    max-width: 100%;
}

.primary-flight {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-main);
}

.codeshare-flights {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 500;
    display: block;
    line-height: 1.2;
    margin-top: 2px;
    word-break: break-all;
}

.airline-name {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.flight-card-details {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.detail-pill {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.city-pill {
    background: rgba(255,255,255, 0.02);
}

.term-pill {
    border-color: rgba(10, 132, 255, 0.15);
    color: var(--apple-blue);
}

.exit-time-badge {
    background: rgba(10, 132, 255, 0.15);
    color: var(--apple-blue);
    border-color: rgba(10, 132, 255, 0.3);
    font-weight: 700;
}

/* Pulsing Status Badges */
.status-badge {
    margin-left: auto;
    border-radius: 100px;
    padding: 4px 12px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    background: rgba(var(--status-color-rgb), 0.12);
    color: var(--status-color);
    border: 1px solid rgba(var(--status-color-rgb), 0.2);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.pulse-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: currentColor;
    display: inline-block;
    animation: status-ring-pulse 1.8s infinite ease-out;
}

@keyframes status-ring-pulse {
    0% { opacity: 0.55; box-shadow: 0 0 0 0 currentColor; }
    55% { opacity: 1; box-shadow: 0 0 0 5px transparent; }
    100% { opacity: 0.55; box-shadow: 0 0 0 0 transparent; }
}

/* Quiet rail on every card; only imminent arrivals move and turn green. */
.flight-progress-container {
    height: 3px;
    background: rgba(255,255,255,0.06);
    border-radius: 100px;
    margin-top: 14px;
    position: relative;
    overflow: hidden;
    contain: paint;
    transform: translateZ(0);
}

.progress-bar-glow {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 42%;
    border-radius: 100px;
    background: linear-gradient(90deg, transparent 0%, rgba(var(--apple-green-rgb), 0.58) 38%, var(--apple-green) 72%, transparent 100%);
    box-shadow: 0 0 12px rgba(var(--apple-green-rgb), 0.58);
    transform: translate3d(-125%, 0, 0);
    will-change: transform;
    animation: bar-glow-anim 2.7s infinite linear;
    animation-delay: calc(var(--motion-index, 0) * -170ms);
    animation-play-state: paused;
    opacity: 0;
}

.flight-card.arriving-soon .flight-progress-container {
    background: rgba(var(--apple-green-rgb), 0.12);
}

.flight-card.arriving-soon .progress-bar-glow {
    opacity: 1;
}

.flight-card.arriving-soon.motion-visible .progress-bar-glow {
    animation-play-state: running;
}

@keyframes bar-glow-anim {
    0% { transform: translate3d(-125%, 0, 0); }
    100% { transform: translate3d(345%, 0, 0); }
}

/* Special indicators */
.heavy-card {
    background: linear-gradient(135deg, rgba(255, 214, 10, 0.03) 0%, var(--bg-card) 100%);
}
.vip-card {
    background: linear-gradient(135deg, rgba(191, 90, 242, 0.05) 0%, var(--bg-card) 100%);
    border-color: rgba(191, 90, 242, 0.2);
}

.special-tag {
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    padding: 1px 5px;
    border-radius: 4px;
    margin-right: 4px;
    display: inline-block;
}

.heavy-tag {
    background: var(--apple-gold);
    color: black;
}

.vip-tag {
    background: var(--apple-purple);
    color: white;
    box-shadow: 0 0 8px rgba(191, 90, 242, 0.4);
}

/* Set dynamic values based on statuses */
.row-status-landed {
    --status-color: var(--apple-gray);
    --status-color-rgb: 142, 142, 147;
    opacity: 0.75;
}

.row-status-scheduled {
    --status-color: var(--apple-blue);
    --status-color-rgb: 10, 132, 255;
}

.row-status-en-route,
.row-status-active {
    --status-color: var(--apple-green);
    --status-color-rgb: 48, 209, 88;
}

.row-status-delayed {
    --status-color: var(--apple-gold);
    --status-color-rgb: 255, 214, 10;
}

.row-status-cancelled {
    --status-color: var(--apple-red);
    --status-color-rgb: 255, 69, 58;
}

/* Floating Action Button (FAB) */
.fab-refresh {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--apple-blue);
    border: none;
    color: white;
    font-size: 1.4rem;
    box-shadow: 0 6px 16px rgba(10, 132, 255, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.2s, background-color 0.2s;
    z-index: 90;
}

.fab-refresh:active {
    transform: scale(0.9);
}

/* Modals */
.premium-modal {
    background: #0f1629;
    border: 1px solid var(--border-color);
    border-radius: 24px;
    color: white;
}

.premium-modal .modal-header {
    border-bottom: 1px solid var(--border-color);
}

.premium-modal .modal-footer {
    border-top: 1px solid var(--border-color);
}

/* Rain warning badge plate */
.rain-warning-plate {
    background: rgba(255, 69, 58, 0.08);
    border: 1px solid rgba(255, 69, 58, 0.15);
    border-radius: 12px;
    padding: 10px 14px;
    color: var(--apple-red);
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Footer & Admin styling */
.app-footer {
    margin-top: 40px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.75rem;
}

.api-fuel-card {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 12px;
}

.api-fuel-title {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.api-fuel-val {
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
}

.progress-slim {
    height: 4px;
    background: rgba(255,255,255,0.06);
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar-slim {
    height: 100%;
    background: var(--apple-green);
    border-radius: 10px;
    transition: width 0.3s ease;
}

.api-fuel-today {
    font-size: 0.65rem;
    color: var(--text-muted);
}

@media (max-width: 576px) {
    .main-container {
        padding: 12px 8px;
    }
    .flight-time {
        font-size: 1.25rem;
    }
    .primary-flight {
        font-size: 0.95rem;
    }
    .codeshare-flights {
        font-size: 0.68rem;
    }
    .flight-card {
        padding: 12px;
    }
    .flight-card-details {
        gap: 6px;
    }
    .detail-pill {
        padding: 3px 8px;
        font-size: 0.7rem;
    }
    .status-badge {
        font-size: 0.7rem;
        padding: 3px 10px;
    }
}

.has-live-map {
    cursor: pointer;
}
.has-live-map:hover {
    border-color: rgba(10, 132, 255, 0.4);
}
.custom-plane-icon {
    background: transparent !important;
    border: none !important;
}

/* iOS Bottom Sheet Drawer */
.premium-drawer {
    position: fixed;
    bottom: -100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
    z-index: 1050;
    padding: 16px 20px 24px 20px;
    transition: bottom 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.5);
    max-width: 800px;
    margin: 0 auto;
}

.premium-drawer.open {
    bottom: 0;
}

.drawer-handle {
    width: 36px;
    height: 5px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    margin: 0 auto 12px auto;
}

.drawer-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: white;
    margin: 0;
}

.drawer-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
    margin: 2px 0 0 0;
}

.drawer-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1040;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.drawer-backdrop.open {
    opacity: 1;
    visibility: visible;
}

.stat-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
}

.stat-value {
    font-size: 1rem;
    color: white;
    font-weight: 700;
}

/* Premium Highlight for Long-Haul Flights */
.long-haul-card {
    border-color: rgba(255, 179, 0, 0.35) !important;
    background: linear-gradient(135deg, rgba(255, 179, 0, 0.04) 0%, rgba(9, 13, 22, 0.95) 100%) !important;
    box-shadow: 0 4px 20px rgba(255, 179, 0, 0.05);
}
.long-haul-card:hover {
    border-color: rgba(255, 179, 0, 0.6) !important;
    box-shadow: 0 4px 25px rgba(255, 179, 0, 0.08);
}

/* Fullscreen Drawer mode */
.premium-drawer.full-screen {
    top: 0 !important;
    bottom: 0 !important;
    border-radius: 0 !important;
    max-width: 100% !important;
    height: 100% !important;
    display: flex;
    flex-direction: column;
}

.premium-drawer.full-screen .drawer-body {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.premium-drawer.full-screen #drawerMap {
    flex: 1 !important;
    height: 100% !important;
    min-height: 300px;
}

/* Bridge Alerts and Water Radar */
.bridge-alert-card {
    background: rgba(255, 69, 58, 0.08);
    border: 1px solid rgba(255, 69, 58, 0.25);
    border-radius: 16px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 15px rgba(255, 69, 58, 0.05);
    animation: slideInDown 0.3s ease-out;
}
.bridge-alert-card.info-alert {
    background: rgba(255, 214, 10, 0.06);
    border-color: rgba(255, 214, 10, 0.2);
    box-shadow: 0 4px 15px rgba(255, 214, 10, 0.03);
}
.bridge-alert-icon {
    font-size: 1.5rem;
    color: var(--apple-red);
}
.bridge-alert-card.info-alert .bridge-alert-icon {
    color: var(--apple-gold);
}
.bridge-alert-content {
    flex: 1;
}
.bridge-alert-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: white;
    margin: 0;
}
.bridge-alert-desc {
    font-size: 0.74rem;
    color: var(--text-muted);
    margin: 2px 0 0 0;
    line-height: 1.3;
}
.water-radar-section {
    animation: fadeIn 0.3s ease-out;
}
@keyframes slideInDown {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* The upper dashboard keeps the same layout and enters like the old premium build. */
.info-badge-bar,
.current-airport-section,
.mode-selector-section,
.forecast-section,
.search-controls-section,
.view-toggle-bar {
    animation: dashboard-enter 0.72s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.current-airport-section { animation-delay: 45ms; }
.mode-selector-section { animation-delay: 90ms; }
.forecast-section { animation-delay: 135ms; }
.search-controls-section { animation-delay: 180ms; }
.view-toggle-bar { animation-delay: 225ms; }

@keyframes dashboard-enter {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}

.forecast-bar-pill {
    transform-origin: bottom;
    animation: forecast-bar-rise 0.68s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes forecast-bar-rise {
    from { opacity: 0.2; transform: scaleY(0.08); }
    to { opacity: 1; transform: scaleY(1); }
}

/* Nu Stadium / Miami Freedom Park traffic radar */
.stadium-pill {
    color: #ff87d7;
    border-color: rgba(255, 55, 199, 0.32);
    background: linear-gradient(135deg, rgba(255, 55, 199, 0.13), rgba(10, 132, 255, 0.09));
}

.stadium-promo-btn {
    border-color: rgba(255, 55, 199, 0.35);
    color: #ff87d7;
    background: rgba(255, 55, 199, 0.08);
}

#stadiumPromoText {
    margin-left: 4px;
    color: #ffb5e7;
    font-size: 0.75rem;
    font-weight: 700;
}

.stadium-demand-card {
    padding: 14px 16px;
    border: 1px solid rgba(255, 55, 199, 0.35);
    border-radius: 16px;
    background: linear-gradient(145deg, rgba(255, 55, 199, 0.09), rgba(10, 132, 255, 0.055));
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.16);
}

.stadium-demand-card.is-active {
    border-color: rgba(255, 69, 58, 0.55);
    background: linear-gradient(145deg, rgba(255, 69, 58, 0.12), rgba(255, 159, 10, 0.07));
}

.stadium-schedule-btn {
    border-radius: 16px;
    white-space: nowrap;
}

.stadium-source-text,
.stadium-modal-source {
    font-size: 0.7rem;
    line-height: 1.4;
}

.stadium-accent {
    color: #ff87d7;
}

.stadium-driver-note {
    padding: 10px 12px;
    border: 1px solid rgba(255, 159, 10, 0.24);
    border-radius: 12px;
    background: rgba(255, 159, 10, 0.08);
    color: #ffd1a1;
    font-size: 0.8rem;
    line-height: 1.45;
}

.stadium-schedule-list {
    display: flex;
    max-height: 390px;
    flex-direction: column;
    gap: 9px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.stadium-event-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.035);
}

.stadium-event-item.is-active {
    border-color: rgba(255, 69, 58, 0.5);
    background: rgba(255, 69, 58, 0.08);
}

.stadium-event-date {
    color: #ff9fdf;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.25px;
    text-transform: uppercase;
}

.stadium-event-title {
    margin-top: 2px;
    color: #fff;
    font-size: 0.88rem;
    font-weight: 750;
}

.stadium-event-competition {
    margin-top: 2px;
    color: var(--text-muted);
    font-size: 0.7rem;
}

.stadium-event-time {
    flex: 0 0 auto;
    padding: 5px 9px;
    border: 1px solid rgba(10, 132, 255, 0.28);
    border-radius: 10px;
    color: #7fc2ff;
    background: rgba(10, 132, 255, 0.08);
    font-size: 0.74rem;
    font-weight: 800;
    text-align: center;
}

@media (max-width: 430px) {
    .stadium-event-item {
        align-items: flex-start;
    }
    .stadium-demand-card .card-title-text {
        font-size: 0.82rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .info-badge-bar,
    .current-airport-section,
    .mode-selector-section,
    .forecast-section,
    .search-controls-section,
    .view-toggle-bar,
    .flight-card.board-enter,
    .forecast-bar-pill,
    .pulse-dot,
    .progress-bar-glow,
    .bridge-alert-card,
    .water-radar-section {
        animation: none !important;
    }
}


/* iOS WebView login controls must remain a full, tappable native input. */
.login-input {
    display: block;
    width: 100%;
    min-height: 48px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 12px;
    color: #ffffff;
    font-size: 17px;
    line-height: 22px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    pointer-events: auto;
    touch-action: manipulation;
}
.login-input:focus {
    border-color: var(--apple-blue);
    box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.22);
    background: rgba(255, 255, 255, 0.1);
}


.login-feedback {
    min-height: 1.25rem;
    margin: 0.35rem 0 0;
    font-size: 0.86rem;
    font-weight: 600;
}
.login-feedback.success { color: #40d68a; }
.login-feedback.error { color: #ff6961; }

html { overscroll-behavior-y: contain; }
#pullRefreshStatus {
    position: fixed;
    top: calc(70px + env(safe-area-inset-top, 0px));
    left: 50%;
    transform: translateX(-50%);
    width: max-content;
    max-width: calc(100vw - 32px);
    padding: 12px 18px;
    border: 1px solid #5280a0;
    border-radius: 20px;
    color: #fff;
    background: #152a40;
    box-shadow: 0 6px 24px #0006;
    z-index: 1040;
    font-size: 14px;
    text-align: center;
    pointer-events: none;
}
#pullRefreshStatus[hidden] { display: none; }

/* First-screen driver decision. No blur or perpetual animation on iPhone. */
.demand-hero {
    --demand-accent: #7ca6cb;
    position: relative;
    overflow: hidden;
    isolation: isolate;
    margin: 0 0 24px;
    padding: 24px;
    border: 1px solid #3d5369;
    border-radius: 26px;
    background: linear-gradient(135deg, #16283b, #0c192b);
    color: #f5f7fa;
    text-align: left;
}
.demand-hero--high {
    --demand-accent: #ffd36a;
    border-color: #c88a25;
    background: radial-gradient(ellipse at top right, #704619 0, transparent 65%),
        linear-gradient(135deg, #332711, #171e2a 80%);
    box-shadow: 0 12px 36px #ffb72e18, inset 0 1px #ffe3a340;
}
.demand-hero--high::before {
    content: '';
    position: absolute;
    pointer-events: none;
    z-index: -1;
    inset: 0;
    background: linear-gradient(110deg, transparent 30%, #ffe8ac14 50%, transparent 70%);
    transform: translateX(-100%);
    animation: demand-reveal 2.8s ease-out 2;
}
.demand-hero--moderate { --demand-accent: #66e0c0; border-color: #287b70; }
.demand-hero-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.demand-hero-location { font-size: 12px; font-weight: 800; letter-spacing: 2px; color: var(--demand-accent); }
.demand-hero-badge {
    padding: 4px 9px;
    border: 1px solid currentColor;
    border-radius: 20px;
    color: var(--demand-accent);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1px;
}
.demand-hero-title {
    margin: 16px 0 8px;
    color: var(--demand-accent);
    font-size: clamp(25px, 6.5vw, 38px);
    line-height: 1.12;
    font-weight: 900;
    letter-spacing: -1px;
}
.demand-hero-reason { font-size: 15px; line-height: 1.45; color: #edf1f7; }
.demand-hero-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 16px 0 12px; }
.demand-hero-metrics:empty { display: none; }
.demand-hero-metric { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.demand-hero-metric strong { font-size: 28px; line-height: 1; font-weight: 800; }
.demand-hero-metric span { font-size: 12px; line-height: 1.3; color: #bdc7d5; }
.demand-hero-action { margin-top: 12px; font-size: 14px; font-weight: 700; color: var(--demand-accent); }
.demand-hero-route {
    display: block;
    width: 100%;
    min-height: 46px;
    margin: 12px 0 10px;
    padding: 11px 12px;
    border: 0;
    border-radius: 14px;
    background: var(--demand-accent);
    color: #102031;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    touch-action: manipulation;
}
.demand-hero-route:focus-visible { outline: 3px solid white; outline-offset: 3px; }
.demand-hero-route:active { opacity: .85; }
.demand-hero-note { font-size: 12px; line-height: 1.4; color: #bdc7d5; }
.demand-hero-details { margin-top: 10px; color: #bdc7d5; font-size: 12px; line-height: 1.5; }
.demand-hero-details summary { min-height: 32px; padding-top: 6px; cursor: pointer; }
.demand-hero-details p { margin: 8px 0 0; }
@keyframes demand-reveal { to { transform: translateX(100%); } }
@media (max-width: 430px) {
    .demand-hero { padding: 18px; border-radius: 22px; }
    .demand-hero-metric { gap: 6px; }
}
@media (prefers-reduced-motion: reduce) {
    .demand-hero--high::before { animation: none; }
}
