/* ================================================================
   Weather Widget Pro — Public Styles v2.0
   ================================================================ */

/* ── CSS Variable Defaults ────────────────────────────────────── */
.wwp-root {
    --wwp-font:         'Outfit', sans-serif;
    --wwp-fs-base:      15px;
    --wwp-fs-temp:      68px;
    --wwp-fs-label:     11px;
    --wwp-fw-normal:    400;
    --wwp-fw-bold:      700;
    --wwp-bg:           #0f1b2d;
    --wwp-text:         #e8f4fd;
    --wwp-accent:       #4fc3f7;
    --wwp-card-bg:      rgba(255,255,255,0.06);
    --wwp-border:       rgba(255,255,255,0.10);
    --wwp-blur:         12px;
    --wwp-shadow:       0 8px 40px rgba(0,0,0,0.45);
    --wwp-radius:       20px;
    --wwp-padding:      24px;
    --wwp-width:        100%;
    --wwp-max-width:    860px;
    --wwp-grad-start:   #0f1b2d;
    --wwp-grad-end:     #1a2f4a;
}

/* ── Reset ────────────────────────────────────────────────────── */
.wwp-root *, .wwp-root *::before, .wwp-root *::after {
    box-sizing: border-box; margin: 0; padding: 0;
    -webkit-font-smoothing: antialiased;
}

/* ── Outer wrapper ────────────────────────────────────────────── */
.wwp-root {
    width: var(--wwp-width);
    max-width: var(--wwp-max-width);
    font-family: var(--wwp-font);
    font-size: var(--wwp-fs-base);
    font-weight: var(--wwp-fw-normal);
    color: var(--wwp-text);
    background: linear-gradient(145deg, var(--wwp-grad-start), var(--wwp-grad-end));
    border-radius: var(--wwp-radius);
    box-shadow: var(--wwp-shadow);
    overflow: hidden;
    position: relative;
}

/* ── Loading ──────────────────────────────────────────────────── */
.wwp-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 24px;
    gap: 16px;
    opacity: 0.65;
}
.wwp-spinner {
    width: 38px; height: 38px;
    border: 3px solid rgba(255,255,255,0.12);
    border-top-color: var(--wwp-accent);
    border-radius: 50%;
    animation: wwp-spin 0.75s linear infinite;
}
@keyframes wwp-spin { to { transform: rotate(360deg); } }

/* ── Error ────────────────────────────────────────────────────── */
.wwp-error {
    margin: 20px;
    padding: 16px 20px;
    background: rgba(220,53,69,0.15);
    border: 1px solid rgba(220,53,69,0.4);
    border-radius: 12px;
    color: #ff8a80;
    font-size: 0.9em;
    text-align: center;
}

/* ================================================================
   LOCATION SEARCH BAR
   ================================================================ */
