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

:root {
    --primary-color: #3498db;
    --secondary-color: #2ecc71;
    --background-color: #ecf0f1;
    --text-color: #34495e;
    --warning-color: #e74c3c;
}

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background-color: var(--background-color);
}

h1 {
    color: var(--primary-color);
    text-align: center;
    font-weight: 600;
    font-size: 2.5em;
    margin-bottom: 10px;
}

.description {
    text-align: center;
    margin-bottom: 30px;
    color: var(--text-color);
    font-style: italic;
    font-weight: 300;
}

.image-container {
    background-color: white;
    border-radius: 15px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-top: 20px;
    transition: all 0.3s ease;
}

.image-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    border-radius: 10px;
}

.image-caption {
    text-align: center;
    margin-top: 15px;
    font-style: italic;
    color: var(--primary-color);
    font-weight: 400;
}

.warning {
    color: var(--warning-color);
    font-weight: bold;
    margin-top: 15px;
    padding: 10px;
    background-color: rgba(231, 76, 60, 0.1);
    border-radius: 5px;
    text-align: center;
}

.error-message {
    color: var(--warning-color);
    font-weight: bold;
    text-align: center;
    margin-top: 20px;
    padding: 20px;
    background-color: rgba(231, 76, 60, 0.1);
    border-radius: 10px;
}

@media (max-width: 600px) {
    body {
        padding: 10px;
    }
    h1 {
        font-size: 2em;
    }
    .image-container {
        padding: 15px;
    }
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    padding: 20px;
}
.image-item {
    text-align: center;
}
.image-item img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s ease;
}
.image-item img:hover {
    transform: scale(1.05);
}
#debugInfo {
    background-color: #f0f0f0;
    padding: 10px;
    margin-top: 20px;
    white-space: pre-wrap;
}
.lightbox {
    display: none;
    position: fixed;
    z-index: 999;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
}
.lightbox img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}
.lightbox.active {
    display: flex;
}
.close-button {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
    background-color: rgba(0, 0, 0, 0.5);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.3s ease;
}
.close-button:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

.idag-link {
    display: inline-block;
    margin-top: 15px;
    padding: 10px 15px;
    background-color: #3498db;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.idag-link:hover {
    background-color: #2980b9;
}

/* Juster .image-container for å sentrere innholdet */
.image-container {
    text-align: center;
}

/* Juster .image-caption for konsistens */
.image-caption {
    margin-bottom: 15px;
}

.weather-info {
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.weather-info h2 {
    color: #333;
    margin-bottom: 15px;
    text-align: center;
}

.weather-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.weather-item {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    text-align: center;
    padding: 15px;
    background-color: #f0f0f0;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.weather-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

.weather-item i {
    font-size: 24px;
    margin-bottom: 8px;
    color: #3498db;
}

.weather-value {
    font-weight: bold;
    font-size: 18px;
    display: flex;
    align-items: baseline;
    justify-content: center;
}

.weather-value .unit {
    font-size: 14px;
    margin-left: 2px;
}

.weather-label {
    font-size: 14px;
    color: #666;
    margin-top: 5px;
}

@media (max-width: 600px) {
    .weather-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* ---------- Sidehode ---------- */
.page-header {
    text-align: center;
    margin-bottom: 25px;
}

/* flex-rad for datovelger + knapp */
/* ----------------- TOPP-LAYOUT ----------------- */
.controls {
    display: flex;
    flex-direction: column;   /* lenken kommer automatisk under picker */
    align-items: center;
    gap: 12px;
    margin-top: 10px;
}

/* liten horisontal flex for label + input */
.picker {
    display: flex;
    gap: 8px;
    align-items: center;
}


/* Penere date-input */
.date-input {
    padding: 8px 12px;
    font-family: inherit;
    font-size: 1rem;
    color: var(--text-color);
    background: #fff;
    border: 2px solid var(--primary-color);
    border-radius: 6px;
    transition: border-color 0.3s ease;
}
.date-input:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

/* Sentrer hvert bilde i grid-cellen */
.image-grid {
    justify-items: center;
}
