@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

* {
    font-family: 'Inter', sans-serif;
}

body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    transition: all 0.5s ease;
    /* Förhindra layout shifts */
    min-height: 100vh;
    position: relative;
}

/* Väderbaserade teman */
.weather-sunny {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.5) 0%, rgba(245, 158, 11, 0.4) 50%, rgba(217, 119, 6, 0.3) 100%);
}

.weather-partly-cloudy {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.2) 0%, rgba(245, 158, 11, 0.15) 50%, rgba(217, 119, 6, 0.1) 100%);
    position: relative;
}

.weather-partly-cloudy::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.1);
    animation: partly-cloudy-overlay 8s ease-in-out infinite;
    pointer-events: none;
    z-index: 1;
}

@keyframes partly-cloudy-overlay {
    0%, 100% { 
        opacity: 0;
    }
    50% { 
        opacity: 1;
    }
}

.weather-cloudy {
    background: linear-gradient(135deg, #94a3b8 0%, #64748b 50%, #475569 100%);
}

.weather-rainy {
    background: linear-gradient(135deg, #475569 0%, #334155 50%, #1e293b 100%);
}

.weather-stormy {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 50%, #020617 100%);
}

.weather-snowy {
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 50%, #94a3b8 100%);
}

.weather-foggy {
    background: linear-gradient(135deg, #d1d5db 0%, #9ca3af 50%, #6b7280 100%);
}

/* Bakgrundskarta */
.background-map {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.3;
    pointer-events: none;
    /* Förhindra scroll-problem */
    transform: translateZ(0);
}

.background-map .leaflet-container {
    background: transparent !important;
}

/* Regndroppar */
.rain-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
    display: none;
    /* Förhindra scroll-problem */
    transform: translateZ(0);
    will-change: transform;
}

.rain-drop {
    position: absolute;
    width: 2px;
    height: 20px;
    background: linear-gradient(to bottom, transparent, rgba(255, 255, 255, 0.8));
    animation: rain-fall linear infinite;
}

@keyframes rain-fall {
    0% {
        transform: translateY(-100px);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(100vh);
        opacity: 0;
    }
}

/* Snöflingor */
.snow-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

/* Vattenyta med termometer */
.water-temp-item {
    position: relative;
    overflow: hidden;
}

.water-surface {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: none;
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    pointer-events: none;
}

.water-wave-svg {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 200%;
    height: 40px;
    z-index: 1;
    animation: wave-move 6s linear infinite;
}

@keyframes wave-move {
    0% { transform: translateX(0); }
    100% { transform: translateX(-200px); }
}

.floating-thermometer {
    position: relative;
    z-index: 2;
    animation: thermometer-bob 5s ease-in-out infinite;
    will-change: transform;
    margin-left: 12px;
    align-self: flex-end;
}

@keyframes thermometer-bob {
    0%, 100% { transform: translateY(0) rotate(-5deg); }
    25% { transform: translateY(-8px) rotate(2deg); }
    50% { transform: translateY(-12px) rotate(8deg); }
    75% { transform: translateY(-8px) rotate(2deg); }
}

.thermometer-icon-svg {
    width: 28px;
    height: 56px;
    display: block;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

/* Vattenstånd - flytande boj */
.water-level-item {
    position: relative;
    overflow: hidden;
}

.water-surface-level {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: none;
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    pointer-events: none;
}

.water-wave-level-svg {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 200%;
    height: 40px;
    z-index: 1;
    animation: wave-move-level 8s linear infinite;
}

@keyframes wave-move-level {
    0% { transform: translateX(0); }
    100% { transform: translateX(-200px); }
}

.measuring-stick {
    position: relative;
    z-index: 0;
    will-change: transform;
    margin-left: 12px;
    align-self: flex-end;
}

.stick-svg {
    width: 12px;
    height: 100px;
    display: block;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.2));
}

/* Lufttemperatur - pinne i vattnet med hängande termometer */
.air-temp-item {
    position: relative;
    overflow: hidden;
}

.water-surface-air {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100%;
    background: none;
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    pointer-events: none;
}

.water-wave-air-svg {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 200%;
    height: 40px;
    z-index: 1;
    animation: wave-move-air 12s linear infinite;
}

@keyframes wave-move-air {
    0% { transform: translateX(0); }
    100% { transform: translateX(-200px); }
}

.wave-path-air {
    animation: wave-ripple 8s ease-in-out infinite;
}

@keyframes wave-ripple {
    0%, 100% { 
        d: path("M0 20 Q 50 10 100 20 T 200 20 T 300 20 T 400 20 V40 H0 Z");
    }
    25% { 
        d: path("M0 20 Q 50 15 100 20 T 200 20 T 300 20 T 400 20 V40 H0 Z");
    }
    50% { 
        d: path("M0 20 Q 50 25 100 20 T 200 20 T 300 20 T 400 20 V40 H0 Z");
    }
    75% { 
        d: path("M0 20 Q 50 15 100 20 T 200 20 T 300 20 T 400 20 V40 H0 Z");
    }
}

.pole-container {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 5px;
    height: 100%;
    margin-left: 5px;
    margin-top: 60px;
}

.water-pole {
    width: 6px;
    height: 60%;
    background: linear-gradient(to bottom, #8b4513, #654321);
    border-radius: 3px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    position: absolute;
    bottom: -10px;
    left: 0;
}

.pole-top {
    position: absolute;
    top: 0;
    left: 0;
    width: 6px;
    height: 6px;
    background: #654321;
    border-radius: 3px 3px 0 0;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.pole-arm {
    position: absolute;
    top: 2px;
    right: -8px;
    width: 8px;
    height: 2px;
    background: #654321;
    border-radius: 1px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.hanging-thermometer {
    animation: thermometer-sway 4s ease-in-out infinite;
    will-change: transform;
    position: absolute;
    top: 8px;
    left: 6px;
    z-index: 3;
}

@keyframes thermometer-sway {
    0%, 100% { transform: translateX(0px) rotate(-1deg); }
    25% { transform: translateX(2px) rotate(1deg); }
    50% { transform: translateX(4px) rotate(2deg); }
    75% { transform: translateX(2px) rotate(1deg); }
}

.hanging-thermometer-svg {
    width: 16px;
    height: 32px;
    display: block;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.thermometer-bulb {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 16px;
    height: 16px;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    border: 2px solid rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.thermometer-tube {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 40px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 2px;
    overflow: hidden;
}

.thermometer-fluid {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 20px;
    background: linear-gradient(to top, #ef4444, #f97316);
    border-radius: 2px;
    transition: height 1s ease-in-out;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2);
}

.thermometer-scale {
    position: absolute;
    right: -25px;
    top: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    font-size: 8px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
}

.scale-mark {
    background: rgba(0, 0, 0, 0.3);
    padding: 1px 3px;
    border-radius: 2px;
    white-space: nowrap;
}

.water-ripples {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100%;
    pointer-events: none;
}

.ripple {
    position: absolute;
    bottom: 5px;
    left: 50%;
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    animation: ripple-expand 3s ease-out infinite;
}

.ripple-1 {
    animation-delay: 0s;
}

.ripple-2 {
    animation-delay: 1s;
}

.ripple-3 {
    animation-delay: 2s;
}

@keyframes ripple-expand {
    0% {
        transform: translateX(-50%) scale(0);
        opacity: 1;
    }
    100% {
        transform: translateX(-50%) scale(8);
        opacity: 0;
    }
}

.snowflake {
    position: absolute;
    color: white;
    font-size: 20px;
    animation: snow-fall linear infinite;
}

@keyframes snow-fall {
    0% {
        transform: translateY(-100px) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

/* Åska */
.lightning-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 3;
    display: none;
    /* Förhindra scroll-problem */
    transform: translateZ(0);
    will-change: transform;
}

.lightning {
    position: absolute;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.3);
    animation: lightning-flash 0.1s ease-out;
    display: none;
}

@keyframes lightning-flash {
    0% { opacity: 0; }
    50% { opacity: 1; }
    100% { opacity: 0; }
}

/* Moln */
.clouds-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
    display: none;
    /* Förhindra scroll-problem */
    transform: translateZ(0);
    will-change: transform;
}

.cloud {
    position: absolute;
    background: rgba(200, 200, 200, 0.4);
    border-radius: 100px;
    filter: blur(1px);
    box-shadow: 
        0 0 15px rgba(200, 200, 200, 0.2),
        inset 0 0 20px rgba(200, 200, 200, 0.15);
}

.cloud::before {
    content: '';
    position: absolute;
    top: -20%;
    left: 20%;
    width: 60%;
    height: 60%;
    background: rgba(180, 180, 180, 0.3);
    border-radius: 50%;
    filter: blur(2px);
}

.cloud::after {
    content: '';
    position: absolute;
    top: -10%;
    right: 15%;
    width: 50%;
    height: 50%;
    background: rgba(160, 160, 160, 0.25);
    border-radius: 50%;
    filter: blur(1.5px);
}

@keyframes cloud-drift-left {
    0% { transform: translateX(-200px); }
    100% { transform: translateX(calc(100vw + 200px)); }
}

@keyframes cloud-drift-right {
    0% { transform: translateX(calc(100vw + 200px)); }
    100% { transform: translateX(-200px); }
}

/* Dimma */
.fog-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
    display: none;
    /* Förhindra scroll-problem */
    transform: translateZ(0);
    will-change: transform;
}

.fog-layer {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 100px;
    animation: fog-drift linear infinite;
}

@keyframes fog-drift {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Huvudinnehåll */
.main-container {
    position: relative;
    z-index: 10;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    /* Förhindra layout shifts */
    transform: translateZ(0);
    /* Hantera sticky header */
    padding-top: 0;
}

.header {
    padding: 1.5rem;
    text-align: center;
    color: white;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Mörkare header för växlande molnighet */
.weather-partly-cloudy .header {
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(20px);
}

.weather-partly-cloudy .header.scrolled {
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(30px);
}

.header h1 {
    font-size: 4.5rem;
    font-weight: 800;
    margin: 0;
    line-height: 1;
}

.header.scrolled h1 {
    font-size: 2.5rem;
}

/* Ännu mindre titel vid scroll på mobil */
@media (max-width: 768px) {
    .header.scrolled h1 {
        font-size: 1.8rem;
    }
}

.header p {
    font-size: 1rem;
    opacity: 0.8;
    margin: 0.25rem 0 0 0;
    font-weight: 400;
    letter-spacing: 0.5px;
}

.header.scrolled p {
    font-size: 0.9rem;
    opacity: 0.7;
}

.data-panel {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(25px);
    border-radius: 24px;
    padding: 1.5rem;
    margin: 2rem;
    margin-top: 4rem;
    margin-bottom: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.15);
    text-align: center;
    /* Förhindra layout shifts */
    transform: translateZ(0);
    will-change: transform, filter;
    /* Smidigare animationer */
    transition: all 0.3s ease;
}

/* Container för data-panel */
.data-panel-container {
    width: 100%;
    display: flex;
    justify-content: center;
}

/* Begränsa bredd på större skärmar */
@media screen and (min-width: 768px) {
    .data-panel {
        max-width: 800px;
        width: 100%;
    }
}

@media screen and (min-width: 1024px) {
    .data-panel {
        max-width: 900px;
    }
}

@media screen and (min-width: 1440px) {
    .data-panel {
        max-width: 1000px;
    }
}

.data-panel:hover {
    background: rgba(0, 0, 0, 0.5);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
    transform: translateY(-2px);
}

.weather-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

@media screen and (max-width: 768px) {
    .weather-section {
        padding: 0.5rem;
        min-height: 80px;
    }
}

.weather-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.weather-icon-img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
}

.weather-temp {
    font-size: 2.25rem;
    font-weight: 700;
    color: white;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.weather-desc {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.95);
    font-weight: 500;
    text-align: center;
}

.data-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.data-item {
    text-align: center;
    padding: 0.75rem;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    min-height: 150px;
}

.data-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.data-icon-img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.3));
    opacity: 0.95;
}

.data-item:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.data-item.clickable {
    cursor: pointer;
    transition: all 0.3s ease;
}

.data-item.clickable:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.data-value {
    font-size: 2.25rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 0.25rem;
    color: #ffffff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.data-value-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 0.25rem;
}

.data-unit-small {
    font-size: 0.75rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    margin-top: -0.25rem;
    margin-bottom: 0.25rem;
}

.timestamp-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
    margin-top: -1rem;
    margin-bottom: 1rem;
}

