/* ===== CSS-Variablen für Dark Mode & Theming ===== */
:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f5f5f5;
    --text-primary: #333333;
    --text-secondary: #666666;
    --accent-color: #4a90e2;
    --error-color: #e74c3c;
    --warning-color: #f39c12;
    --success-color: #27ae60;
    --temp-cold: #3498db;
    --temp-mild: #f39c12;
    --temp-hot: #e74c3c;
    --shadow-light: rgba(0, 0, 0, 0.1);
    --shadow-medium: rgba(0, 0, 0, 0.2);
    --shadow-heavy: rgba(0, 0, 0, 0.3);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #1a1a1a;
        --bg-secondary: #2d2d2d;
        --text-primary: #f0f0f0;
        --text-secondary: #b0b0b0;
        --shadow-light: rgba(0, 0, 0, 0.3);
        --shadow-medium: rgba(0, 0, 0, 0.5);
        --shadow-heavy: rgba(0, 0, 0, 0.7);
    }
}

/* ===== Ladeanimation ===== */
.loading-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 1000;
    background: var(--bg-primary);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 4px 20px var(--shadow-medium);
}

.spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto 1rem;
    border: 4px solid var(--shadow-light);
    border-top: 4px solid var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-container p {
    color: var(--text-primary);
    font-size: 1rem;
    margin: 0;
}

/* ===== Fehleranzeige (innerhalb des Wetter-Hintergrunds) ===== */
.error-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 10;
    background: rgba(0, 0, 0, 0.75);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 4px 20px var(--shadow-medium);
    max-width: 400px;
    width: 90%;
    border: 2px solid var(--error-color);
    backdrop-filter: blur(8px);
}

.error-icon {
    width: 60px;
    height: 60px;
    color: var(--error-color);
    margin: 0 auto 1rem;
}

.error-container p {
    color: #ffffff;
    margin: 1rem 0;
}

.retry-btn {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.retry-btn:hover {
    background: #357abd;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px var(--shadow-medium);
}

.hidden {
    display: none !important;
}

/* ===== Hauptcontainer - Dashboard Layout ===== */
.weather-dashboard {
    opacity: 0;
    animation: fadeIn 0.8s ease forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

/* ===== Hero Section mit Hintergrund ===== */
.weather-hero-section {
    position: relative;
    min-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    overflow: hidden;
}

.hero-bg-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    z-index: 0;
}

.hero-bg-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        135deg,
        rgba(0, 0, 0, 0.65) 0%,
        rgba(0, 0, 0, 0.5) 50%,
        rgba(0, 0, 0, 0.65) 100%
    );
    z-index: 1;
}

/* ===== Kompakte Wetter-Card ===== */
.weather-card-compact {
    position: relative;
    z-index: 10;
    max-width: 900px;
    width: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.05));
    backdrop-filter: blur(30px);
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), inset 0 1px 1px rgba(255, 255, 255, 0.3);
    padding: 3rem;
    color: white;
    animation: slideUp 0.8s ease forwards;
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ===== Zeit/Datum Info ===== */
.card-time-info {
    position: absolute;
    top: 2rem;
    right: 2rem;
    text-align: right;
}

.time-info-date {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.95;
    font-weight: 500;
}

.time-info-clock {
    margin: 0.25rem 0;
    font-size: 1.2rem;
    font-weight: 600;
}

.time-info-update {
    margin: 0.25rem 0 0 0;
    font-size: 0.75rem;
    opacity: 0.8;
}

/* ===== Haupt-Wetter-Bereich ===== */
.card-main-weather {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.main-weather-icon {
    width: 120px;
    height: 120px;
    filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.5));
    animation: iconFloat 3s ease-in-out infinite;
}

.main-weather-icon svg {
    width: 100%;
    height: 100%;
}

@keyframes iconFloat {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

.main-weather-temp {
    text-align: center;
}

.main-temp-display {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.main-temp-number {
    font-size: 4.5rem;
    font-weight: 700;
    line-height: 1;
    text-shadow: 4px 4px 20px rgba(0, 0, 0, 0.5);
}

.main-temp-unit {
    font-size: 2.5rem;
    font-weight: 300;
    opacity: 0.95;
}

.main-weather-desc {
    font-size: 1.5rem;
    margin: 0 0 0.3rem 0;
    font-weight: 400;
    text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.5);
}

.main-weather-feels {
    font-size: 1rem;
    opacity: 0.95;
    margin: 0;
    text-shadow: 1px 1px 5px rgba(0, 0, 0, 0.5);
}

/* ===== Details Grid ===== */
.card-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

/* ===== Wetterstation Info ===== */
.weather-station-info {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    text-align: center;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
}

.weather-station-info strong {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
}

.card-detail-box {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.08));
    backdrop-filter: blur(10px);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.card-detail-box:hover {
    transform: translateY(-3px);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.15));
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.detail-box-icon {
    width: 32px;
    height: 32px;
    color: white;
    filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.5));
    flex-shrink: 0;
}

.detail-box-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

