:root {
    --primary-glow: rgba(56, 189, 248, 0.35);
    --accent-cyan: #38bdf8;
    --accent-blue: #0284c7;
    --glass-bg: rgba(15, 23, 42, 0.78);
    --glass-border: rgba(255, 255, 255, 0.18);
    --glass-card-inner: rgba(30, 41, 59, 0.65);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--text-main);
    overflow-x: hidden;
    background-color: #0f172a;
    -webkit-tap-highlight-color: transparent;
}

/* Full Bleed Background Image with Parallax & Soft Ken Burns Animation */
.bg-container {
    position: fixed;
    top: -5%;
    left: -5%;
    width: 110%;
    height: 110%;
    z-index: -2;
    overflow: hidden;
    pointer-events: none;
}

.bg-layer {
    width: 100%;
    height: 100%;
    background: url('../images/barvalappen.webp') no-repeat center center;
    background-size: cover;
    animation: ken-burns 30s ease-in-out infinite alternate;
    will-change: transform;
    transition: filter 0.5s ease, transform 0.1s ease-out;
}

@keyframes ken-burns {
    0% { transform: scale(1.0) translate(0, 0); }
    100% { transform: scale(1.08) translate(-1%, -1%); }
}

/* Overlay for optimal readability */
.bg-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 30%, rgba(14, 165, 233, 0.18), transparent 70%),
                linear-gradient(180deg, rgba(15, 23, 42, 0.55) 0%, rgba(15, 23, 42, 0.88) 100%);
    z-index: -1;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* Lightbox Photo Modal */
.photo-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(1rem, 4vw, 2rem);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.photo-modal.active {
    opacity: 1;
    pointer-events: auto;
}

.photo-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.photo-modal-content {
    position: relative;
    z-index: 10;
    max-width: 900px;
    width: 100%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    transform: scale(0.92);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.modal-close-btn {
    position: absolute;
    top: -3.5rem;
    right: 0;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(8px);
    transition: background 0.2s, transform 0.2s;
}

.modal-close-btn:hover, .modal-close-btn:active {
    background: var(--accent-cyan);
    color: #0f172a;
    transform: scale(1.08);
}

.photo-modal-img-wrap {
    width: 100%;
    max-height: 70vh;
    border-radius: 1.25rem;
    overflow: hidden;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: #000;
}

.photo-modal-img-wrap img {
    width: 100%;
    height: 100%;
    max-height: 70vh;
    object-fit: contain;
    display: block;
}

.photo-modal-caption {
    margin-top: 0.85rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: #cbd5e1;
    text-align: center;
}

/* Ambient Canvas overlay for subtle floating water bubbles */
#bubbles-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* Main Wrapper with Safe Area Padding for mobile notches */
.page-wrapper {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: clamp(1.25rem, 4vw, 2.5rem) 1.25rem;
    padding-top: calc(clamp(1.25rem, 4vw, 2.5rem) + env(safe-area-inset-top, 0px));
    padding-bottom: calc(clamp(1.25rem, 4vw, 2.5rem) + env(safe-area-inset-bottom, 0px));
}

/* Header */
.header {
    opacity: 0;
    transform: translateY(-20px);
    text-align: center;
    width: 100%;
}

.location-badge-link {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.location-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.45rem 1.25rem;
    border-radius: 9999px;
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(12px);
    font-size: clamp(0.75rem, 2.5vw, 0.875rem);
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--accent-cyan);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.header-logo-icon {
    filter: drop-shadow(0 2px 6px rgba(56, 189, 248, 0.4));
    transition: transform 0.3s ease;
}

.location-badge:hover .header-logo-icon {
    transform: scale(1.12) rotate(-5deg);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #10b981;
    box-shadow: 0 0 10px #10b981;
    animation: pulse-ring 2s infinite;
}

@keyframes pulse-ring {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Main Container & Layout */
.card-container {
    width: 100%;
    max-width: 520px;
    margin: clamp(1rem, 3vh, 2rem) 0;
    perspective: 1000px;
}

.temp-card {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: clamp(1.5rem, 5vw, 2.25rem);
    padding: 0;
    text-align: center;
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6),
                inset 0 1px 1px rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
    transition: box-shadow 0.3s ease, transform 0.1s ease-out;
}

.temp-card:hover {
    box-shadow: 0 30px 60px -12px rgba(14, 165, 233, 0.3),
                inset 0 1px 1px rgba(255, 255, 255, 0.3);
}

/* Hero Framed Image Header inside Card */
.card-image-hero {
    position: relative;
    width: 100%;
    height: clamp(140px, 25vh, 190px);
    overflow: hidden;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    cursor: pointer;
}

.card-image-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.card-image-hero:hover img {
    transform: scale(1.08);
}

.image-hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.2) 0%, rgba(15, 23, 42, 0.85) 100%);
}

/* Image Action Badges */
.image-caption-badge {
    position: absolute;
    bottom: 0.85rem;
    left: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    border-radius: 9999px;
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    font-size: clamp(0.7rem, 2.2vw, 0.75rem);
    font-weight: 600;
    color: #e2e8f0;
}

.expand-img-btn {
    position: absolute;
    top: 0.85rem;
    right: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.85rem;
    min-height: 36px;
    border-radius: 9999px;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: var(--text-main);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    backdrop-filter: blur(8px);
    transition: background 0.2s, transform 0.2s;
}

.expand-img-btn:hover, .expand-img-btn:active {
    background: var(--accent-blue);
    transform: scale(1.05);
}

/* Card Content Area */
.card-body {
    padding: clamp(1.25rem, 4vw, 2rem) clamp(1.25rem, 5vw, 2rem) clamp(1.75rem, 5vw, 2.25rem) clamp(1.25rem, 5vw, 2rem);
    position: relative;
    z-index: 1;
}

