/* ============================================
   TurnierOS Weather Widget Styles
   Responsive: Desktop + Mobile
   ============================================ */

/* === Widget Container === */
.weather-widget {
    background: linear-gradient(135deg, #e0f2fe 0%, #f0f9ff 100%);
    border-radius: 0.75rem;
    padding: 0.875rem 1rem;
    border: 1px solid #bae6fd;
    margin-bottom: 1rem;
    font-family: inherit;
    transition: background 0.3s;
}

/* Condition-basierte Hintergründe */
.weather-widget.weather-sunny { background: linear-gradient(135deg, #fef9c3 0%, #fefce8 100%); border-color: #fde047; }
.weather-widget.weather-partly-cloudy { background: linear-gradient(135deg, #e0f2fe 0%, #f0f9ff 100%); border-color: #bae6fd; }
.weather-widget.weather-cloudy { background: linear-gradient(135deg, #e2e8f0 0%, #f1f5f9 100%); border-color: #cbd5e1; }
.weather-widget.weather-rain { background: linear-gradient(135deg, #dbeafe 0%, #eff6ff 100%); border-color: #93c5fd; }
.weather-widget.weather-thunderstorm { background: linear-gradient(135deg, #e0e7ff 0%, #eef2ff 100%); border-color: #a5b4fc; }
.weather-widget.weather-snow { background: linear-gradient(135deg, #f0f9ff 0%, #f8fafc 100%); border-color: #e2e8f0; }
.weather-widget.weather-fog { background: linear-gradient(135deg, #f1f5f9 0%, #f8fafc 100%); border-color: #e2e8f0; }

/* === Modus-Label (Vorhersage/Aktuell) === */
.weather-mode-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: #6366f1;
    background: rgba(99, 102, 241, 0.08);
    padding: 0.2rem 0.5rem;
    border-radius: 0.25rem;
    margin-bottom: 0.5rem;
    display: inline-block;
}

/* === Hauptbereich === */
.weather-main {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

/* Aktuelles Wetter */
.weather-current {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.weather-icon {
    font-size: 2rem;
    line-height: 1;
}

.weather-temp-block {
    display: flex;
    flex-direction: column;
}

.weather-temp {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.1;
}

.weather-condition {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 500;
}

/* Details */
.weather-details {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: #64748b;
}

.weather-detail {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    white-space: nowrap;
}

.weather-detail i {
    font-size: 0.65rem;
    opacity: 0.7;
}

.weather-precip {
    color: #3b82f6;
    font-weight: 600;
}

/* === Sport-Bewertung (Ampel) === */
.weather-rating-ampel {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-weight: 700;
    font-size: 0.75rem;
    padding: 0.2rem 0.625rem;
    border-radius: 9999px;
    margin-top: 0.375rem;
    white-space: nowrap;
}
.weather-rating-ampel.excellent { background: #dcfce7; color: #166534; }
.weather-rating-ampel.good { background: #ecfccb; color: #365314; }
.weather-rating-ampel.moderate { background: #fef3c7; color: #92400e; }
.weather-rating-ampel.poor { background: #fee2e2; color: #991b1b; }
.weather-rating-ampel.dangerous { background: #991b1b; color: #fff; }

/* === Warnungen === */
.weather-warnings {
    margin-top: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.weather-warning {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.7rem;
    color: #dc2626;
    font-weight: 500;
    background: rgba(239, 68, 68, 0.08);
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
}

.weather-warning i {
    font-size: 0.65rem;
    flex-shrink: 0;
}

/* === Stündliche Vorhersage === */
.weather-hourly {
    margin-top: 0.625rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.weather-hourly-scroll {
    display: flex;
    gap: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 0.25rem;
}

.weather-hourly-scroll::-webkit-scrollbar {
    display: none;
}

.weather-hour {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 3.25rem;
    padding: 0.25rem 0.125rem;
    gap: 0.125rem;
    flex-shrink: 0;
}

.weather-hour-time {
    font-size: 0.65rem;
    color: #94a3b8;
    font-weight: 500;
}

.weather-hour-icon {
    font-size: 1rem;
    line-height: 1.2;
}

.weather-hour-temp {
    font-size: 0.75rem;
    font-weight: 600;
    color: #334155;
}

.weather-hour-precip {
    font-size: 0.6rem;
    color: #3b82f6;
    font-weight: 500;
}

/* === Footer === */
.weather-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.375rem;
    padding-top: 0.375rem;
    border-top: 1px solid rgba(0, 0, 0, 0.04);
    font-size: 0.6rem;
    color: #94a3b8;
}

/* === Skeleton Loading === */
.weather-loading {
    min-height: 60px;
}

.weather-skeleton {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.skeleton-line {
    background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
    background-size: 200% 100%;
    animation: skeleton-pulse 1.5s ease-in-out infinite;
    border-radius: 0.25rem;
}

.skeleton-icon { width: 2.5rem; height: 2.5rem; border-radius: 50%; }
.skeleton-temp { width: 3rem; height: 1.5rem; }
.skeleton-text { width: 5rem; height: 0.875rem; }

@keyframes skeleton-pulse {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* === Mini-Widget (Header/Dashboard) === */
.weather-mini {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.125rem 0.5rem;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 9999px;
    font-size: 0.8rem;
    cursor: default;
    white-space: nowrap;
}

.weather-mini-icon {
    font-size: 1rem;
    line-height: 1;
}

.weather-mini-temp {
    font-weight: 600;
    color: inherit;
}

/* === RESPONSIVE === */

/* Tablet & kleinere Desktop */
@media (max-width: 768px) {
    .weather-widget {
        padding: 0.75rem;
    }
    
    .weather-icon {
        font-size: 1.75rem;
    }
    
    .weather-temp {
        font-size: 1.25rem;
    }
    
    .weather-hour {
        min-width: 2.75rem;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .weather-widget {
        padding: 0.625rem 0.75rem;
        border-radius: 0.5rem;
    }
    
    .weather-main {
        gap: 0.5rem;
    }
    
    .weather-icon {
        font-size: 1.5rem;
    }
    
    .weather-temp {
        font-size: 1.125rem;
    }
    
    .weather-details {
        gap: 0.375rem;
        font-size: 0.7rem;
    }
    
    .weather-hour {
        min-width: 2.5rem;
    }
    
    .weather-hour-icon {
        font-size: 0.875rem;
    }
    
    .weather-hour-temp {
        font-size: 0.7rem;
    }
}

/* ============================================================
   WEATHER LIVE BAR (Spielzentrale)
   ============================================================ */

.weather-live-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    background: linear-gradient(135deg, #f0f9ff 0%, #f8fafc 100%);
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    flex-wrap: wrap;
    transition: all 0.3s;
}

.weather-live-bar.rating-excellent { background: linear-gradient(135deg, #f0fdf4 0%, #f8fafc 100%); border-color: #bbf7d0; }
.weather-live-bar.rating-good { background: linear-gradient(135deg, #f7fee7 0%, #f8fafc 100%); border-color: #d9f99d; }
.weather-live-bar.rating-moderate { background: linear-gradient(135deg, #fffbeb 0%, #f8fafc 100%); border-color: #fde68a; }
.weather-live-bar.rating-poor { background: linear-gradient(135deg, #fef2f2 0%, #f8fafc 100%); border-color: #fecaca; }
.weather-live-bar.rating-dangerous { background: linear-gradient(135deg, #fef2f2 0%, #fff1f2 100%); border-color: #fca5a5; }

.weather-live-ampel {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-weight: 700;
    font-size: 0.8rem;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    white-space: nowrap;
}
.weather-live-ampel.excellent { background: #dcfce7; color: #166534; }
.weather-live-ampel.good { background: #ecfccb; color: #365314; }
.weather-live-ampel.moderate { background: #fef3c7; color: #92400e; }
.weather-live-ampel.poor { background: #fee2e2; color: #991b1b; }
.weather-live-ampel.dangerous { background: #991b1b; color: #fff; }

.weather-live-current {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #334155;
}
.weather-live-current .wl-icon { font-size: 1.25rem; }
.weather-live-current .wl-temp { font-weight: 700; font-size: 1rem; }
.weather-live-current .wl-cond { color: #64748b; }

.weather-live-details {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    color: #64748b;
    font-size: 0.8rem;
}
.weather-live-details span { white-space: nowrap; }

.weather-live-divider {
    width: 1px;
    height: 1.5rem;
    background: #cbd5e1;
    flex-shrink: 0;
}

.weather-live-forecast {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #64748b;
    font-size: 0.8rem;
    margin-left: auto;
}
.weather-live-forecast .wlf-hour {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    white-space: nowrap;
}
.weather-live-forecast .wlf-label { color: #94a3b8; font-size: 0.7rem; }

.weather-live-updated {
    font-size: 0.7rem;
    color: #94a3b8;
    white-space: nowrap;
}

/* Alert Banners */
.weather-live-alerts {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    margin-bottom: 0.5rem;
}
.weather-live-alert {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.875rem;
    border-radius: 0.5rem;
    font-size: 0.85rem;
    font-weight: 500;
    animation: weatherAlertPulse 3s ease-in-out infinite;
}
.weather-live-alert.alert-critical {
    background: #991b1b; color: #fff;
    animation: weatherAlertPulse 1.5s ease-in-out infinite;
}
.weather-live-alert.alert-danger { background: #fef2f2; color: #991b1b; border: 1px solid #fca5a5; }
.weather-live-alert.alert-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.weather-live-alert.alert-info { background: #f0f9ff; color: #0c4a6e; border: 1px solid #bae6fd; }
.weather-live-alert-icon { font-size: 1.1rem; flex-shrink: 0; }

@keyframes weatherAlertPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.85; }
}

/* Loading */
.weather-live-bar.is-loading { opacity: 0.6; }
.weather-live-bar.is-loading::after {
    content: '';
    width: 14px; height: 14px;
    border: 2px solid #94a3b8;
    border-top-color: transparent;
    border-radius: 50%;
    animation: weatherLiveSpin 0.8s linear infinite;
    flex-shrink: 0;
}
@keyframes weatherLiveSpin { to { transform: rotate(360deg); } }

/* Mobile */
@media (max-width: 768px) {
    .weather-live-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        padding: 0.75rem;
    }
    .weather-live-divider { display: none; }
    .weather-live-forecast { margin-left: 0; }
    .weather-live-bar > :first-child {
        display: flex;
        width: 100%;
        justify-content: space-between;
        align-items: center;
    }
}
