/* Weather Forecast Pro - Frontend Styles */
/* Import Google Font */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@300;400;600;700;800&display=swap');

:root {
    --wfp-primary: #0ea5e9;
    --wfp-primary-dark: #0284c7;
    --wfp-primary-light: rgba(14, 165, 233, 0.15);
    --wfp-radius: 20px;
    --wfp-radius-sm: 12px;
    --wfp-shadow: 0 8px 32px rgba(0,0,0,0.12);
    --wfp-shadow-lg: 0 20px 60px rgba(0,0,0,0.18);
    --wfp-font: 'Nunito', -apple-system, sans-serif;
    --wfp-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==================== WRAP BASE ==================== */
.wfp-wrap {
    font-family: var(--wfp-font) !important;
    max-width: 820px;
    margin: 0 auto;
    position: relative;
    user-select: none;
}

.wfp-wrap * {
    box-sizing: border-box;
}

/* ==================== THEMES ==================== */

/* Glassmorphism */
.wfp-theme-glassmorphism {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 30%, #0ea5e9 100%);
    border-radius: var(--wfp-radius);
    padding: 24px;
    box-shadow: var(--wfp-shadow-lg);
}

.wfp-theme-glassmorphism .wfp-current-card,
.wfp-theme-glassmorphism .wfp-hourly-card,
.wfp-theme-glassmorphism .wfp-forecast-card,
.wfp-theme-glassmorphism .wfp-ai-card,
.wfp-theme-glassmorphism .wfp-aqi-card {
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,0.25);
    color: #fff;
}

.wfp-theme-glassmorphism .wfp-stat-label,
.wfp-theme-glassmorphism .wfp-feels-like,
.wfp-theme-glassmorphism .wfp-last-updated {
    color: rgba(255,255,255,0.75);
}

.wfp-theme-glassmorphism .wfp-search-bar input {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    color: #fff;
}

.wfp-theme-glassmorphism .wfp-search-bar input::placeholder { color: rgba(255,255,255,0.6); }

/* Minimal (Light) */
.wfp-theme-minimal {
    background: #f8fafc;
    border-radius: var(--wfp-radius);
    padding: 24px;
    border: 1px solid #e2e8f0;
}

.wfp-theme-minimal .wfp-current-card,
.wfp-theme-minimal .wfp-hourly-card,
.wfp-theme-minimal .wfp-forecast-card,
.wfp-theme-minimal .wfp-ai-card,
.wfp-theme-minimal .wfp-aqi-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    color: #1e293b;
}

.wfp-theme-minimal .wfp-section-title { color: var(--wfp-primary); }
.wfp-theme-minimal .wfp-stat-label { color: #64748b; }

/* Dark */
.wfp-theme-dark {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border-radius: var(--wfp-radius);
    padding: 24px;
    box-shadow: var(--wfp-shadow-lg);
}

.wfp-theme-dark .wfp-current-card,
.wfp-theme-dark .wfp-hourly-card,
.wfp-theme-dark .wfp-forecast-card,
.wfp-theme-dark .wfp-ai-card,
.wfp-theme-dark .wfp-aqi-card {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    color: #e2e8f0;
}

.wfp-theme-dark .wfp-stat-label { color: #94a3b8; }
.wfp-theme-dark .wfp-feels-like { color: #94a3b8; }
.wfp-theme-dark .wfp-search-bar input { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.15); color: #e2e8f0; }

/* Nature */
.wfp-theme-nature {
    background: linear-gradient(135deg, #134e4a 0%, #166534 50%, #15803d 100%);
    border-radius: var(--wfp-radius);
    padding: 24px;
    box-shadow: var(--wfp-shadow-lg);
}

.wfp-theme-nature .wfp-current-card,
.wfp-theme-nature .wfp-hourly-card,
.wfp-theme-nature .wfp-forecast-card,
.wfp-theme-nature .wfp-ai-card,
.wfp-theme-nature .wfp-aqi-card {
    background: rgba(255,255,255,0.12);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
}

/* ==================== CARDS ==================== */
.wfp-current-card,
.wfp-hourly-card,
.wfp-forecast-card,
.wfp-ai-card,
.wfp-aqi-card {
    border-radius: var(--wfp-radius);
    padding: 20px;
    margin-bottom: 16px;
    transition: var(--wfp-transition);
}

/* ==================== CURRENT WEATHER ==================== */
.wfp-location-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.wfp-location-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.wfp-city-name {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.wfp-last-updated {
    font-size: 0.75rem;
    opacity: 0.7;
}

.wfp-detect-location {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--wfp-transition);
    color: inherit;
    flex-shrink: 0;
}

.wfp-detect-location:hover {
    background: rgba(255,255,255,0.35);
    transform: rotate(30deg);
}

.wfp-temp-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 20px;
}

.wfp-temp-main {
    display: flex;
    align-items: center;
    gap: 12px;
}

.wfp-icon-wrap img {
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2));
    display: block;
}

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

.wfp-temp-value {
    font-size: 4rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.02em;
}

.wfp-description {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.wfp-feels-like {
    font-size: 0.8rem;
    opacity: 0.75;
}

.wfp-temp-range {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    font-size: 1.1rem;
    font-weight: 700;
}

.wfp-temp-hi { color: #fbbf24; }
.wfp-temp-lo { opacity: 0.65; }

/* ==================== STATS GRID ==================== */
.wfp-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
}

.wfp-stat {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(255,255,255,0.1);
    border-radius: var(--wfp-radius-sm);
    transition: var(--wfp-transition);
}

.wfp-stat:hover {
    background: rgba(255,255,255,0.18);
    transform: translateY(-1px);
}

.wfp-stat-icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    opacity: 0.85;
}

.wfp-stat-info {
    display: flex;
    flex-direction: column;
}

.wfp-stat-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
}

