/* Apple Weather Style - Zagreb Voda */
/* Mobile-first: 375px base */

:root {
    /* Colors - Dark theme with blue tints */
    --bg-primary: #0a1628;
    --bg-secondary: #0f1d32;
    --bg-card: rgba(255, 255, 255, 0.08);
    --bg-card-hover: rgba(255, 255, 255, 0.12);
    
    /* Text */
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.5);
    
    /* Status colors */
    --excellent: #30d158;
    --good: #64d2ff;
    --warning: #ffd60a;
    --danger: #ff453a;
    
    /* Gradients */
    --gradient-excellent: linear-gradient(180deg, #4FB8E8 0%, #2C7DA0 50%, #1B4965 100%);
    --gradient-good: linear-gradient(180deg, #48BFA3 0%, #2D8B72 50%, #1A5142 100%);
    --gradient-warning: linear-gradient(180deg, #E8A54F 0%, #B07D3E 50%, #6B4D28 100%);
    --gradient-danger: linear-gradient(180deg, #D06050 0%, #8B3A30 50%, #4D1F1A 100%);
    
    /* Typography - iOS system font */
    --font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
    
    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    
    /* Border radius */
    --radius-sm: 12px;
    --radius-md: 16px;
    --radius-lg: 24px;
    
    /* Safe areas for iOS */
    --safe-top: env(safe-area-inset-top, 20px);
    --safe-bottom: env(safe-area-inset-bottom, 20px);
}

/* Reset & Base */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.4;
    overflow-x: hidden;
    min-height: 100vh;
    min-height: 100dvh;
}

/* ===== OUTSIDE ZAGREB BANNER ===== */
.outside-banner {
    display: none;
    align-items: center;
    gap: var(--spacing-sm);
    background: rgba(255, 149, 0, 0.15);
    border-bottom: 1px solid rgba(255, 149, 0, 0.3);
    padding: var(--spacing-md);
    font-size: 0.8rem;
    color: #ff9500;
}

.outside-banner.active {
    display: flex;
}

.outside-icon {
    font-size: 1rem;
    flex-shrink: 0;
}

.outside-text {
    flex: 1;
    line-height: 1.4;
}

.outside-close {
    background: none;
    border: none;
    color: #ff9500;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.25rem;
    opacity: 0.7;
}

.outside-close:hover {
    opacity: 1;
}

.app {
    max-width: 430px;
    margin: 0 auto;
    padding-bottom: calc(var(--safe-bottom) + 20px);
}

/* ===== HERO SECTION ===== */
.hero {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: var(--spacing-xl) var(--spacing-md);
    padding-top: calc(var(--safe-top) + 60px);
    text-align: center;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background: var(--gradient-excellent);
    z-index: -1;
    transition: background 0.8s ease;
}

.hero-bg::before {
    content: '';
    position: absolute;
    top: 15%;
    left: 50%;
    transform: translateX(-50%);
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(79, 184, 232, 0.45) 0%, transparent 70%);
    filter: blur(80px);
    animation: pulse 4s ease-in-out infinite;
}

.hero-bg.quality-excellent::before {
    background: radial-gradient(circle, rgba(79, 184, 232, 0.45) 0%, transparent 70%);
}

.hero-bg.quality-good::before {
    background: radial-gradient(circle, rgba(72, 191, 163, 0.45) 0%, transparent 70%);
}

.hero-bg.quality-acceptable::before {
    background: radial-gradient(circle, rgba(232, 165, 79, 0.45) 0%, transparent 70%);
}

.hero-bg.quality-poor::before {
    background: radial-gradient(circle, rgba(208, 96, 80, 0.45) 0%, transparent 70%);
}

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

/* ===== FLOATING BUBBLES ===== */
.bubble {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    animation: floatUp linear infinite;
}

.bubble-1 {
    width: 12px;
    height: 12px;
    left: 15%;
    bottom: -12px;
    opacity: 0.15;
    animation-duration: 12s;
    animation-delay: 0s;
}

.bubble-2 {
    width: 8px;
    height: 8px;
    left: 40%;
    bottom: -8px;
    opacity: 0.1;
    animation-duration: 15s;
    animation-delay: 2s;
}

.bubble-3 {
    width: 14px;
    height: 14px;
    left: 65%;
    bottom: -14px;
    opacity: 0.12;
    animation-duration: 11s;
    animation-delay: 4s;
}

.bubble-4 {
    width: 6px;
    height: 6px;
    left: 80%;
    bottom: -6px;
    opacity: 0.18;
    animation-duration: 14s;
    animation-delay: 1s;
}

.bubble-5 {
    width: 10px;
    height: 10px;
    left: 30%;
    bottom: -10px;
    opacity: 0.1;
    animation-duration: 16s;
    animation-delay: 6s;
}

@keyframes floatUp {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: var(--bubble-opacity, 0.12);
    }
    90% {
        opacity: var(--bubble-opacity, 0.12);
    }
    100% {
        transform: translateY(-100vh) translateX(20px);
        opacity: 0;
    }
}

