/**
 * TheNews Weather Plugin Styles
 * BEM naming convention with CSS Variables
 */

/* ==========================================================================
   CSS Variables
   ========================================================================== */

:root {
    /* Colors */
    --weather-color-primary: #3b82f6;
    --weather-color-primary-dark: #2563eb;
    --weather-color-temp-high: #dc2626;
    --weather-color-temp-low: #2563eb;
    --weather-color-text: #1f2937;
    --weather-color-text-muted: #6b7280;
    --weather-color-bg: #ffffff;
    --weather-color-bg-alt: #f9fafb;
    --weather-color-bg-hover: #f3f4f6;
    --weather-color-error-bg: #fee2e2;
    --weather-color-error-border: #fecaca;
    --weather-color-error-text: #b91c1c;

    /* Spacing */
    --weather-space-xs: 0.25rem;
    --weather-space-sm: 0.5rem;
    --weather-space-md: 1rem;
    --weather-space-lg: 1.5rem;

    /* Border radius */
    --weather-radius-sm: 0.25rem;
    --weather-radius-md: 0.5rem;
    --weather-radius-lg: 0.75rem;

    /* Shadows */
    --weather-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* ==========================================================================
   City List View
   ========================================================================== */

.weather-list {
    background-color: var(--weather-color-bg);
    padding: var(--weather-space-md);
    border-radius: var(--weather-radius-md);
    box-shadow: var(--weather-shadow);
}

.weather-list__title {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: var(--weather-space-md);
    color: var(--weather-color-text);
}

.weather-list__grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: var(--weather-space-md);
}

@media (min-width: 640px) {
    .weather-list__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 768px) {
    .weather-list__grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1024px) {
    .weather-list__grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.weather-list__update-time {
    text-align: right;
    font-size: 0.875rem;
    color: var(--weather-color-text-muted);
    margin-top: var(--weather-space-md);
}

/* ==========================================================================
   Weather Card
   ========================================================================== */

.weather-card {
    display: block;
    background-color: var(--weather-color-bg-alt);
    border-radius: var(--weather-radius-md);
    padding: var(--weather-space-md);
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.weather-card:hover {
    background-color: var(--weather-color-bg-hover);
}

.weather-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--weather-space-sm);
}

.weather-card__city-name {
    font-weight: bold;
    font-size: 1.125rem;
    color: var(--weather-color-text);
    margin: 0;
}

.weather-card__icon {
    width: 3rem;
    height: 3rem;
}

.weather-card__body {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.weather-card__temp {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--weather-color-text);
}

.weather-card__condition {
    font-size: 0.875rem;
    color: var(--weather-color-text-muted);
}

.weather-card__temps {
    font-size: 0.875rem;
    color: var(--weather-color-text-muted);
}

/* ==========================================================================
   Single City Detail View
   ========================================================================== */

.weather-detail {
    background-color: var(--weather-color-bg);
    border-radius: var(--weather-radius-md);
    box-shadow: var(--weather-shadow);
    overflow: hidden;
}

.weather-detail__header {
    background: linear-gradient(to right, var(--weather-color-primary), var(--weather-color-primary-dark));
    color: white;
    padding: var(--weather-space-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.weather-detail__header-title {
    font-size: 1.5rem;
    font-weight: bold;
    margin: 0;
    color: white;
}

.weather-detail__header-time {
    font-size: 0.875rem;
}

.weather-detail__content {
    padding: var(--weather-space-lg);
}

.weather-detail__grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: var(--weather-space-lg);
}

@media (min-width: 768px) {
    .weather-detail__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.weather-detail__section {
    background-color: var(--weather-color-bg-alt);
    border-radius: var(--weather-radius-md);
    padding: var(--weather-space-md);
}

.weather-detail__section-title {
    font-weight: bold;
    font-size: 1.125rem;
    margin-bottom: var(--weather-space-sm);
    color: var(--weather-color-text);
}

.weather-detail__current {
    display: flex;
    align-items: center;
    margin-bottom: var(--weather-space-md);
}

.weather-detail__current-icon {
    width: 6rem;
    height: 6rem;
}

.weather-detail__current-info {
    margin-left: var(--weather-space-md);
}

.weather-detail__current-temp {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--weather-color-text);
}

.weather-detail__current-condition {
    font-size: 1.125rem;
    color: var(--weather-color-text-muted);
}

.weather-detail__stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--weather-space-md);
    font-size: 0.875rem;
}

.weather-detail__stat-label {
    color: var(--weather-color-text-muted);
}

.weather-detail__stat-value {
    font-weight: bold;
    margin-left: var(--weather-space-sm);
}

/* ==========================================================================
   Forecast Grid
   ========================================================================== */

.weather-forecast {
    margin-top: var(--weather-space-lg);
}

.weather-forecast__title {
    font-weight: bold;
    font-size: 1.125rem;
    margin-bottom: var(--weather-space-md);
    color: var(--weather-color-text);
}

.weather-forecast__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--weather-space-sm);
}

@media (min-width: 768px) {
    .weather-forecast__grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

.weather-forecast__day {
    background-color: var(--weather-color-bg-alt);
    border-radius: var(--weather-radius-md);
    padding: var(--weather-space-sm);
    text-align: center;
}

.weather-forecast__day-name {
    font-weight: bold;
    margin-bottom: var(--weather-space-xs);
}

.weather-forecast__date {
    font-size: 0.75rem;
    color: var(--weather-color-text-muted);
    margin-bottom: var(--weather-space-sm);
}

.weather-forecast__icon {
    width: 3rem;
    height: 3rem;
    margin: 0 auto var(--weather-space-sm);
}

.weather-forecast__condition {
    font-size: 0.75rem;
    color: var(--weather-color-text-muted);
    margin-bottom: var(--weather-space-sm);
}

.weather-forecast__temps {
    font-size: 0.875rem;
}

/* ==========================================================================
   Temperature Modifiers
   ========================================================================== */

.weather-temp--high {
    color: var(--weather-color-temp-high);
    font-weight: bold;
}

.weather-temp--low {
    color: var(--weather-color-temp-low);
    font-weight: bold;
}

/* ==========================================================================
   Day Modifiers
   ========================================================================== */

.weather-day--sunday {
    color: var(--weather-color-temp-high);
}

.weather-day--saturday {
    color: var(--weather-color-temp-low);
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.weather-btn--primary {
    display: inline-block;
    background-color: var(--weather-color-primary);
    color: white;
    font-weight: bold;
    padding: var(--weather-space-sm) var(--weather-space-lg);
    border-radius: var(--weather-radius-sm);
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.weather-btn--primary:hover {
    background-color: var(--weather-color-primary-dark);
}

/* ==========================================================================
   Error State
   ========================================================================== */

.weather-error {
    background-color: var(--weather-color-error-bg);
    border: 1px solid var(--weather-color-error-border);
    color: var(--weather-color-error-text);
    padding: var(--weather-space-sm) var(--weather-space-md);
    border-radius: var(--weather-radius-sm);
}

/* ==========================================================================
   Navigation
   ========================================================================== */

.weather-nav {
    margin-top: var(--weather-space-lg);
    text-align: center;
}
