/* Mobile PWA Styles - iOS Native Look */

:root {
    /* Modern indigo + cyan palette */
    --primary: #4F46E5;         /* Indigo 600 */
    --primary-dark: #3730A3;    /* Indigo 800 */
    --accent: #06B6D4;          /* Cyan 500 */
    --bg-primary: #0B1020;      /* Deep space */
    --bg-secondary: #12172A;    /* Card bg */
    --bg-tertiary: #1B2140;     /* Elevated bg */
    --text-primary: #E6EAF3;    /* Near-white */
    --text-secondary: #9AA3B2;  /* Muted */
    --border: #2A3458;          /* Subtle border */
    --success: #10B981;         /* Emerald */
    --warning: #F59E0B;         /* Amber */
    --danger: #EF4444;          /* Red */
    --info: #60A5FA;            /* Blue */

    --safe-area-top: env(safe-area-inset-top, 0px);
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
    --safe-area-left: env(safe-area-inset-left, 0px);
    --safe-area-right: env(safe-area-inset-right, 0px);
}

/* Light theme overrides */
.theme-light {
    --bg-primary: #F7F9FC;
    --bg-secondary: #FFFFFF;
    --bg-tertiary: #EEF2F6;
    --text-primary: #0F172A;
    --text-secondary: #475569;
    --border: #E2E8F0;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', 'Roboto', sans-serif;
    background:
            radial-gradient(1000px 600px at 120% -10%, rgba(79,70,229,0.25), transparent 60%),
            radial-gradient(800px 500px at -10% -10%, rgba(6,182,212,0.22), transparent 60%),
            var(--bg-primary);
        color: var(--text-primary);
        overflow-x: hidden;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
        overscroll-behavior: none;
}

/* Status Bar Spacer */
.status-bar-spacer {
    height: var(--safe-area-top);
    background: var(--bg-primary);
}

/* App Container */
.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-left: var(--safe-area-left);
    padding-right: var(--safe-area-right);
}

/* Header */
.mobile-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: linear-gradient(180deg, rgba(15,20,45,0.9), rgba(15,20,45,0.6));
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    backdrop-filter: blur(18px) saturate(160%);
    border-bottom: 1px solid var(--border);
    padding: 12px 16px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.app-icon {
    font-size: 28px;
}

.app-title {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.3px;
}

.header-right {
    display: flex;
    gap: 8px;
}