/* ===== WATER WAVES ===== */
.hero-waves {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.wave {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 200%;
    height: 100%;
}

.wave-1 {
    animation: waveMove1 8s ease-in-out infinite;
    opacity: 0.9;
}

.wave-2 {
    animation: waveMove2 10s ease-in-out infinite;
    opacity: 0.7;
}

.wave-3 {
    animation: waveMove3 12s ease-in-out infinite;
    opacity: 0.5;
}

@keyframes waveMove1 {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(-25%); }
}

@keyframes waveMove2 {
    0%, 100% { transform: translateX(-10%); }
    50% { transform: translateX(-30%); }
}

@keyframes waveMove3 {
    0%, 100% { transform: translateX(-5%); }
    50% { transform: translateX(-20%); }
}

.hero-content {
    margin-bottom: var(--spacing-xl);
    position: relative;
    z-index: 1;
}

.hero-location {
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 4px;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.hero-zone {
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--text-muted);
    margin-bottom: var(--spacing-sm);
    letter-spacing: 0.3px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.hero-score {
    font-size: 8rem;
    font-weight: 200;
    line-height: 1;
    letter-spacing: -4px;
    margin-bottom: var(--spacing-xs);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.hero-status {
    font-size: 1.75rem;
    font-weight: 500;
    color: var(--excellent);
    margin-bottom: var(--spacing-sm);
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.hero-bg.quality-excellent ~ .hero-content .hero-status {
    color: #30d158;
}

.hero-bg.quality-good ~ .hero-content .hero-status {
    color: #64d2ff;
}

.hero-bg.quality-acceptable ~ .hero-content .hero-status {
    color: #ffd60a;
}

.hero-bg.quality-poor ~ .hero-content .hero-status {
    color: #ff453a;
}

.hero-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.hero-details {
    display: flex;
    justify-content: center;
    gap: var(--spacing-lg);
    margin-top: var(--spacing-xl);
    padding: var(--spacing-md) var(--spacing-lg);
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 1;
}

.detail-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.detail-value {
    font-size: 1.5rem;
    font-weight: 600;
}

.detail-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hero-measurement-date {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: var(--spacing-md);
    position: relative;
    z-index: 1;
}

.scroll-hint {
    position: absolute;
    bottom: calc(var(--safe-bottom) + 30px);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 0.85rem;
    animation: bounce 2s ease-in-out infinite;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: opacity 0.2s ease;
}

.scroll-hint:hover {
    opacity: 0.8;
}

.scroll-hint:active {
    opacity: 0.6;
}

.scroll-arrow {
    width: 24px;
    height: 24px;
    border-left: 2px solid var(--text-muted);
    border-bottom: 2px solid var(--text-muted);
    transform: rotate(-45deg);
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(8px); }
}

/* ===== SECTIONS ===== */
.section-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xs);
    padding: 0 var(--spacing-md);
}

.section-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    padding: 0 var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