.timestamp-item {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
    padding: 0.25rem;
}

.data-unit {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    margin-bottom: 0.25rem;
    text-align: center;
}

.data-timestamp {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 400;
    text-align: center;
    margin-bottom: 0.5rem;
}

.data-label-top {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.95);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.data-label {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.95);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.info-button {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.info-button:hover {
    transform: scale(1.1);
}

.info-icon {
    width: 16px;
    height: 16px;
    stroke: rgba(255, 255, 255, 0.6);
    stroke-width: 2;
    fill: none;
    transition: all 0.2s ease;
}

.info-button:hover .info-icon {
    stroke: rgba(255, 255, 255, 0.9);
}

/* Info Popup styles */
.info-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.info-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 24px;
    max-width: 650px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

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

.info-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.info-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #64748b;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: all 0.2s;
}

.info-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #475569;
}

.info-body {
    color: #374151;
    line-height: 1.6;
}

.info-body h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    margin: 16px 0 8px 0;
}

.info-body p {
    margin: 0 0 12px 0;
}

.info-body ul {
    margin: 8px 0 16px 0;
    padding-left: 20px;
}

.info-body li {
    margin-bottom: 6px;
}

.info-note {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 8px;
    padding: 12px;
    margin-top: 16px;
}

.info-note p {
    margin: 0;
    font-size: 0.9rem;
    color: #1e40af;
}