.icon-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    color: var(--primary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.icon-btn:active {
    background: var(--bg-tertiary);
    transform: scale(0.95);
}

/* Alert Banner */
.alert-banner {
    background: linear-gradient(135deg, var(--warning), #FF6B00);
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.alert-content {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.alert-icon {
    font-size: 20px;
}

.alert-text {
    font-size: 14px;
    font-weight: 500;
}

.alert-close {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 28px;
    cursor: pointer;
    padding: 0 8px;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 16px;
    padding-bottom: calc(80px + var(--safe-area-bottom));
    overflow-y: auto;
}

/* Cards */
.card {
    background: linear-gradient(180deg, rgba(18,23,42,0.95), rgba(18,23,42,0.85));
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
    border: 1px solid var(--border);
    box-shadow: 0 12px 24px rgba(0,0,0,0.25);
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.title-icon {
    font-size: 22px;
}

/* Risk Card */
.risk-card {
    background: linear-gradient(135deg, rgba(31,41,99,0.9) 0%, rgba(17,24,56,0.95) 100%);
}

.risk-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-secondary);
    animation: pulse 2s infinite;
}

.connection-status.connected .status-dot {
    background: var(--success);
}

.connection-status.error .status-dot {
    background: var(--danger);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.risk-display {
    display: flex;
    justify-content: center;
    margin: 32px 0;
}

.risk-circle {
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: radial-gradient(120px 120px at 50% 40%, rgba(255,255,255,0.06), rgba(0,0,0,0) 70%),
                linear-gradient(135deg, var(--bg-tertiary), var(--bg-primary));
    border: 4px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45);
}

.risk-circle::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    padding: 4px;
    background: conic-gradient(var(--success) 0 33%, var(--warning) 33% 66%, var(--danger) 66% 100%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0.9;
    transition: opacity 0.3s;
}

.risk-circle.low::before { background: var(--success); opacity: 1; }
.risk-circle.medium::before { background: var(--warning); opacity: 1; }
.risk-circle.high::before { background: var(--danger); opacity: 1; }

.risk-percentage {
    font-size: 54px;
    font-weight: 700;
    line-height: 1;
    background: linear-gradient(135deg, var(--primary), var(--info));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.risk-label {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 8px;
    font-weight: 500;
}

.risk-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 24px;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-tertiary);
    padding: 12px;
    border-radius: 12px;
}

.detail-icon {
    font-size: 24px;
}

.detail-info {
    flex: 1;
}

.detail-label {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.detail-value {
    font-size: 15px;
    font-weight: 600;
}

/* AI Card */
.ai-status {
    margin-bottom: 16px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.prediction-bar {
    background: var(--bg-tertiary);
    border-radius: 8px;
    height: 40px;
    position: relative;
    overflow: hidden;
    margin-bottom: 16px;
}

.bar-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--info));
    transition: width 0.5s ease;
    border-radius: 8px;
    width: 0%;
}

.bar-label {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
    height: 100%;
    font-size: 14px;
    font-weight: 600;
}

.prediction-result {
    background: var(--bg-tertiary);
    padding: 16px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
}

/* Quantum Prediction Section */
.quantum-prediction {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: 16px;
    margin-top: 16px;
    border: 1px solid rgba(100, 210, 255, 0.2);
}

.quantum-prediction .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.quantum-prediction .section-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.quantum-badge {
    background: linear-gradient(135deg, #64D2FF, #007AFF);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    color: #FFFFFF;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.quantum-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.quantum-metric {
    background: var(--bg-tertiary);
    padding: 12px;
    border-radius: 12px;
    text-align: center;
}

.quantum-metric .metric-label {
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.quantum-metric .metric-value {
    font-size: 20px;
    font-weight: 700;
    color: #64D2FF;
}

.qubit-states {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}

.qubit-state {
    background: linear-gradient(135deg, #007AFF, #0051D5);
    padding: 12px 8px;
    border-radius: 12px;
    text-align: center;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.qubit-icon {
    font-size: 14px;
    font-weight: 700;
    color: #FFFFFF;
}

.qubit-label {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Map Card */
.map-card {
    padding: 20px 0 0 0;
}

.map-card .card-title {
    padding: 0 20px;
}

.map-container {
    position: relative;
    height: 300px;
    border-radius: 12px;
    overflow: hidden;
    margin-top: 16px;
}

#map {
    width: 100%;
    height: 100%;
    background: var(--bg-tertiary);
}

.map-controls {
    position: absolute;
    bottom: 16px;
    right: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 500;
}

.map-btn {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: none;
    background: rgba(28, 28, 30, 0.95);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s;
}

.map-btn:active {
    transform: scale(0.95);
}

.layer-selector {
    padding: 16px 20px 20px 20px;
}

.layer-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.layer-option:last-child {
    border-bottom: none;
}

.layer-option input[type="checkbox"] {
    width: 24px;
    height: 24px;
    accent-color: var(--primary);
    cursor: pointer;
}

.layer-option label {
    flex: 1;
    font-size: 15px;
    cursor: pointer;
}

/* Activity Card */
.activity-feed {
    max-height: 300px;
    overflow-y: auto;
}

.activity-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    animation: fadeIn 0.3s ease-out;
}

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

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

.activity-time {
    color: var(--text-secondary);
    font-size: 12px;
    min-width: 60px;
}

.activity-text {
    flex: 1;
    line-height: 1.5;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(28, 28, 30, 0.95);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    backdrop-filter: blur(20px) saturate(180%);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-around;
    padding: 8px 0 calc(8px + var(--safe-area-bottom));
    z-index: 1000;
}

.nav-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 11px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.nav-btn svg {
    width: 24px;
    height: 24px;
    transition: transform 0.2s;
}

.nav-btn.active {
    color: var(--primary);
    text-shadow: 0 0 18px rgba(79,70,229,0.55);
}

/* Risk pulse based on level */
.risk-circle.low { box-shadow: 0 0 0 0 rgba(16,185,129,0.35); animation: pulseLow 2.4s infinite; }
.risk-circle.medium { box-shadow: 0 0 0 0 rgba(245,158,11,0.35); animation: pulseMed 2.0s infinite; }
.risk-circle.high { box-shadow: 0 0 0 0 rgba(239,68,68,0.35); animation: pulseHigh 1.6s infinite; }

@keyframes pulseLow { 0% { box-shadow: 0 0 0 0 rgba(16,185,129,0.45);} 70% { box-shadow: 0 0 0 20px rgba(16,185,129,0);} 100% { box-shadow: 0 0 0 0 rgba(16,185,129,0);} }
@keyframes pulseMed { 0% { box-shadow: 0 0 0 0 rgba(245,158,11,0.45);} 70% { box-shadow: 0 0 0 20px rgba(245,158,11,0);} 100% { box-shadow: 0 0 0 0 rgba(245,158,11,0);} }
@keyframes pulseHigh { 0% { box-shadow: 0 0 0 0 rgba(239,68,68,0.45);} 70% { box-shadow: 0 0 0 24px rgba(239,68,68,0);} 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0);} }

/* Env badge */
.env-badge {
    position: fixed;
    right: 10px;
    bottom: calc(70px + var(--safe-area-bottom));
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: rgba(17,24,56,0.82);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text-secondary);
    font-size: 12px;
    z-index: 1200;
}
.theme-light .env-badge { background: rgba(255,255,255,0.9); }
.env-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 10px var(--success); }