/* ===== ZONES SECTION ===== */
.zones-section {
    padding: var(--spacing-xl) 0;
}

.zones-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    padding: 0 var(--spacing-md);
}

.zone-card {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.08);
    cursor: pointer;
    transition: all 0.2s ease;
}

.zone-card:active {
    transform: scale(0.98);
    background: var(--bg-card-hover);
}

.zone-score {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
    border-radius: 50%;
    flex-shrink: 0;
}

.zone-card[data-quality="excellent"] .zone-score {
    background: rgba(48, 209, 88, 0.2);
    color: var(--excellent);
}

.zone-card[data-quality="good"] .zone-score {
    background: rgba(100, 210, 255, 0.2);
    color: var(--good);
}

.zone-card[data-quality="warning"] .zone-score {
    background: rgba(255, 214, 10, 0.2);
    color: var(--warning);
}

.zone-card[data-quality="danger"] .zone-score {
    background: rgba(255, 69, 58, 0.2);
    color: var(--danger);
}

.zone-info {
    flex: 1;
    min-width: 0;
}

.zone-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.zone-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.zone-status {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    border-radius: 50%;
    flex-shrink: 0;
}

.zone-card[data-quality="excellent"] .zone-status,
.zone-card[data-quality="good"] .zone-status {
    background: rgba(48, 209, 88, 0.2);
    color: var(--excellent);
}

.zone-card[data-quality="warning"] .zone-status {
    background: rgba(255, 214, 10, 0.2);
    color: var(--warning);
}

/* ===== PARAMS SECTION ===== */
.params-section {
    padding: var(--spacing-xl) 0;
}

.params-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-sm);
    padding: 0 var(--spacing-md);
}

.param-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: var(--spacing-md);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.param-icon {
    font-size: 1.5rem;
    margin-bottom: 4px;
}

.param-value {
    font-size: 1.75rem;
    font-weight: 600;
}

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

.param-range {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ===== TIMELINE SECTION ===== */
.timeline-section {
    padding: var(--spacing-xl) 0;
}

.timeline {
    padding: 0 var(--spacing-md);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.timeline-item {
    display: flex;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.timeline-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 48px;
}

.timeline-date .day {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
}

.timeline-date .month {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.timeline-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
}

.timeline-title {
    font-size: 0.95rem;
    font-weight: 500;
}

.timeline-result {
    font-size: 0.85rem;
}

.timeline-result.good {
    color: var(--excellent);
}

.timeline-result.warning {
    color: var(--warning);
}

/* ===== FOOTER ===== */
.app-footer {
    text-align: center;
    padding: var(--spacing-xl) var(--spacing-md);
    color: var(--text-muted);
    font-size: 0.8rem;
}

.app-footer p {
    margin: 4px 0;
}

/* ===== ZONE DETAIL PANEL ===== */
.panel-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 100;
}

.panel-overlay.active {
    opacity: 1;
    visibility: visible;
}

.zone-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: 430px;
    margin: 0 auto;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
    z-index: 101;
    max-height: 85vh;
    overflow-y: auto;
}

.zone-panel.active {
    transform: translateY(0);
}

.panel-handle {
    width: 36px;
    height: 5px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    margin: 12px auto;
}

.panel-content {
    padding: var(--spacing-md) var(--spacing-lg);
    padding-bottom: calc(var(--safe-bottom) + 24px);
}

.panel-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.panel-subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-lg);
}

.panel-score {
    display: flex;
    align-items: baseline;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
}

.panel-score .score-value {
    font-size: 4rem;
    font-weight: 200;
    color: var(--excellent);
}

.panel-score .score-label {
    font-size: 1.25rem;
    color: var(--excellent);
}