.card-title {
    font-size: clamp(0.75rem, 2.5vw, 0.875rem);
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.35rem;
}

/* Hero Temperature Number - Responsive Fluid Clamp */
.temp-display {
    position: relative;
    display: inline-flex;
    align-items: flex-start;
    justify-content: center;
    font-family: 'Outfit', sans-serif;
    font-size: clamp(3.75rem, 15vw, 5.5rem);
    font-weight: 800;
    line-height: 1;
    background: linear-gradient(180deg, #ffffff 30%, var(--accent-cyan) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 10px 30px rgba(56, 189, 248, 0.35);
    margin: 0.25rem 0 0.5rem 0;
}

.unit {
    font-size: clamp(1.75rem, 6vw, 2.5rem);
    font-weight: 600;
    margin-left: 0.2rem;
    margin-top: 0.4rem;
    color: var(--accent-cyan);
    -webkit-text-fill-color: var(--accent-cyan);
}

/* Badges Row (Status & Trend & Last Updated) */
.badge-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    margin-top: 0.6rem;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 1rem;
    border-radius: 1rem;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.25);
    color: #7dd3fc;
    font-weight: 600;
    font-size: clamp(0.8rem, 2.8vw, 0.9rem);
}

.trend-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.9rem;
    border-radius: 1rem;
    background: rgba(14, 165, 233, 0.15);
    border: 1px solid rgba(56, 189, 248, 0.3);
    color: var(--accent-cyan);
    font-weight: 700;
    font-size: clamp(0.8rem, 2.8vw, 0.9rem);
}

.timestamp-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.9rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-muted);
    font-weight: 500;
    font-size: clamp(0.75rem, 2.5vw, 0.82rem);
}

/* Expandable Toggle Button */
.details-toggle-container {
    margin-top: 1.25rem;
    display: flex;
    justify-content: center;
}

.details-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.65rem 1.45rem;
    border-radius: 9999px;
    background: rgba(30, 41, 59, 0.85);
    border: 1px solid rgba(56, 189, 248, 0.3);
    color: var(--text-main);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    backdrop-filter: blur(12px);
    transition: background 0.3s ease, border-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.details-toggle-btn:hover {
    background: var(--accent-blue);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(2, 132, 199, 0.4);
}

.toggle-icon {
    will-change: transform;
}

/* Expandable Container - Powered by GSAP physics & CSS transitions */
.expandable-details {
    height: 0;
    opacity: 0;
    overflow: hidden;
    margin-top: 0;
    transition: margin-top 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: height, opacity;
}

.expandable-details.open {
    margin-top: 1.25rem;
}

/* Quick Stats Bar */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 0.75rem;
    text-align: left;
}

.stat-item {
    background: var(--glass-card-inner);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    padding: 0.75rem 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.stat-item:hover {
    transform: translateY(-2px);
    border-color: rgba(56, 189, 248, 0.3);
}

.stat-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.stat-value {
    font-family: 'Outfit', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: #ffffff;
}

/* Analytics / Chart Section */
.chart-section {
    margin-top: 1.25rem;
    background: var(--glass-card-inner);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1.25rem;
    padding: 1rem;
}

.chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.85rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.chart-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.chart-tabs {
    display: flex;
    gap: 0.35rem;
    background: rgba(15, 23, 42, 0.6);
    padding: 0.25rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.chart-tab-btn {
    border: none;
    background: transparent;
    color: var(--text-muted);
    padding: 0.35rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chart-tab-btn.active {
    background: var(--accent-blue);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(2, 132, 199, 0.4);
}

.chart-container-box {
    position: relative;
    width: 100%;
    height: 190px;
}

/* Maintenance & Seasonal Notice Banner Styles */
.status-notice {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin: 1rem 0 0.5rem 0;
    padding: 0.85rem 1.1rem;
    border-radius: 1.25rem;
    text-align: left;
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.notice-maintenance {
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.35);
    color: #fde68a;
}

.notice-winter {
    background: rgba(14, 165, 233, 0.12);
    border: 1px solid rgba(14, 165, 233, 0.35);
    color: #bae6fd;
}

.notice-icon {
    font-size: 1.5rem;
    line-height: 1;
    flex-shrink: 0;
}

.notice-title {
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 0.15rem;
}

.notice-desc {
    font-size: 0.78rem;
    opacity: 0.88;
    line-height: 1.3;
}

/* Animated Wave visual inside card bottom */
.wave-box {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 35px;
    overflow: hidden;
    opacity: 0.35;
    pointer-events: none;
}

.wave-svg {
    width: 200%;
    height: 100%;
    animation: wave-slide 8s linear infinite;
}

@keyframes wave-slide {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* Footer Info */
.footer {
    opacity: 0;
    transform: translateY(20px);
    width: 100%;
    max-width: 520px;
    text-align: center;
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
    padding: 0.85rem 1.25rem;
    border-radius: 1.25rem;
    font-size: clamp(0.8rem, 2.6vw, 0.85rem);
    color: var(--text-muted);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.5rem 0.75rem;
}

.footer a {
    color: var(--accent-cyan);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.4rem;
    border-radius: 0.5rem;
}

.footer a:hover, .footer a:active {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

.social-icon {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

/* Mobile & Small Screen Optimizations */
@media (max-width: 480px) {
    .photo-modal-content {
        max-height: 80vh;
    }
    .modal-close-btn {
        top: -3rem;
        right: 0;
        width: 40px;
        height: 40px;
    }
    .footer {
        border-radius: 1rem;
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