.water-level { 
    color: #ffffff; 
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}
.water-temp { 
    color: #ffffff; 
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}
.air-temp { 
    color: #ffffff; 
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.timestamp {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.85);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 0.75rem;
    margin-top: 0.5rem;
    font-weight: 400;
}

.history-button-container {
    display: flex;
    justify-content: center;
    margin-top: 1rem;
}

.history-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 12px;
    padding: 0.75rem 1.25rem;
    color: rgba(255, 255, 255, 0.95);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.history-button:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-1px);
    color: white;
}

.history-button:active {
    transform: translateY(0);
}

.history-icon {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

/* Väderbox */
.weather-box {
    display: none;
}

.weather-box:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.2),
        0 4px 12px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.weather-box-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.weather-box-header h2 {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.weather-box-main {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.weather-box-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 0.75rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.weather-box-svg {
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
    transition: transform 0.3s ease;
}

.weather-box-icon:hover .weather-box-svg {
    transform: scale(1.05);
}

.weather-box-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.weather-box-status {
    color: white;
    font-size: 1.25rem;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.weather-box-location {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    font-weight: 400;
}

/* Sidfot */
.footer {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 2rem 0 1rem 0;
    margin-top: 2rem;
    z-index: 10;
    position: relative;
}

/* På stora skärmar: flytta upp footern närmare men behåll lite scroll */
@media (min-width: 1024px) {
    .footer {
        margin-top: 3rem;
        position: relative;
    }
    
    .main-container {
        min-height: calc(100vh - 375px);
    }
    
    /* Mindre header på stora skärmar för att undvika scrollning */
    .header {
        padding: 1rem 1.5rem;
    }
    
    .header h1 {
        font-size: 3rem;
    }
    
    .header p {
        font-size: 0.9rem;
        margin: 0.15rem 0 0 0;
    }
    
    /* Inaktivera header scroll-effekt på stora skärmar */
    .header.scrolled {
        padding: 1rem 1.5rem;
    }
    
    .header.scrolled h1 {
        font-size: 3rem;
    }
    
    .header.scrolled p {
        font-size: 0.9rem;
        opacity: 0.8;
    }
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.footer-section h3 {
    color: white;
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.footer-section h4 {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.footer-section p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0;
}

.footer-bottom {
    text-align: center;
    padding-top: 1.5rem;
    margin-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.8rem;
    margin: 0;
    margin-bottom: 0.25rem;
}

.footer-bottom p:last-child {
    margin-bottom: 0;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
}

/* Historik Overlay styles */
.history-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.history-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 32px;
    max-width: 1000px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.history-title {
    font-size: 24px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 4px 0;
}

.history-info {
    font-size: 14px;
    color: #64748b;
    margin: 0;
    font-style: italic;
}

.history-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #64748b;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s;
}

.history-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #475569;
}

/* Flikar */
.history-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding-bottom: 16px;
}

.tab-button {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    padding: 12px 20px;
    border-radius: 12px;
    color: #64748b;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.tab-button:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #475569;
}

.tab-button.active {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    border-color: rgba(59, 130, 246, 0.2);
}

.tab-icon {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

/* Flikinnehåll */
.tab-content {
    position: relative;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

.chart-container {
    height: 400px;
    margin-bottom: 24px;
}

.temperature-toggles {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 12px;
}

.toggle-item {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 20px;
    background: rgba(0, 0, 0, 0.05);
    transition: all 0.2s;
}

.toggle-item:hover {
    background: rgba(0, 0, 0, 0.1);
}

.toggle-item input {
    width: 16px;
    height: 16px;
}

/* Responsiv design */
@media (max-width: 768px) {
    .header {
        padding: 1rem;
    }
    
    .header h1 {
        font-size: 2.2rem;
    }
    
    .header p {
        font-size: 0.8rem;
        margin: 0.1rem 0 0 0;
    }
    
    .weather-box {
        padding: 1.25rem;
    }
    
    .weather-box-content {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .weather-box-main {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .weather-box-svg {
        width: 48px;
        height: 48px;
    }
    
    .header.scrolled {
        padding: 0.5rem 1rem;
    }
    
    .header.scrolled h1 {
        font-size: 1.6rem;
    }
    
    .header.scrolled p {
        font-size: 0.7rem;
        margin: 0.05rem 0 0 0;
    }
    
    .data-panel {
        margin: 1rem;
        margin-top: 1rem;
        margin-bottom: 2rem;
        padding: 1rem;
    }
    
    .data-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .data-value {
        font-size: 2rem;
    }
    
    .data-item {
        padding: 0.5rem;
    }
    
    .weather-section {
        flex-direction: column;
        gap: 0.5rem;
        padding: 0.75rem;
    }
    
    .weather-icon-img {
        width: 36px;
        height: 36px;
        object-fit: contain;
    }
    
    .data-icon-img {
        width: 24px;
        height: 24px;
        object-fit: contain;
    }
    
    .weather-temp {
        font-size: 1.75rem;
    }
    
    .footer {
        padding: 1.5rem 0 1rem 0;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 0 1rem;
    }
    
    .footer-section h3 {
        font-size: 1.1rem;
    }
    
    .footer-section h4 {
        font-size: 0.9rem;
    }
    
    .footer-section p {
        font-size: 0.8rem;
    }
    
    .history-button {
        padding: 0.625rem 1rem;
        font-size: 0.8rem;
    }
    
    .history-icon {
        width: 16px;
        height: 16px;
    }
    
    .history-content {
        padding: 20px;
        margin: 10px;
    }
    
    .history-tabs {
        flex-direction: column;
        gap: 4px;
    }
    
    .tab-button {
        padding: 10px 16px;
        font-size: 13px;
    }
    
    .tab-icon {
        width: 16px;
        height: 16px;
    }
    
    .info-content {
        padding: 16px;
        margin: 10px;
    }
    
    .info-header h3 {
        font-size: 1.1rem;
    }
    
    .info-body h4 {
        font-size: 0.9rem;
    }
    
    .info-body p, .info-body li {
        font-size: 0.85rem;
    }
}

/* Extra små skärmar */
@media (max-width: 480px) {
    .header {
        padding: 0.75rem;
    }
    
    .header h1 {
        font-size: 1.8rem;
    }
    
    .header p {
        font-size: 0.75rem;
        margin: 0.05rem 0 0 0;
    }
    
    .header.scrolled {
        padding: 0.4rem 0.75rem;
    }
    
    .header.scrolled h1 {
        font-size: 1.4rem;
    }
    
    .header.scrolled p {
        font-size: 0.65rem;
        margin: 0.02rem 0 0 0;
    }
    
    .data-panel {
        margin: 0.75rem;
        margin-top: 1.5rem;
        margin-bottom: 1.5rem;
        padding: 0.75rem;
    }
}

/* Scroll-effekter - förenklad */
.scroll-parallax {
    will-change: transform;
    transform: translateZ(0); /* Aktivera hardware acceleration */
}

.scroll-fade {
    transition: opacity 0.3s ease-out;
}

/* Floating animation för bakgrundselement - reducerad intensitet */
.floating-bg {
    animation: float-slow 8s ease-in-out infinite;
}

@keyframes float-slow {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-5px) rotate(0.5deg); }
}

/* Scroll-indikator */
.scroll-indicator {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    z-index: 1000;
}

/* Dölj scroll-indikator på stora skärmar (desktop) */
@media (min-width: 1024px) {
    .scroll-indicator {
        display: none;
    }
}

.scroll-progress {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6, #ec4899);
    width: 0%;
    transition: width 0.1s ease-out;
}

/* Scroll-triggered animations - förenklad */
.scroll-trigger {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s ease-out;
}

.scroll-trigger.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Parallax layers - reducerad intensitet */
.parallax-layer-1 {
    transform: translateZ(-1px) scale(1.5);
}

.parallax-layer-2 {
    transform: translateZ(-2px) scale(2);
}

.parallax-layer-3 {
    transform: translateZ(-3px) scale(2.5);
}

/* Scroll-based color transitions */
.scroll-color-transition {
    transition: background 0.5s ease-out;
}

/* Weather intensity - förenklad */
.weather-intensity {
    transition: all 0.3s ease-out;
}

/* EASTER EGG: Dold spindel */
.hidden-spider {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    cursor: pointer;
    opacity: 0.3;
    transition: all 0.3s ease;
    animation: spider-float 4s ease-in-out infinite;
}

.hidden-spider:hover {
    opacity: 0.8;
    transform: scale(1.2);
}

.spider-svg {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

@keyframes spider-float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-5px) rotate(2deg); }
}

.spider-dead {
    animation: spider-die 1s ease-in-out forwards;
}

@keyframes spider-die {
    0% { transform: scale(1) rotate(0deg); opacity: 0.8; }
    50% { transform: scale(1.5) rotate(180deg); opacity: 0.5; }
    100% { transform: scale(0) rotate(360deg); opacity: 0; }
}

/* API Button */
.api-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.api-button:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
    color: white;
}

.api-icon {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

/* API Overlay */
.api-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    backdrop-filter: blur(5px);
}

.api-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 16px;
    padding: 2rem;
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.api-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e5e7eb;
}

