/**
 * Weatherly Widgets — Frontend Styles
 * Clean, responsive weather widget styling.
 * Pro users can override via WP Customizer or custom CSS field.
 */

/* Base */
.weatherly-widget {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
    color: #1f2937;
    line-height: 1.5;
    box-sizing: border-box;
    max-width: 100%;
}

.weatherly-widget * {
    box-sizing: border-box;
}

.weatherly-icon {
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
}

/* ===== COMPACT ===== */
.weatherly-compact {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px 16px;
    display: inline-block;
}

.weatherly-compact-inner {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.weatherly-compact .weatherly-city {
    font-weight: 600;
    color: #111827;
}

.weatherly-compact .weatherly-separator {
    color: #9ca3af;
}

.weatherly-compact .weatherly-temp {
    font-weight: 700;
    font-size: 1.1em;
    color: #2563eb;
}

.weatherly-compact .weatherly-condition {
    color: #6b7280;
}

/* ===== FULL FORECAST ===== */
.weatherly-full {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
}

.weatherly-full .weatherly-current {
    padding: 20px 24px;
}

.weatherly-full .weatherly-current-header {
    margin-bottom: 16px;
}

.weatherly-full .weatherly-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
}

.weatherly-full .weatherly-current-body {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 16px;
}

.weatherly-full .weatherly-current-main {
    display: flex;
    align-items: center;
    gap: 16px;
}

.weatherly-full .weatherly-temp-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: #111827;
    line-height: 1;
}

.weatherly-full .weatherly-temp-value small {
    font-size: 0.5em;
    font-weight: 400;
    color: #6b7280;
}

.weatherly-full .weatherly-condition {
    display: block;
    color: #6b7280;
    font-size: 0.95rem;
    margin-top: 4px;
}

.weatherly-full .weatherly-current-details {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.weatherly-detail {
    display: flex;
    flex-direction: column;
}

.weatherly-detail-label {
    font-size: 0.75rem;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.weatherly-detail-value {
    font-weight: 600;
    color: #374151;
}

/* Sun bar */
.weatherly-sun {
    display: flex;
    gap: 16px;
    padding: 10px 24px;
    background: #f9fafb;
    border-top: 1px solid #f3f4f6;
    font-size: 0.85rem;
    color: #6b7280;
    flex-wrap: wrap;
}

/* 7-Day Forecast */
.weatherly-forecast {
    padding: 16px 24px 20px;
    border-top: 1px solid #f3f4f6;
}

.weatherly-section-title {
    margin: 0 0 12px;
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
}

.weatherly-forecast-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}

.weatherly-forecast-day {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 8px 4px;
    border-radius: 8px;
    background: #f9fafb;
}

.weatherly-day-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 4px;
}

.weatherly-day-temps {
    display: flex;
    gap: 6px;
    font-size: 0.85rem;
    margin-top: 4px;
}

.weatherly-high {
    font-weight: 700;
    color: #dc2626;
}

.weatherly-low {
    color: #2563eb;
}

.weatherly-day-condition {
    font-size: 0.7rem;
    color: #9ca3af;
    margin-top: 2px;
}

.weatherly-precip {
    font-size: 0.75rem;
    color: #3b82f6;
    margin-top: 2px;
}

/* ===== SIDEBAR ===== */
.weatherly-sidebar {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    max-width: 300px;
    overflow: hidden;
}

.weatherly-sidebar-header {
    padding: 14px 16px 0;
}

.weatherly-sidebar .weatherly-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: #111827;
}

.weatherly-sidebar-current {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 16px;
    text-align: center;
}

.weatherly-sidebar-current .weatherly-temp-value {
    font-size: 2rem;
    font-weight: 800;
    color: #111827;
}

.weatherly-sidebar-current .weatherly-condition {
    color: #6b7280;
    font-size: 0.9rem;
}

.weatherly-sidebar-forecast {
    border-top: 1px solid #f3f4f6;
    padding: 8px 16px 12px;
}

.weatherly-sidebar-day {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
}

.weatherly-sidebar-day .weatherly-day-name {
    width: 40px;
    font-size: 0.8rem;
    margin-bottom: 0;
}

.weatherly-sidebar-day .weatherly-high,
.weatherly-sidebar-day .weatherly-low {
    font-size: 0.85rem;
    margin-left: auto;
}

.weatherly-sidebar-day .weatherly-low {
    margin-left: 4px;
}

/* ===== SEVEN DAY STRIP ===== */
.weatherly-sevenday {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px 20px;
}

.weatherly-sevenday-strip {
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.weatherly-sevenday-day {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex: 1;
    min-width: 0;
}

/* ===== HOURLY ===== */
.weatherly-hourly {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px 20px;
}

.weatherly-hourly-scroll {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    padding-bottom: 4px;
}

.weatherly-hourly-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-width: 56px;
    padding: 8px 6px;
    border-radius: 8px;
    background: #f9fafb;
    flex-shrink: 0;
}

.weatherly-hour-time {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 4px;
}

.weatherly-hour-temp {
    font-weight: 700;
    font-size: 0.9rem;
    color: #111827;
    margin-top: 4px;
}

.weatherly-hour-precip {
    font-size: 0.7rem;
    color: #3b82f6;
}

/* ===== ATTRIBUTION ===== */
.weatherly-attribution {
    margin: 8px 0 0;
    font-size: 0.7rem;
    color: #9ca3af;
    text-align: right;
}

.weatherly-attribution a {
    color: #9ca3af;
    text-decoration: none;
}

.weatherly-attribution a:hover {
    color: #6b7280;
    text-decoration: underline;
}

/* ===== FALLBACK / ERROR ===== */
.weatherly-fallback,
.weatherly-error {
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 0.9rem;
    color: #92400e;
}

.weatherly-fallback-link {
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
}

.weatherly-fallback-link:hover {
    text-decoration: underline;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
    .weatherly-forecast-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .weatherly-sevenday-strip {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .weatherly-sevenday-day {
        min-width: 60px;
        flex-shrink: 0;
    }

    .weatherly-full .weatherly-current-body {
        flex-direction: column;
    }
}