.wwp-search-bar {
    padding: 16px 20px 0;
    position: relative;
}
.wwp-search-inner {
    display: flex;
    gap: 8px;
    align-items: center;
}
.wwp-search-field {
    position: relative;
    flex: 1;
}
.wwp-search-field input {
    width: 100%;
    background: rgba(255,255,255,0.08);
    border: 1px solid var(--wwp-border);
    border-radius: 50px;
    padding: 10px 16px 10px 40px;
    color: var(--wwp-text);
    font-family: var(--wwp-font);
    font-size: 0.88em;
    outline: none;
    transition: border-color 0.2s, background 0.2s;
}
.wwp-search-field input::placeholder { color: rgba(255,255,255,0.3); }
.wwp-search-field input:focus {
    border-color: var(--wwp-accent);
    background: rgba(255,255,255,0.12);
}
.wwp-search-ico {
    position: absolute;
    left: 14px; top: 50%;
    transform: translateY(-50%);
    font-size: 13px; opacity: 0.45;
    pointer-events: none;
}
.wwp-btn {
    background: rgba(255,255,255,0.08);
    border: 1px solid var(--wwp-border);
    color: var(--wwp-text);
    border-radius: 50px;
    padding: 10px 16px;
    cursor: pointer;
    font-size: 12px;
    font-family: var(--wwp-font);
    font-weight: 600;
    transition: background 0.2s, border-color 0.2s;
    white-space: nowrap;
    line-height: 1;
}
.wwp-btn:hover { background: rgba(255,255,255,0.16); border-color: var(--wwp-accent); }
.wwp-btn-search { background: var(--wwp-accent); color: #000; border-color: var(--wwp-accent); }
.wwp-btn-search:hover { opacity: 0.85; background: var(--wwp-accent); }
.wwp-btn-gps.active { border-color: var(--wwp-accent); color: var(--wwp-accent); }

/* Dropdown results */
.wwp-results {
    position: absolute;
    top: calc(100% + 6px);
    left: 0; right: 0;
    background: #152440;
    border: 1px solid var(--wwp-border);
    border-radius: 14px;
    overflow: hidden;
    z-index: 9999;
    box-shadow: 0 12px 32px rgba(0,0,0,0.5);
    display: none;
}
.wwp-results.open { display: block; }
.wwp-result-row {
    display: flex; align-items: center; gap: 10px;
    padding: 11px 16px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    font-size: 0.85em;
    transition: background 0.15s;
}
.wwp-result-row:last-child { border-bottom: none; }
.wwp-result-row:hover, .wwp-result-row.hi { background: rgba(79,195,247,0.12); color: var(--wwp-accent); }
.wwp-result-name { flex: 1; }
.wwp-result-latlng { font-size: 10px; opacity: 0.35; flex-shrink: 0; }
.wwp-results-msg { padding: 13px 16px; font-size: 0.85em; opacity: 0.5; text-align: center; }

/* GPS status */
.wwp-gps-msg {
    font-size: 11px;
    padding: 6px 4px 2px;
    min-height: 22px;
    opacity: 0.6;
    transition: opacity 0.3s;
}
.wwp-gps-msg.ok  { color: #4caf7d; opacity: 1; }
.wwp-gps-msg.err { color: #ff8a80; opacity: 1; }

/* ================================================================
   MAIN CARD — always-visible hero section
   ================================================================ */
.wwp-card {
    padding: var(--wwp-padding);
}

/* Header row: location + refresh */
.wwp-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 22px;
}
.wwp-loc-name {
    font-size: 1.05em;
    font-weight: var(--wwp-fw-bold);
    display: flex; align-items: center; gap: 6px;
}
.wwp-loc-name span { opacity: 0.9; }
.wwp-updated { font-size: var(--wwp-fs-label); opacity: 0.4; margin-top: 4px; letter-spacing: 0.5px; }
.wwp-btn-refresh {
    background: rgba(255,255,255,0.07);
    border: 1px solid var(--wwp-border);
    color: var(--wwp-text);
    border-radius: 50%;
    width: 34px; height: 34px;
    cursor: pointer;
    font-size: 14px;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.2s, transform 0.3s;
    flex-shrink: 0;
}
.wwp-btn-refresh:hover { background: rgba(255,255,255,0.14); transform: rotate(90deg); }

/* Hero weather display */
.wwp-hero {
    display: flex;
    align-items: flex-end;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 26px;
}
.wwp-temp-block { line-height: 1; }
.wwp-temp-big {
    font-size: var(--wwp-fs-temp);
    font-weight: 800;
    letter-spacing: -3px;
    color: var(--wwp-accent);
    line-height: 0.9;
}
.wwp-temp-unit { font-size: 0.42em; letter-spacing: 0; opacity: 0.7; vertical-align: super; }
.wwp-feels { font-size: 0.82em; opacity: 0.55; margin-top: 8px; }
.wwp-cond-block { flex: 1; min-width: 130px; }
.wwp-cond-icon { font-size: 54px; line-height: 1; display: block; }
.wwp-cond-label { font-size: 1.1em; font-weight: 600; margin-top: 6px; }
.wwp-day-badge {
    display: inline-block;
    margin-top: 5px;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 10px;
    letter-spacing: 1px;
    text-transform: uppercase;
    background: rgba(255,255,255,0.08);
    border: 1px solid var(--wwp-border);
}

/* Quick-stats strip (4 key metrics always shown) */
.wwp-quick {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}
.wwp-quick-item {
    background: var(--wwp-card-bg);
    border: 1px solid var(--wwp-border);
    border-radius: 14px;
    padding: 12px 10px;
    text-align: center;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.wwp-quick-icon { font-size: 1.3em; }
.wwp-quick-val { font-weight: var(--wwp-fw-bold); color: var(--wwp-accent); font-size: 0.95em; margin: 4px 0 2px; }
.wwp-quick-lbl { font-size: 10px; opacity: 0.45; text-transform: uppercase; letter-spacing: 0.8px; }

/* ================================================================
   ACCORDION SECTIONS
   ================================================================ */
.wwp-sections { display: flex; flex-direction: column; gap: 8px; }

.wwp-section {
    background: var(--wwp-card-bg);
    border: 1px solid var(--wwp-border);
    border-radius: 16px;
    overflow: hidden;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

/* Section toggle header */
.wwp-sec-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}
.wwp-sec-head:hover { background: rgba(255,255,255,0.04); }
.wwp-sec-title {
    display: flex; align-items: center; gap: 10px;
    font-weight: var(--wwp-fw-bold);
    font-size: 0.92em;
}
.wwp-sec-emoji { font-size: 1.2em; }
.wwp-sec-preview {
    font-size: 0.78em;
    opacity: 0.45;
    margin-left: 4px;
    font-weight: 400;
}
.wwp-sec-chevron {
    font-size: 10px;
    opacity: 0.5;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}
.wwp-section.open .wwp-sec-chevron { transform: rotate(180deg); }

/* Section body — collapsed by default */
.wwp-sec-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.3s ease;
    padding: 0 18px;
}
.wwp-section.open .wwp-sec-body {
    max-height: 2000px;
    padding: 0 18px 18px;
}

/* Section subtitle */
.wwp-sec-sub {
    font-size: var(--wwp-fs-label);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    opacity: 0.4;
    font-weight: var(--wwp-fw-bold);
    margin-bottom: 12px;
    padding-top: 4px;
}

/* ── Metrics grid (inside section) ──────────────────────────── */
.wwp-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
}
.wwp-metric {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 12px;
    padding: 11px 12px;
    transition: transform 0.2s;
}
.wwp-metric:hover { transform: translateY(-2px); }
.wwp-metric-ico { font-size: 1.2em; margin-bottom: 5px; }
.wwp-metric-lbl { font-size: 10px; opacity: 0.45; text-transform: uppercase; letter-spacing: 0.8px; }
.wwp-metric-val { font-weight: var(--wwp-fw-bold); color: var(--wwp-accent); font-size: 1.0em; margin-top: 2px; }

/* ── Hourly scroll ────────────────────────────────────────── */
.wwp-hourly {
    display: flex; gap: 8px;
    overflow-x: auto; padding-bottom: 4px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}
.wwp-hourly::-webkit-scrollbar { height: 3px; }
.wwp-hourly::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 2px; }
.wwp-h-card {
    flex-shrink: 0;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 12px;
    padding: 10px 12px;
    text-align: center;
    min-width: 68px;
    transition: transform 0.2s, border-color 0.2s;
}
.wwp-h-card:hover { transform: translateY(-3px); border-color: rgba(79,195,247,0.3); }
.wwp-h-card.now { border-color: var(--wwp-accent); background: rgba(79,195,247,0.1); }
.wwp-h-time { font-size: 10px; opacity: 0.5; margin-bottom: 5px; }
.wwp-h-icon { font-size: 1.35em; }
.wwp-h-temp { font-weight: var(--wwp-fw-bold); color: var(--wwp-accent); font-size: 0.9em; margin: 4px 0; }
.wwp-h-rain { font-size: 10px; opacity: 0.55; }
.wwp-h-wind { font-size: 10px; opacity: 0.4; margin-top: 2px; }