.api-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
}

.api-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6b7280;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.api-close:hover {
    background: #f3f4f6;
    color: #374151;
}

.api-section {
    margin-bottom: 2rem;
}

.api-section h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.api-section-icon {
    width: 20px;
    height: 20px;
    stroke: #3b82f6;
    stroke-width: 2;
    fill: none;
}

.endpoint {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

.endpoint-url {
    color: #059669;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.endpoint-desc {
    color: #64748b;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.endpoint-example {
    background: #1e293b;
    color: #e2e8f0;
    padding: 0.75rem;
    border-radius: 4px;
    font-size: 0.875rem;
    overflow-x: auto;
}

.contact-info {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    padding: 1.5rem;
    border-radius: 12px;
    margin-top: 2rem;
}

.contact-info h3 {
    color: white;
    margin-bottom: 1rem;
}

.contact-info p {
    margin-bottom: 0.75rem;
    line-height: 1.6;
}

.contact-email {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    display: inline-block;
    font-weight: 600;
    margin-top: 0.5rem;
}

.data-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.stat-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
}

.stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: #3b82f6;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.875rem;
    color: #64748b;
}

/* Sol */
.sun-container {
    position: fixed;
    top: 180px;
    right: 50px;
    z-index: 2;
    display: none;
    /* Förhindra scroll-problem */
    transform: translateZ(0);
    will-change: transform;
}