.wfp-stat-value {
    font-size: 0.95rem;
    font-weight: 700;
}

/* ==================== AQI ==================== */
.wfp-aqi-card {}

.wfp-aqi-main {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 12px 0;
}

.wfp-aqi-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--aqi-color, #22c55e);
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.wfp-aqi-level { font-size: 0.75rem; font-weight: 800; color: #fff; }
.wfp-aqi-num { font-size: 0.65rem; color: rgba(255,255,255,0.85); }

.wfp-aqi-desc { font-size: 0.9rem; line-height: 1.5; opacity: 0.9; }

.wfp-aqi-stats {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.wfp-aqi-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 12px;
    background: rgba(255,255,255,0.1);
    border-radius: 8px;
    font-size: 0.8rem;
}

.wfp-aqi-stat strong { font-weight: 700; font-size: 1rem; }

/* ==================== AI CARD ==================== */
.wfp-ai-card {}

.wfp-ai-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.wfp-ai-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
}

.wfp-ai-refresh {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    color: inherit;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--wfp-transition);
}

.wfp-ai-refresh:hover { transform: rotate(-180deg); background: rgba(255,255,255,0.25); }

.wfp-ai-summary {
    font-size: 0.95rem;
    line-height: 1.7;
    margin: 0 0 14px 0;
    opacity: 0.95;
}

.wfp-ai-suggestions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-top: 1px solid rgba(255,255,255,0.15);
    padding-top: 12px;
}

.wfp-suggestion-item {
    font-size: 0.88rem;
    padding: 8px 12px;
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    line-height: 1.5;
}

/* ==================== HOURLY SCROLL ==================== */
.wfp-hourly-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 8px 0 4px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.3) transparent;
}

.wfp-hourly-scroll::-webkit-scrollbar { height: 4px; }
.wfp-hourly-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.3); border-radius: 2px; }

.wfp-hourly-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 64px;
    padding: 10px 8px;
    background: rgba(255,255,255,0.1);
    border-radius: 14px;
    transition: var(--wfp-transition);
    cursor: default;
}

.wfp-hourly-item:hover { background: rgba(255,255,255,0.2); transform: translateY(-2px); }
.wfp-hourly-time { font-size: 0.75rem; font-weight: 600; opacity: 0.8; }
.wfp-hourly-temp { font-size: 0.95rem; font-weight: 700; }
.wfp-hourly-pop { font-size: 0.7rem; color: #7dd3fc; }

/* ==================== FORECAST LIST ==================== */
.wfp-forecast-list { display: flex; flex-direction: column; gap: 6px; }

.wfp-forecast-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-radius: var(--wfp-radius-sm);
    background: rgba(255,255,255,0.08);
    transition: var(--wfp-transition);
}

.wfp-forecast-item:hover { background: rgba(255,255,255,0.15); }
.wfp-forecast-item.wfp-today { background: rgba(255,255,255,0.18); }

.wfp-forecast-day { font-size: 0.9rem; font-weight: 700; min-width: 90px; }

.wfp-forecast-center {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    padding: 0 12px;
}

.wfp-forecast-desc { font-size: 0.82rem; opacity: 0.85; }

.wfp-forecast-temps {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    font-weight: 700;
}