/* ── Daily list ───────────────────────────────────────────── */
.wwp-daily { display: flex; flex-direction: column; gap: 6px; }
.wwp-d-row {
    display: grid;
    grid-template-columns: 74px 38px 1fr 90px 55px;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 12px;
    transition: transform 0.15s, border-color 0.15s;
}
.wwp-d-row:hover { transform: translateX(4px); border-color: rgba(79,195,247,0.25); }
.wwp-d-day { font-weight: var(--wwp-fw-bold); font-size: 0.88em; }
.wwp-d-icon { font-size: 1.35em; text-align: center; }
.wwp-d-cond { font-size: 0.82em; opacity: 0.55; }
.wwp-d-temps { text-align: right; }
.wwp-d-max { font-weight: var(--wwp-fw-bold); color: var(--wwp-accent); }
.wwp-d-min { font-size: 0.82em; opacity: 0.45; }
.wwp-d-rain { font-size: 0.8em; opacity: 0.55; text-align: center; }

/* ── Astronomy row ────────────────────────────────────────── */
.wwp-astro {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}
.wwp-astro-item {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 12px;
    padding: 12px 10px;
    text-align: center;
}
.wwp-astro-ico { font-size: 1.6em; }
.wwp-astro-lbl { font-size: 10px; opacity: 0.45; text-transform: uppercase; letter-spacing: 0.8px; margin: 5px 0 3px; }
.wwp-astro-val { font-weight: var(--wwp-fw-bold); font-size: 0.88em; }