.sun {
    width: 70px;
    height: 70px;
    background: radial-gradient(circle, 
        rgba(255, 244, 188, 1) 0%, 
        rgba(251, 191, 36, 0.95) 30%, 
        rgba(245, 158, 11, 0.9) 60%, 
        rgba(217, 119, 6, 0.8) 85%, 
        rgba(180, 83, 9, 0.7) 100%);
    border-radius: 50%;
    box-shadow: 
        0 0 50px rgba(251, 191, 36, 0.6),
        0 0 90px rgba(245, 158, 11, 0.4),
        0 0 130px rgba(217, 119, 6, 0.2);
    animation: sun-pulse 3s ease-in-out infinite;
    position: relative;
    filter: blur(5px);
}

.sun::before {
    content: '';
    position: absolute;
    top: -15px;
    left: -15px;
    right: -15px;
    bottom: -15px;
    background: radial-gradient(circle, 
        rgba(251, 191, 36, 0.4) 0%, 
        rgba(245, 158, 11, 0.3) 40%, 
        rgba(217, 119, 6, 0.2) 70%, 
        transparent 100%);
    border-radius: 50%;
    animation: sun-glow 4s ease-in-out infinite;
}

.sun::after {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    background: radial-gradient(circle, 
        rgba(255, 244, 188, 0.8) 0%, 
        rgba(251, 191, 36, 0.6) 50%, 
        transparent 100%);
    border-radius: 50%;
    animation: sun-inner-glow 2s ease-in-out infinite;
}