.nav-btn:active svg {
    transform: scale(0.9);
}

.bottom-safe-area {
    height: var(--safe-area-bottom);
    background: var(--bg-primary);
}

/* Loading States */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--border);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Touch Feedback */
.touchable {
    position: relative;
    overflow: hidden;
}

.touchable::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
}

.touchable:active::after {
    width: 200px;
    height: 200px;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px;
}

/* Responsive */
@media (min-width: 768px) {
    .app-container {
        max-width: 600px;
        margin: 0 auto;
    }
}

/* Landscape */
@media (orientation: landscape) and (max-height: 500px) {
    .risk-circle {
        width: 140px;
        height: 140px;
    }
    
    .risk-percentage {
        font-size: 36px;
    }
    
    .map-container {
        height: 250px;
    }
}

/* ==================== ROAD RISK & TRAFFIC STYLES ==================== */

/* Road Risk Markers */
.road-risk-marker {
    background: transparent !important;
    border: none !important;
    text-align: center;
}

.marker-icon {
    font-size: 24px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
    display: block;
    animation: pulse 2s infinite;
}

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

.bridge-marker .marker-icon {
    filter: drop-shadow(0 0 8px rgba(255, 59, 48, 0.8));
}

.overpass-marker .marker-icon {
    filter: drop-shadow(0 0 6px rgba(255, 149, 0, 0.8));
}

.tunnel-marker .marker-icon {
    filter: drop-shadow(0 0 4px rgba(255, 204, 0, 0.8));
}

/* Risk Popup */
.risk-popup h3 {
    color: var(--danger);
    font-size: 14px;
    margin-bottom: 8px;
    font-weight: 600;
}

.risk-popup p {
    font-size: 12px;
    margin: 4px 0;
    color: var(--text-primary);
}

.risk-popup strong {
    color: var(--primary);
}

/* Hazards Card */
.hazards-card {
    margin-bottom: 20px;
}

.hazards-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hazard-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: 12px;
    border-left: 4px solid;
}

.hazard-item.critical {
    border-color: var(--danger);
    background: linear-gradient(90deg, rgba(255, 59, 48, 0.1) 0%, var(--bg-tertiary) 100%);
}