/* ── UV bar ───────────────────────────────────────────────── */
.wwp-uv-row {
    display: flex; align-items: center; gap: 14px;
    margin-bottom: 10px;
}
.wwp-uv-num {
    font-size: 2em; font-weight: 800;
    color: var(--wwp-accent); line-height: 1;
    min-width: 40px;
}
.wwp-uv-right { flex: 1; }
.wwp-uv-label { font-size: 0.88em; font-weight: 600; margin-bottom: 6px; }
.wwp-uv-track {
    height: 7px; border-radius: 4px;
    background: linear-gradient(90deg,#27ae60,#f1c40f,#e67e22,#e74c3c,#8e44ad);
    position: relative;
}
.wwp-uv-dot {
    position: absolute; top: 50%;
    transform: translate(-50%,-50%);
    width: 14px; height: 14px;
    background: #fff; border-radius: 50%;
    border: 3px solid var(--wwp-accent);
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}

/* ── Air quality ──────────────────────────────────────────── */
.wwp-aqi-badge {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 12px; font-weight: 700;
    margin-bottom: 12px;
}
.aqi-good     { background:#1e8449; color:#fff; }
.aqi-fair     { background:#d4ac0d; color:#000; }
.aqi-moderate { background:#e67e22; color:#fff; }
.aqi-poor     { background:#e74c3c; color:#fff; }
.aqi-very     { background:#7d3c98; color:#fff; }
.aqi-hazardous{ background:#641e16; color:#fff; }
.wwp-aq-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 7px;
}
.wwp-aq-item {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px;
    padding: 9px 10px;
    text-align: center;
}
.wwp-aq-lbl { font-size: 10px; opacity: 0.45; text-transform: uppercase; letter-spacing: 0.5px; }
.wwp-aq-val { font-weight: var(--wwp-fw-bold); color: var(--wwp-accent); font-size: 0.95em; margin-top: 4px; }

/* ── Sea / Marine ─────────────────────────────────────────── */
.wwp-sea-state {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 5px 14px;
    border-radius: 20px;
    background: rgba(79,195,247,0.12);
    border: 1px solid rgba(79,195,247,0.3);
    color: var(--wwp-accent);
    font-size: 12px; font-weight: 700;
    margin-bottom: 12px;
}
.wwp-sea-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 8px;
    margin-bottom: 14px;
}
.wwp-sea-item {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 12px;
    padding: 11px 12px;
}
.wwp-sea-lbl { font-size: 10px; opacity: 0.4; text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 5px; }
.wwp-sea-val { font-weight: var(--wwp-fw-bold); color: var(--wwp-accent); font-size: 1.0em; }
.wwp-sea-sub { font-size: 0.78em; opacity: 0.45; margin-top: 2px; }

/* Wave SVG decoration */
.wwp-wave-deco {
    height: 32px; overflow: hidden; border-radius: 6px; margin: 8px 0;
}
.wwp-wave-deco svg { width: 100%; height: 100%; }

/* Sea hourly scroll */
.wwp-sea-hourly {
    display: flex; gap: 7px;
    overflow-x: auto; padding-bottom: 4px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
    margin-top: 14px;
}
.wwp-sea-hourly::-webkit-scrollbar { height: 3px; }
.wwp-sea-h-card {
    flex-shrink: 0;
    min-width: 78px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px;
    padding: 9px 10px;
    text-align: center;
    font-size: 12px;
}
.wwp-sea-h-time { opacity: 0.45; margin-bottom: 5px; }
.wwp-sea-h-wave { font-weight: 700; color: var(--wwp-accent); }
.wwp-sea-h-swell { opacity: 0.5; margin-top: 3px; font-size: 11px; }
.wwp-sea-h-sst { opacity: 0.4; font-size: 10px; margin-top: 2px; }

/* ── Divider ──────────────────────────────────────────────── */
.wwp-div { border: none; border-top: 1px solid rgba(255,255,255,0.06); margin: 14px 0; }

/* ================================================================
   ANIMATIONS
   ================================================================ */
.wwp-anim .wwp-card     { animation: wwp-up 0.5s ease both; }
.wwp-anim .wwp-sections { animation: wwp-up 0.5s 0.1s ease both; }
@keyframes wwp-up {
    from { opacity:0; transform:translateY(14px); }
    to   { opacity:1; transform:translateY(0); }
}

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 580px) {
    .wwp-temp-big { font-size: calc(var(--wwp-fs-temp)*0.75); }
    .wwp-quick { grid-template-columns: repeat(2,1fr); }
    .wwp-astro { grid-template-columns: repeat(2,1fr); }
    .wwp-d-row { grid-template-columns: 60px 30px 1fr 76px; }
    .wwp-d-rain { display: none; }
    .wwp-header { flex-direction: row; }
}