@keyframes sun-pulse {
    0%, 100% { 
        transform: scale(1) rotate(0deg); 
        box-shadow: 
            0 0 50px rgba(251, 191, 36, 0.6),
            0 0 90px rgba(245, 158, 11, 0.4),
            0 0 130px rgba(217, 119, 6, 0.2);
    }
    25% { 
        transform: scale(1.05) rotate(45deg); 
        box-shadow: 
            0 0 60px rgba(251, 191, 36, 0.7),
            0 0 100px rgba(245, 158, 11, 0.5),
            0 0 140px rgba(217, 119, 6, 0.3);
    }
    50% { 
        transform: scale(1.12) rotate(90deg); 
        box-shadow: 
            0 0 70px rgba(251, 191, 36, 0.8),
            0 0 110px rgba(245, 158, 11, 0.6),
            0 0 150px rgba(217, 119, 6, 0.4);
    }
    75% { 
        transform: scale(1.05) rotate(135deg); 
        box-shadow: 
            0 0 60px rgba(251, 191, 36, 0.7),
            0 0 100px rgba(245, 158, 11, 0.5),
            0 0 140px rgba(217, 119, 6, 0.3);
    }
}

@keyframes sun-glow {
    0%, 100% { 
        opacity: 0.4; 
        transform: scale(1);
    }
    25% { 
        opacity: 0.6; 
        transform: scale(1.08);
    }
    50% { 
        opacity: 0.8; 
        transform: scale(1.18);
    }
    75% { 
        opacity: 0.6; 
        transform: scale(1.08);
    }
}

@keyframes sun-inner-glow {
    0%, 100% { 
        opacity: 0.6; 
        transform: scale(1);
    }
    25% { 
        opacity: 0.75; 
        transform: scale(1.03);
    }
    50% { 
        opacity: 0.95; 
        transform: scale(1.08);
    }
    75% { 
        opacity: 0.75; 
        transform: scale(1.03);
    }
} 