.hazard-item.high {
    border-color: var(--warning);
    background: linear-gradient(90deg, rgba(255, 149, 0, 0.1) 0%, var(--bg-tertiary) 100%);
}

.hazard-item.medium {
    border-color: #FFD60A;
    background: linear-gradient(90deg, rgba(255, 214, 10, 0.1) 0%, var(--bg-tertiary) 100%);
}

.hazard-icon {
    font-size: 32px;
    line-height: 1;
    flex-shrink: 0;
}

.hazard-details {
    flex: 1;
}

.hazard-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.hazard-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.hazard-warning {
    font-size: 13px;
    color: var(--warning);
    font-weight: 500;
}

.no-hazards {
    text-align: center;
    padding: 40px 20px;
}

.success-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 12px;
}

.no-hazards p {
    color: var(--text-secondary);
    font-size: 14px;
}

.loading-text {
    text-align: center;
    padding: 30px 20px;
    color: var(--text-secondary);
    font-size: 14px;
}

/* Layer Selector Updates */
.layer-option label {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ========== SETTINGS MODAL ========== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background: var(--bg-secondary);
    border-radius: 20px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: modalSlideUp 0.3s ease;
}

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

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.modal-header h2 {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.modal-close:hover {
    background: var(--bg-tertiary);
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
}

/* Settings Sections */
.settings-section {
    padding: 24px;
    border-bottom: 1px solid var(--border);
}

.settings-section:last-child {
    border-bottom: none;
}

.settings-section-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.setting-item {
    margin-bottom: 16px;
}

.setting-item:last-child {
    margin-bottom: 0;
}

/* Toggle Switch */
.setting-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
}

.setting-label span:first-child {
    font-size: 15px;
    color: var(--text-primary);
}

.setting-label input[type="checkbox"] {
    display: none;
}

.toggle-switch {
    position: relative;
    width: 51px;
    height: 31px;
    background: var(--bg-tertiary);
    border-radius: 16px;
    transition: background 0.3s;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 27px;
    height: 27px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.setting-label input[type="checkbox"]:checked + .toggle-switch {
    background: var(--success);
}

.setting-label input[type="checkbox"]:checked + .toggle-switch::after {
    transform: translateX(20px);
}

/* Select Dropdown */
.setting-label-full {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.setting-label-full > span:first-child {
    font-size: 15px;
    color: var(--text-primary);
}

.setting-select {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 15px;
    width: 100%;
    cursor: pointer;
    outline: none;
    transition: background 0.2s;
}

.setting-select:hover {
    background: #3A3A3C;
}

.setting-select:focus {
    border-color: var(--primary);
}

/* Slider */
.setting-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--bg-tertiary);
    outline: none;
    margin: 8px 0;
    -webkit-appearance: none;
}

.setting-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.4);
}

.setting-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.4);
}

.slider-value {
    display: inline-block;
    margin-left: 8px;
    font-size: 14px;
    color: var(--primary);
    font-weight: 600;
}

/* About Section */
.about-item {
    background: var(--bg-tertiary);
    padding: 16px;
    border-radius: 12px;
}

.about-text {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
}

.about-text strong {
    color: var(--text-primary);
    display: block;
    margin-bottom: 4px;
}

.about-text small {
    font-size: 12px;
    color: var(--text-secondary);
    opacity: 0.7;
}

/* Button Styles */
.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 14px 24px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    width: 100%;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

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

/* Mobile Responsive */
@media (max-width: 480px) {
    .modal {
        padding: 0;
        align-items: flex-end;
    }
    
    .modal-content {
        max-width: 100%;
        border-radius: 20px 20px 0 0;
        max-height: 85vh;
    }
}