/* Panel Chart */
.panel-chart {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.chart-title {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: var(--spacing-sm);
}

.panel-params {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
}

.panel-param {
    display: flex;
    align-items: center;
    padding: var(--spacing-md);
    background: var(--bg-card);
    border-radius: var(--radius-sm);
}

.panel-param .pp-name {
    flex: 1;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.panel-param .pp-value {
    font-size: 1rem;
    font-weight: 600;
    margin-right: var(--spacing-md);
}

.panel-param .pp-status {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 0.8rem;
}

.panel-param .pp-status.good {
    background: rgba(48, 209, 88, 0.2);
    color: var(--excellent);
}

.panel-param .pp-status.ok {
    background: rgba(255, 214, 10, 0.2);
    color: #ffd60a;
}

.panel-param .pp-status.bad {
    background: rgba(255, 69, 58, 0.2);
    color: #ff453a;
}

.panel-param .pp-status.unknown {
    background: rgba(99, 99, 102, 0.2);
    color: #636366;
}

.panel-param .pp-expand {
    margin-left: var(--spacing-sm);
    font-size: 0.7rem;
    color: var(--text-muted);
    transition: transform 0.2s ease;
}

.panel-param-wrap {
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.panel-param-wrap .panel-param {
    cursor: pointer;
    transition: background 0.2s ease;
}

.panel-param-wrap .panel-param:hover {
    background: var(--bg-card-hover);
}

.panel-param-wrap.expanded .pp-expand {
    transform: rotate(180deg);
}

.pp-info {
    max-height: 0;
    overflow: hidden;
    padding: 0 var(--spacing-md);
    background: rgba(255, 255, 255, 0.03);
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.panel-param-wrap.expanded .pp-info {
    max-height: 200px;
    padding: var(--spacing-md);
}

.panel-param-wrap:not(.expanded) .pp-info {
    padding-top: 0;
    padding-bottom: 0;
}

.pp-info-range {
    font-size: 0.85rem;
    color: var(--accent-blue);
    margin: 0 0 8px 0;
}

.pp-info-why {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.4;
}

/* Panel Explanation */
.panel-explanation {
    margin-bottom: var(--spacing-lg);
}

.explanation-toggle {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md);
    background: var(--bg-card);
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.95rem;
    cursor: pointer;
}

.toggle-icon {
    transition: transform 0.3s ease;
}

.explanation-toggle.active .toggle-icon {
    transform: rotate(180deg);
}

.explanation-content {
    display: none;
    padding: var(--spacing-md);
    background: var(--bg-card);
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    margin-top: 1px;
}

.explanation-content.active {
    display: block;
}

.explanation-item {
    margin-bottom: var(--spacing-md);
}

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

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

.explanation-item p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Panel Health Advice */
.panel-health {
    display: flex;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background: rgba(48, 209, 88, 0.1);
    border: 1px solid rgba(48, 209, 88, 0.3);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-lg);
}

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

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

.health-text p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.panel-health.warning {
    background: rgba(255, 214, 10, 0.1);
    border-color: rgba(255, 214, 10, 0.3);
}

.panel-health.warning .health-text strong {
    color: var(--warning);
}

.panel-updated {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: var(--spacing-lg);
}

.panel-close {
    width: 100%;
    padding: var(--spacing-md);
    background: var(--bg-card);
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.panel-close:active {
    background: var(--bg-card-hover);
}

/* ===== DATA INFO POPUP ===== */
.hero-measurement-date {
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: opacity 0.2s ease;
}

.hero-measurement-date:hover {
    opacity: 0.8;
}

.data-info-popup {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.data-info-popup.active {
    opacity: 1;
    visibility: visible;
}

.popup-content {
    background: rgba(30, 40, 55, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 16px;
    width: calc(100% - 48px);
    max-width: 320px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.data-info-popup.active .popup-content {
    transform: scale(1);
}

.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.popup-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.popup-close {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.popup-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.popup-body {
    padding: 16px 20px;
}

.popup-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.popup-row:last-child {
    border-bottom: none;
}

.popup-label {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.popup-value {
    font-size: 0.9rem;
    color: var(--text-primary);
    font-weight: 500;
}

/* ===== PARAMETER DETAIL POPUP ===== */
.param-popup {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    padding: 20px;
}

.param-popup.active {
    opacity: 1;
    visibility: visible;
}

.param-popup-content {
    background: rgba(25, 35, 50, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    width: 100%;
    max-width: 360px;
    padding: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
    position: relative;
}

.param-popup.active .param-popup-content {
    transform: scale(1) translateY(0);
}

.param-popup-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--text-secondary);
    font-size: 1.4rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.param-popup-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.param-popup-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.param-popup-icon {
    font-size: 2.5rem;
}

.param-popup-title h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.param-popup-title .param-popup-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #30d158;
    margin-top: 4px;
}

.param-popup-range {
    font-size: 0.9rem;
    color: var(--text-muted);
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    margin-bottom: 20px;
}

.param-popup-section {
    margin-bottom: 16px;
}

.param-popup-section:last-child {
    margin-bottom: 0;
}

.param-popup-section h4 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 0 0 8px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.param-popup-section p {
    font-size: 0.95rem;
    color: var(--text-primary);
    line-height: 1.5;
    margin: 0;
}

/* Make param cards clickable */
.param-card {
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease;
}

.param-card:hover {
    transform: translateY(-2px);
    background: var(--bg-card-hover);
}

.param-card:active {
    transform: scale(0.98);
}

.param-more {
    font-size: 0.7rem;
    color: var(--accent-blue);
    margin-top: 6px;
    opacity: 0.8;
}

/* Status indicator dot */
.param-value-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 6px currentColor;
}

.status-dot.good {
    background: #30d158;
    color: #30d158;
}

.status-dot.ok {
    background: #ffd60a;
    color: #ffd60a;
}

.status-dot.bad {
    background: #ff453a;
    color: #ff453a;
}

.status-dot.unknown {
    background: #636366;
    color: #636366;
    box-shadow: none;
}

/* ===== SMOOTH SCROLL ===== */
html {
    scroll-behavior: smooth;
}

/* ===== SCORE INFO BUTTON ===== */
.hero-score-wrap {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 0.25rem;
}

.score-info-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    margin-top: 1.5rem;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.score-info-btn:hover {
    opacity: 1;
}

/* ===== SCORE INFO MODAL ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-lg);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    max-width: 400px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    padding: var(--spacing-xl);
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: var(--spacing-md);
    right: var(--spacing-md);
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    line-height: 1;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-lg);
}

.modal-method {
    font-size: 0.9rem;
    font-weight: 600;
    color: #64d2ff;
    margin-bottom: var(--spacing-sm);
}

.modal-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: var(--spacing-lg);
}

.modal-formula {
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
    text-align: center;
}

.formula-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: var(--spacing-xs);
}

.formula {
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 0.9rem;
    color: var(--excellent);
}

.modal-factors {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
}

.factor {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.factor-name {
    background: #64d2ff;
    color: #0a1628;
    font-weight: 700;
    font-size: 0.8rem;
    padding: 0.3rem 0.6rem;
    border-radius: 8px;
    min-width: 2.2rem;
    text-align: center;
}

.factor-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.modal-limits-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

.modal-limits {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-lg);
}

.modal-limits span {
    background: rgba(255, 255, 255, 0.05);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.modal-scale {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: var(--spacing-md);
}

.scale-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

.scale-item {
    font-size: 0.75rem;
    padding: 0.25rem 0;
    color: var(--text-secondary);
}

.scale-item.excellent { color: var(--excellent); }
.scale-item.good { color: var(--good); }
.scale-item.fair { color: #ffd60a; }
.scale-item.marginal { color: #ff9f0a; }
.scale-item.poor { color: var(--danger); }

/* ===== DESKTOP ADJUSTMENTS ===== */
@media (min-width: 768px) {
    .hero-score {
        font-size: 10rem;
    }
    
    .params-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .score-info-btn {
        font-size: 1.5rem;
        margin-top: 2.5rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .bubble, .hero-bg::before, .wave {
        animation: none !important;
    }
}