.wfp-forecast-hi { color: #fbbf24; }
.wfp-forecast-divider { opacity: 0.4; }
.wfp-forecast-lo { opacity: 0.6; }
.wfp-forecast-pop { font-size: 0.75rem; color: #7dd3fc; }

/* ==================== SECTION TITLE ==================== */
.wfp-section-title {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.75;
    margin-bottom: 12px;
}

/* ==================== SEARCH BAR ==================== */
.wfp-search-bar {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

.wfp-city-input {
    flex: 1;
    padding: 10px 16px;
    border-radius: 100px;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.12);
    font-family: var(--wfp-font);
    font-size: 0.9rem;
    outline: none;
    transition: var(--wfp-transition);
}

.wfp-city-input:focus { background: rgba(255,255,255,0.2); border-color: rgba(255,255,255,0.4); }

.wfp-city-search-btn {
    padding: 10px 20px;
    border-radius: 100px;
    border: none;
    background: var(--wfp-primary);
    color: #fff;
    font-family: var(--wfp-font);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--wfp-transition);
    white-space: nowrap;
}

.wfp-city-search-btn:hover { background: var(--wfp-primary-dark); transform: translateY(-1px); }

/* ==================== LOADING ==================== */
.wfp-loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.45);
    border-radius: var(--wfp-radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: #fff;
    font-weight: 600;
    z-index: 10;
    backdrop-filter: blur(4px);
}

.wfp-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: wfp-spin 0.8s linear infinite;
}

@keyframes wfp-spin { to { transform: rotate(360deg); } }

/* ==================== ERROR ==================== */
.wfp-error {
    padding: 16px 20px;
    background: rgba(239,68,68,0.15);
    border: 1px solid rgba(239,68,68,0.3);
    border-radius: var(--wfp-radius-sm);
    color: #fca5a5;
    font-weight: 600;
}

/* ==================== MINI WIDGET ==================== */
.wfp-mini-wrap {
    font-family: var(--wfp-font);
}

.wfp-mini-inner {
    background: linear-gradient(135deg, var(--wfp-primary), var(--wfp-primary-dark));
    border-radius: var(--wfp-radius);
    padding: 16px;
    color: #fff;
    box-shadow: 0 4px 20px rgba(14, 165, 233, 0.35);
}

.wfp-mini-top {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.wfp-mini-temp {
    font-size: 2rem;
    font-weight: 800;
    display: block;
    line-height: 1;
}

.wfp-mini-desc {
    font-size: 0.85rem;
    opacity: 0.85;
}

.wfp-mini-city { font-size: 0.85rem; font-weight: 600; margin-bottom: 8px; }

.wfp-mini-stats {
    display: flex;
    gap: 12px;
    font-size: 0.8rem;
    opacity: 0.85;
    margin-bottom: 8px;
}

.wfp-mini-footer { font-size: 0.72rem; opacity: 0.65; }

/* ==================== ALERT BANNER ==================== */
.wfp-alert-banner {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(239,68,68,0.25), rgba(251,146,60,0.2));
    border: 1px solid rgba(239,68,68,0.4);
    border-radius: var(--wfp-radius-sm);
    margin-bottom: 12px;
    animation: wfp-pulse-border 2s ease-in-out infinite;
}

@keyframes wfp-pulse-border {
    0%, 100% { border-color: rgba(239,68,68,0.4); }
    50% { border-color: rgba(239,68,68,0.8); }
}

.wfp-alert-text {
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.5;
    flex: 1;
}


@media (max-width: 600px) {
    .wfp-theme-glassmorphism,
    .wfp-theme-minimal,
    .wfp-theme-dark,
    .wfp-theme-nature {
        padding: 14px;
        border-radius: 16px;
    }

    .wfp-temp-value { font-size: 3rem; }
    .wfp-stats-grid { grid-template-columns: repeat(2, 1fr); }

    .wfp-forecast-center { padding: 0 6px; }
    .wfp-forecast-day { min-width: 70px; font-size: 0.82rem; }

    .wfp-hourly-item { min-width: 56px; }
}

@media (max-width: 400px) {
    .wfp-stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .wfp-temp-value { font-size: 2.5rem; }
}

/* ==================== ENTRY ANIMATION ==================== */
.wfp-wrap .wfp-current-card { animation: wfp-fadeUp 0.4s ease both; }
.wfp-wrap .wfp-aqi-card { animation: wfp-fadeUp 0.4s ease 0.1s both; }
.wfp-wrap .wfp-ai-card { animation: wfp-fadeUp 0.4s ease 0.15s both; }
.wfp-wrap .wfp-hourly-card { animation: wfp-fadeUp 0.4s ease 0.2s both; }
.wfp-wrap .wfp-forecast-card { animation: wfp-fadeUp 0.4s ease 0.25s both; }

@keyframes wfp-fadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}