/* ========== BIFI CARD STYLES ========== */
.bifi-card {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

.bifi-display {
    display: flex;
    align-items: center;
    gap: 24px;
    margin: 20px 0;
}

.bifi-score-circle {
    position: relative;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 4px solid var(--primary);
    box-shadow: 0 0 20px rgba(0, 122, 255, 0.3);
}

.bifi-score {
    font-size: 42px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.bifi-max {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.bifi-level {
    flex: 1;
    font-size: 24px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bifi-interpretation {
    background: var(--bg-tertiary);
    padding: 16px;
    border-radius: 12px;
    margin: 16px 0;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
    border-left: 4px solid var(--primary);
}

.bifi-components {
    margin-top: 24px;
}

.component-bar {
    margin-bottom: 16px;
}

.component-bar:last-child {
    margin-bottom: 0;
}

.component-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.component-progress {
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 4px;
}

.component-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #00d4ff);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.component-value {
    font-size: 12px;
    color: var(--text-primary);
    font-weight: 600;
    text-align: right;
}

/* ========== QFPM CARD STYLES ========== */
.qfpm-card {
    background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
}

.qfpm-timeline {
    margin: 20px 0;
}

.forecast-item {
    margin-bottom: 20px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border-left: 4px solid transparent;
    transition: all 0.3s;
}

.forecast-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.forecast-time {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 500;
}

.forecast-probability {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.forecast-bar {
    height: 12px;
    background: var(--bg-tertiary);
    border-radius: 6px;
    overflow: hidden;
}

.forecast-fill {
    height: 100%;
    border-radius: 6px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
}

.qfpm-alert {
    background: rgba(255, 107, 0, 0.1);
    border: 1px solid rgba(255, 107, 0, 0.3);
    border-radius: 12px;
    padding: 16px;
    margin-top: 20px;
    font-size: 14px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ========== MESH NETWORK CARD STYLES ========== */
.mesh-card {
    background: linear-gradient(135deg, #134e5e 0%, #71b280 100%);
}

.mesh-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin: 20px 0;
}

.mesh-stat {
    text-align: center;
    padding: 16px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.mesh-stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.mesh-stat-label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mesh-message {
    background: rgba(255, 255, 255, 0.15);
    padding: 16px;
    border-radius: 12px;
    margin: 16px 0;
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
    text-align: center;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 14px 24px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    width: 100%;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

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

.btn-icon {
    font-size: 18px;
}

.btn-text {
    font-size: 15px;
}

/* Sensor markers on map */
.sensor-marker {
    width: 32px;
    height: 32px;
    background: rgba(0, 255, 136, 0.9);
    border: 3px solid white;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
    transition: transform 0.2s;
}

.sensor-marker:hover {
    transform: scale(1.2);
}

.sensor-marker.freeze-alert {
    background: rgba(255, 0, 0, 0.9);
    animation: pulse-alert 1.5s infinite;
}

@keyframes pulse-alert {
    0%, 100% {
        box-shadow: 0 2px 8px rgba(255, 0, 0, 0.3);
    }
    50% {
        box-shadow: 0 2px 20px rgba(255, 0, 0, 0.8);
    }
}

.sensor-popup {
    font-size: 13px;
}

.sensor-popup .popup-title {
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
}

.sensor-popup .popup-data {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 8px;
}

.sensor-popup .data-item {
    display: flex;
    flex-direction: column;
}

.sensor-popup .data-label {
    font-size: 11px;
    color: #666;
}

.sensor-popup .data-value {
    font-weight: 600;
    font-size: 14px;
}

/* QFPM Heatmap overlay */
.qfpm-heatmap-layer {
    opacity: 0.6;
    pointer-events: none;
}

.qfpm-grid-cell {
    transition: fill 0.5s ease;
}

/* Risk level colors */
.risk-minimal { color: #32CD32; }
.risk-low { color: #9ACD32; }
.risk-moderate { color: #FFD700; }
.risk-high { color: #FF4500; }
.risk-extreme { color: #8B0000; }

.bifi-minimal .bifi-score-circle { border-color: #32CD32; box-shadow: 0 0 20px rgba(50, 205, 50, 0.3); }
.bifi-low .bifi-score-circle { border-color: #9ACD32; box-shadow: 0 0 20px rgba(154, 205, 50, 0.3); }
.bifi-moderate .bifi-score-circle { border-color: #FFD700; box-shadow: 0 0 20px rgba(255, 215, 0, 0.3); }
.bifi-high .bifi-score-circle { border-color: #FF4500; box-shadow: 0 0 20px rgba(255, 69, 0, 0.3); }
.bifi-extreme .bifi-score-circle { border-color: #8B0000; box-shadow: 0 0 20px rgba(139, 0, 0, 0.3); }

/* ==================== NEW ACCURACY UPGRADE CARDS ==================== */

/* Overnight Freeze Prediction Card */
.overnight-card {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

.overnight-summary {
    margin: 20px 0;
}

.freeze-time-display {
    text-align: center;
    padding: 24px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    margin-bottom: 16px;
}

.freeze-time-label {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.freeze-time-value {
    font-size: 48px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 8px 0;
}

.freeze-countdown {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
}

.overnight-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.overnight-stat {
    background: rgba(255, 255, 255, 0.08);
    padding: 16px;
    border-radius: 12px;
    text-align: center;
}

.overnight-stat .stat-label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    margin-bottom: 6px;
}

.overnight-stat .stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.risk-badge {
    background: #10b981;
    color: white;
    padding: 12px 20px;
    border-radius: 10px;
    text-align: center;
    font-weight: 600;
    margin: 16px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.overnight-message {
    background: rgba(255, 255, 255, 0.1);
    padding: 14px;
    border-radius: 10px;
    font-size: 13px;
    color: var(--text-primary);
    text-align: center;
    margin-top: 16px;
}

/* Wet Pavement Warning Card */
.wet-pavement-card {
    background: linear-gradient(135deg, #0f2027 0%, #203a43 50%, #2c5364 100%);
}

.wet-pavement-status {
    margin: 20px 0;
    text-align: center;
}

.pavement-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 16px;
}

.indicator-circle {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 20px currentColor;
}

.indicator-text {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.risk-multiplier-display {
    text-align: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    margin: 16px 0;
}

.multiplier-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.multiplier-value {
    font-size: 36px;
    font-weight: 700;
    color: var(--text-primary);
}

.precipitation-info {
    padding: 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    margin-bottom: 16px;
}

.precip-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.precip-label {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
}

.precip-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.wet-pavement-warning {
    background: rgba(255, 255, 255, 0.1);
    padding: 14px;
    border-radius: 10px;
    font-size: 13px;
    text-align: center;
}

/* Real Road Temperature Card */
.road-temp-card {
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
}

.road-temp-display {
    margin: 20px 0;
}

.temp-main {
    text-align: center;
    padding: 24px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    margin-bottom: 16px;
}

.temp-value {
    font-size: 52px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.temp-source {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sensor-info {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.sensor-stat {
    background: rgba(255, 255, 255, 0.08);
    padding: 14px;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sensor-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
}

.sensor-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.confidence-badge {
    padding: 4px 10px;
    border-radius: 6px;
    color: white;
    font-size: 11px;
    text-transform: uppercase;
}

.temp-comparison {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    margin-bottom: 16px;
}

.comparison-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.comparison-label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
}

.comparison-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.road-temp-message {
    background: rgba(255, 255, 255, 0.1);
    padding: 14px;
    border-radius: 10px;
    font-size: 13px;
    text-align: center;
}

/* Precipitation Type Alert Card */
.precip-type-card {
    background: linear-gradient(135deg, #000428 0%, #004e92 100%);
}

.precip-current {
    margin: 20px 0;
}

.precip-type-display {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    margin-bottom: 16px;
}

.precip-icon {
    font-size: 48px;
}

.precip-type-text {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.precip-risk-badge {
    background: #10b981;
    color: white;
    padding: 12px 20px;
    border-radius: 10px;
    text-align: center;
    font-weight: 600;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.precip-forecast-hours {
    background: rgba(255, 255, 255, 0.08);
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 16px;
}

.forecast-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.hour-items {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.hour-item {
    background: rgba(255, 255, 255, 0.1);
    padding: 12px;
    border-radius: 10px;
    text-align: center;
}

.hour-time {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 6px;
}

.hour-type {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.precip-warning {
    background: rgba(255, 255, 255, 0.1);
    padding: 14px;
    border-radius: 10px;
    font-size: 13px;
    text-align: center;
}

/* Bridge Freeze Warning Card */
.bridge-card {
    background: linear-gradient(135deg, #232526 0%, #414345 100%);
}

.bridge-freeze-display {
    margin: 20px 0;
}

.bridge-temp-main {
    text-align: center;
    padding: 24px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    margin-bottom: 16px;
}

.bridge-label {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.bridge-freeze-temp {
    font-size: 48px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 8px 0;
}

.bridge-comparison {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.comparison-stat {
    background: rgba(255, 255, 255, 0.08);
    padding: 16px;
    border-radius: 12px;
    text-align: center;
}

.comparison-stat.danger-zone {
    background: rgba(239, 68, 68, 0.2);
    border: 2px solid rgba(239, 68, 68, 0.4);
}

.comparison-stat .stat-label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    margin-bottom: 6px;
}

.comparison-stat .stat-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.bridge-factors {
    background: rgba(255, 255, 255, 0.08);
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 16px;
}

.factor-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.factors-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.factor-item {
    font-size: 13px;
    color: var(--text-primary);
    padding: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.bridge-warning {
    background: rgba(255, 255, 255, 0.1);
    padding: 14px;
    border-radius: 10px;
    font-size: 13px;
    text-align: center;
}

/* ==================== END ACCURACY UPGRADE CARDS ==================== */

/* ==================== DATA VISUALIZATIONS ==================== */

.visualization-card {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    border: 1px solid rgba(102, 126, 234, 0.3);
}

.viz-controls {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin: 16px 0;
}

.btn-viz {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-viz:hover {
    background: rgba(102, 126, 234, 0.2);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.btn-viz.active {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-color: var(--primary);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.viz-icon {
    font-size: 24px;
}

.viz-label {
    text-align: center;
    line-height: 1.2;
}

.viz-info {
    font-size: 12px;
    color: var(--text-secondary);
    text-align: center;
    padding: 10px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
}

/* Forecast Chart Card */
.forecast-chart-card {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.1), rgba(6, 182, 212, 0.1));
    border: 1px solid rgba(79, 70, 229, 0.3);
}

#risk-forecast-canvas {
    width: 100%;
    height: 200px;
    margin: 16px 0;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.2);
}

.chart-legend {
    display: flex;
    justify-content: space-around;
    gap: 12px;
    margin-top: 16px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--text-secondary);
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.legend-dot.high {
    background: #EF4444;
}

.legend-dot.medium {
    background: #F59E0B;
}

.legend-dot.low {
    background: #10B981;
}

/* Comparison Card */
.comparison-card {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.1), rgba(16, 185, 129, 0.1));
    border: 1px solid rgba(6, 182, 212, 0.3);
}

.comparison-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.comparison-item {
    padding: 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    text-align: center;
}

.compare-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.compare-today {
    font-size: 24px;
    font-weight: 700;
    color: var(--accent);
    margin: 8px 0;
}

.compare-diff {
    font-size: 14px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
    display: inline-block;
    margin: 6px 0;
}

.compare-diff.higher,
.compare-diff.worse {
    background: rgba(239, 68, 68, 0.2);
    color: #EF4444;
}

.compare-diff.lower,
.compare-diff.better {
    background: rgba(16, 185, 129, 0.2);
    color: #10B981;
}

.compare-yesterday {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 6px;
}

/* Time-lapse Overlay */
#timelapse-overlay {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* Heatmap Layers (handled by Leaflet) */

/* Performance Indicators */
.battery-indicator {
    position: fixed;
    top: 60px;
    left: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 6px;
}

.battery-low {
    background: rgba(239, 68, 68, 0.9);
}

.battery-charging {
    background: rgba(16, 185, 129, 0.9);
}

/* Cache Status Indicator */
.cache-status {
    position: fixed;
    bottom: 80px;
    right: 10px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 10px;
    z-index: 9999;
}

/* ==================== END DATA VISUALIZATIONS ==================== */

/* ==================== VIZ TAB VIEW ==================== */

.viz-view {
    padding: calc(60px + var(--safe-area-top)) 0 calc(70px + var(--safe-area-bottom)) 0;
    min-height: 100vh;
    background: var(--bg-primary);
}

.viz-view-header {
    padding: 24px 20px;
    text-align: center;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.1), rgba(6, 182, 212, 0.1));
    border-bottom: 1px solid var(--border);
}

.viz-view-header h1 {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: var(--text-primary);
}

.viz-view-header p {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

.viz-view-content {
    padding: 16px;
}

.viz-section {
    margin-bottom: 16px;
}

.viz-toggle-btn {
    width: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 0;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
}

.viz-toggle-btn:hover {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.2), rgba(6, 182, 212, 0.2));
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(79, 70, 229, 0.3);
}

.viz-toggle-btn.active {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-color: var(--primary);
    box-shadow: 0 4px 20px rgba(79, 70, 229, 0.4);
}

.viz-btn-content {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
}

.viz-btn-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.viz-btn-text {
    flex: 1;
    text-align: left;
}

.viz-btn-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.viz-btn-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
}

.viz-btn-arrow {
    font-size: 24px;
    color: var(--text-secondary);
    transition: transform 0.3s ease;
}

.viz-toggle-btn.active .viz-btn-arrow {
    transform: rotate(90deg);
}

.viz-content {
    padding: 16px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 0 0 16px 16px;
    margin-top: -8px;
}

.viz-info-box {
    display: flex;
    gap: 12px;
    padding: 16px;
    background: rgba(6, 182, 212, 0.1);
    border: 1px solid rgba(6, 182, 212, 0.3);
    border-radius: 12px;
    margin-top: 24px;
}

.viz-info-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.viz-info-text {
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-secondary);
}

.viz-info-text strong {
    color: var(--accent);
    font-weight: 600;
}

.timelapse-controls {
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* ==================== END VIZ TAB VIEW ==================== */

/* ==================== DATA FRESHNESS INDICATORS ==================== */

.data-freshness-container {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    margin: 20px 0;
}

.freshness-header {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.freshness-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.freshness-item {
    display: grid;
    grid-template-columns: 32px 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border-radius: 12px;
    border-left: 3px solid var(--border);
}

.freshness-icon {
    font-size: 18px;
}

.freshness-source {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.freshness-age {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.freshness-warning {
    margin-top: 12px;
    padding: 12px 16px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 12px;
    font-size: 13px;
    color: var(--danger);
    line-height: 1.5;
}

/* ==================== END DATA FRESHNESS ==================== */

/* ==================== FEEDBACK SYSTEM ==================== */

.feedback-container {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    margin: 20px 0;
}

.feedback-header {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.feedback-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.feedback-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.feedback-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px;
    background: var(--bg-tertiary);
    border: 2px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    color: var(--text-primary);
}

.feedback-btn:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
}

.feedback-btn:active {
    transform: translateY(0);
}

.feedback-icon {
    font-size: 32px;
}

.feedback-label {
    font-size: 14px;
    font-weight: 600;
}

.feedback-dry:hover { border-color: #eab308; }
.feedback-wet:hover { border-color: #06b6d4; }
.feedback-icy:hover { border-color: #ef4444; }
.feedback-snow:hover { border-color: #a78bfa; }

.feedback-status {
    margin-top: 12px;
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    font-size: 13px;
    font-weight: 500;
    display: none;
}

.feedback-status-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.feedback-status-error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Nearby Reports */
.nearby-reports-container {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    margin: 20px 0;
}

.reports-header {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.reports-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.report-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: 12px;
}

.report-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.report-details {
    flex: 1;
}

.report-condition {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.report-meta {
    font-size: 12px;
    color: var(--text-secondary);
}

/* ==================== END FEEDBACK SYSTEM ==================== */