/* Wind-Box spezifisch für Mobile: Geschwindigkeit und Richtung in einer Zeile */
@media (max-width: 768px) {
    .card-detail-box:first-child .detail-box-info {
        gap: 0.1rem;
    }
    
    .card-detail-box:first-child .detail-box-label {
        margin-bottom: 0.1rem;
    }
    
    .card-detail-box:first-child .detail-box-value {
        font-size: 1.1rem;
        display: inline;
        margin-right: 0.3rem;
    }
    
    .card-detail-box:first-child .detail-box-extra {
        font-size: 0.75rem;
        display: inline;
        opacity: 0.85;
    }
}

.detail-box-label {
    font-size: 0.8rem;
    opacity: 0.85;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-box-value {
    font-size: 1.3rem;
    font-weight: 600;
}

.detail-box-extra {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* ===== Unwetterwarnungen ===== */
.weather-warnings {
    position: fixed;
    top: 2rem;
    left: 50%;
    transform: translateX(-50%);
    max-width: 800px;
    width: calc(100% - 4rem);
    z-index: 1000;
    background: linear-gradient(135deg, #f39c12, #e74c3c);
    color: white;
    padding: 1.5rem;
    border-radius: 15px;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    box-shadow: 0 10px 40px rgba(243, 156, 18, 0.5);
    animation: warningSlideIn 0.5s ease;
}

@keyframes warningSlideIn {
    from {
        transform: translateX(-50%) translateY(-100px);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

.warning-icon {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
}

#warning-content h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1.2rem;
    font-weight: 600;
}

#warning-content p {
    margin: 0;
    font-size: 1rem;
    line-height: 1.5;
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    .weather-hero-section {
        height: 100%;
        padding: 1rem;
    }

    .hero-bg-image {
        object-position: center 30%;
    }

    .weather-card-compact {
        padding: 2rem 1.5rem;
        border-radius: 20px;
    }

    .card-time-info {
        position: static;
        text-align: center;
        margin-bottom: 0.75rem;
        padding-bottom: 0.5rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.2);
        display: flex;
        flex-direction: row;
        justify-content: center;
        align-items: center;
        gap: 0.75rem;
        flex-wrap: wrap;
    }

    .time-info-date {
        font-size: 0.8rem;
    }

    .time-info-clock {
        font-size: 1rem;
    }

    .time-info-update {
        font-size: 0.65rem;
    }

    .time-info-date,
    .time-info-clock,
    .time-info-update {
        margin: 0;
        white-space: nowrap;
    }

    .card-main-weather {
        flex-direction: row;
        gap: 1.5rem;
        margin-bottom: 1.5rem;
        align-items: center;
    }

    .main-weather-icon {
        width: 80px;
        height: 80px;
        flex-shrink: 0;
    }

    .main-weather-info {
        flex: 1;
    }

    .main-temp-number {
        font-size: 3rem;
    }

    .main-temp-unit {
        font-size: 1.5rem;
    }

    .main-weather-desc {
        font-size: 1.2rem;
    }

    .main-weather-feels {
        font-size: 0.9rem;
    }

    .card-details-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 1rem;
    }

    .card-detail-box {
        padding: 0.75rem;
        flex-direction: row;
        text-align: left;
        align-items: center;
        gap: 0.75rem;
    }

    .detail-box-icon {
        width: 24px;
        height: 24px;
        flex-shrink: 0;
    }

    .detail-box-content {
        display: flex;
        flex-direction: column;
        gap: 0.2rem;
        flex: 1;
        min-width: 0;
    }

    .detail-box-value {
        font-size: 1rem;
    }

    .detail-box-label {
        font-size: 0.75rem;
    }

    .weather-station-info {
        margin-top: 1rem;
        padding-top: 1rem;
        font-size: 0.75rem;
    }

    .weather-warnings {
        top: 1rem;
        width: calc(100% - 2rem);
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .weather-hero-section {
        height: 65vh;
        min-height: 550px;
    }

    .hero-bg-image {
        object-position: center 25%;
    }

    .weather-card-compact {
        padding: 1.5rem 1rem;
    }

    .card-main-weather {
        gap: 1rem;
        margin-bottom: 1rem;
    }

    .main-weather-icon {
        width: 60px;
        height: 60px;
    }

    .main-temp-number {
        font-size: 2.5rem;
    }

    .main-temp-unit {
        font-size: 1.2rem;
    }

    .main-weather-desc {
        font-size: 1rem;
    }

    .main-weather-feels {
        font-size: 0.8rem;
    }

    .card-details-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }

    .card-detail-box {
        padding: 0.5rem;
        gap: 0.5rem;
    }

    .detail-box-icon {
        width: 20px;
        height: 20px;
    }

    .detail-box-value {
        font-size: 0.9rem;
    }

    .detail-box-label {
        font-size: 0.65rem;
    }

    .weather-station-info {
        margin-top: 0.75rem;
        padding-top: 0.75rem;
        font-size: 0.65rem;
    }

    .detail-box-value {
        font-size: 1rem;
    }
}