/* =============================================
   KV Weather Widgets — shared CSS
   Matches class names from /js/kv-weather-widgets.js
   ============================================= */

/* ── Forecast Widget (wx-*) ── */
.wx-top-section { padding: 14px 16px 8px; }
.wx-current-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.wx-current-icon { font-size: 40px; line-height: 1; }
.wx-current-temp { font-size: 40px; font-weight: 300; color: var(--text-primary, #F7F9FC); line-height: 1; }
.wx-current-cond { font-size: 14px; color: rgba(255,255,255,0.55); }
.wx-future-row { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.wx-future-temps { font-size: 20px; font-weight: 600; color: var(--text-primary, #F7F9FC); }
.wx-future-detail { font-size: 13px; color: rgba(255,255,255,0.45); }

.wx-tab-bar {
    display: flex; gap: 0; padding: 0 16px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.wx-tab {
    padding: 8px 14px; font-size: 13px; font-weight: 600;
    color: rgba(255,255,255,0.35); background: none; border: none;
    border-bottom: 2px solid transparent; cursor: pointer;
    font-family: inherit; transition: all 0.15s;
}
.wx-tab:hover { color: rgba(255,255,255,0.55); }
.wx-tab-active { border-bottom: 2px solid currentColor; }

.wx-chart-wrap { position: relative; width: 100%; overflow: hidden; }
.wx-chart-wrap svg { display: block; width: 100%; }
.wx-chart-empty {
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted, #64748B); font-size: 0.8rem;
}

.wx-day-strip {
    display: flex; border-top: 1px solid rgba(255,255,255,0.06);
    overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.wx-day-cell {
    flex: 1; min-width: 80px; display: flex; flex-direction: column;
    align-items: center; gap: 3px; padding: 10px 4px;
    cursor: pointer; border: none; border-right: 1px solid rgba(255,255,255,0.04);
    transition: background 0.15s; background: none; color: inherit; font-family: inherit;
}
.wx-day-cell:last-child { border-right: none; }
.wx-day-cell:hover { background: rgba(255,255,255,0.04); }
.wx-day-selected { background: rgba(78,205,196,0.06); }
.wx-day-selected .wx-day-name { color: #4ECDC4; }
.wx-day-name { font-size: 12px; font-weight: 700; color: rgba(255,255,255,0.5); text-transform: uppercase; }
.wx-day-icon { font-size: 22px; line-height: 1.1; }
.wx-day-temps { display: flex; gap: 4px; font-size: 12px; color: var(--text-secondary, #CBD5E1); }
.wx-day-gauge {
    width: 24px; height: 24px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 10px; font-weight: 800;
}
.wx-day-moon { font-size: 14px; line-height: 1; }

/* ── Tide Chart (tide-*) ── */
.tide-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 14px; border-bottom: 1px solid rgba(255,255,255,0.06);
}
.tide-header-left { display: flex; align-items: baseline; gap: 8px; }
.tide-header-title { font-size: 0.9rem; font-weight: 600; color: var(--text-primary, #F7F9FC); }
.tide-header-station { font-size: 0.72rem; color: var(--text-muted, #64748B); }
.tide-header-btns { display: flex; gap: 6px; }
.tide-toggle-btn {
    padding: 5px 10px; font-size: 12px; font-weight: 600;
    border-radius: 8px; border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.04); color: rgba(255,255,255,0.45);
    cursor: pointer; font-family: inherit; transition: all 0.15s;
}
.tide-toggle-btn:hover { background: rgba(255,255,255,0.08); }
.tide-toggle-active { background: rgba(78,205,196,0.12); border-color: rgba(78,205,196,0.35); color: #4ECDC4; }

.tide-chart-scroll {
    overflow-x: auto; overflow-y: hidden; position: relative;
    -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.tide-chart-scroll::-webkit-scrollbar { display: none; }
.tide-chart-scroll svg { display: block; }

.tide-tooltip {
    position: absolute; z-index: 10; pointer-events: none;
    background: rgba(13,27,38,0.92); border: 1px solid rgba(255,255,255,0.15);
    border-radius: 8px; padding: 8px 12px; font-size: 0.8rem;
    color: var(--text-primary, #F7F9FC); backdrop-filter: blur(8px);
    white-space: nowrap; min-width: 140px; line-height: 1.5;
}

.tide-legend {
    display: flex; flex-wrap: wrap; gap: 12px; padding: 10px 14px;
    border-top: 1px solid rgba(255,255,255,0.06); align-items: center;
    font-size: 0.78rem;
}
.tide-legend-item { display: flex; align-items: center; gap: 4px; }

/* ── Bite Window (bw-*) ── */
.bw-container { display: flex; flex-direction: column; gap: 10px; }
.bw-day-strip {
    display: flex; gap: 4px; overflow-x: auto;
    -webkit-overflow-scrolling: touch; scrollbar-width: none; padding: 0 2px 2px;
}
.bw-day-strip::-webkit-scrollbar { display: none; }
.bw-day-btn {
    flex-shrink: 0; display: flex; flex-direction: column; align-items: center;
    gap: 1px; padding: 5px 10px; border-radius: 10px;
    border: 1px solid var(--border-secondary, rgba(255,255,255,0.08));
    background: var(--bg-secondary, #162533); color: var(--text-muted, #64748B);
    font-size: 12px; font-weight: 600; font-family: inherit;
    cursor: pointer; transition: all 0.15s; white-space: nowrap;
}
.bw-day-btn:hover { background: rgba(255,255,255,0.08); }
.bw-day-btn-active {
    background: rgba(34,197,94,0.12); border-color: rgba(34,197,94,0.35); color: #22c55e;
}

.bw-content { display: flex; flex-direction: column; gap: 8px; }
.bw-loading { color: var(--text-muted, #64748B); text-align: center; padding: 20px 0; font-size: 14px; }
.bw-no-data { color: var(--text-muted, #64748B); text-align: center; padding: 20px 0; font-size: 14px; }

.bw-card {
    display: flex; align-items: center; gap: 12px;
    background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
    border-left: 3px solid; border-radius: 10px; padding: 12px 14px;
    cursor: pointer; transition: background 0.15s;
}
.bw-card:hover { background: rgba(255,255,255,0.12); }
.bw-rank { font-size: 14px; font-weight: 700; color: var(--text-muted, #64748B); min-width: 24px; }
.bw-card-body { flex: 1; min-width: 0; }
.bw-time { font-size: 16px; font-weight: 600; color: var(--text-primary, #F7F9FC); }
.bw-label { font-size: 13px; font-weight: 600; margin-top: 2px; }
.bw-score-pill {
    font-size: 22px; font-weight: 800; padding: 4px 12px;
    border-radius: 10px; min-width: 44px; text-align: center;
}

.bw-timeline { margin-top: 12px; }
.bw-timeline-bars { display: flex; align-items: flex-end; height: 60px; gap: 1px; }
.bw-bar { flex: 1; min-width: 2px; border-radius: 2px 2px 0 0; transition: height 0.2s; }
.bw-timeline-labels {
    display: flex; justify-content: space-between; margin-top: 6px; padding: 0 2px;
    font-size: 11px; color: var(--text-muted, #64748B);
}

/* Reasons overlay */
.bw-reasons-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.7); z-index: 1000;
    display: flex; align-items: flex-end; justify-content: center;
    animation: bwFadeIn 0.15s ease-out;
}
@keyframes bwFadeIn { from { opacity: 0; } to { opacity: 1; } }
.bw-reasons-panel {
    background: #162a3a; border: 1px solid rgba(255,255,255,0.1);
    border-bottom: none; border-radius: 20px 20px 0 0;
    padding: 16px 20px 32px; width: 100%; max-width: 500px;
    animation: bwSlideUp 0.2s ease-out; box-shadow: 0 -8px 40px rgba(0,0,0,0.4);
}
@keyframes bwSlideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.bw-reasons-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 8px;
}
.bw-reasons-header span {
    font-size: 19px; font-weight: 700; color: var(--text-primary, #F7F9FC);
}
.bw-reasons-close {
    background: none; border: none; color: var(--text-muted, #64748B);
    font-size: 24px; cursor: pointer; padding: 4px 8px;
}
.bw-reason-row {
    display: flex; align-items: center; gap: 10px; padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.bw-reason-row:last-child { border-bottom: none; }
.bw-reason-signal { font-size: 14px; font-weight: 600; color: var(--text-primary, #F7F9FC); min-width: 90px; }
.bw-reason-note { flex: 1; font-size: 14px; color: var(--text-muted, #64748B); }
.bw-reason-score { font-size: 17px; font-weight: 700; min-width: 36px; text-align: right; }

/* ── Detailed Forecast (df-*) ── */
.df-container {
    display: flex; overflow: hidden;
    border: 1px solid var(--border-secondary, rgba(255,255,255,0.08));
    border-radius: 10px; background: var(--bg-tertiary, #1E3142);
}
.df-labels-col {
    display: flex; flex-direction: column; flex-shrink: 0;
    border-right: 1px solid var(--border-secondary, rgba(255,255,255,0.08));
    background: var(--bg-card, #162533); z-index: 2;
}
.df-scroll-area { flex: 1; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.df-scroll-inner { display: flex; flex-direction: column; min-width: fit-content; }
.df-row { display: flex; }
.df-cell {
    display: flex; align-items: center; justify-content: center;
    min-width: 44px; min-height: 36px; font-size: 11px;
    color: var(--text-secondary, #CBD5E1);
    border-bottom: 1px solid rgba(255,255,255,0.04);
    border-right: 1px solid rgba(255,255,255,0.02);
    white-space: nowrap;
}
.df-label {
    padding: 0 10px; font-size: 13px; color: var(--text-muted, #64748B);
    font-weight: 500; min-width: 50px;
}
.df-day-header {
    font-size: 12px; font-weight: 700; color: var(--text-primary, #F7F9FC);
    background: rgba(255,255,255,0.03);
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.df-today { color: #4ECDC4; }
.df-night { background: rgba(15,23,42,0.4); }
.df-gauge { font-weight: 700; }
.df-cond-bar { min-height: 4px; max-height: 4px; padding: 0; }
.df-wind-arrow { font-size: 10px; margin-right: 1px; }

/* ── Compact Gauges (cg-*) ── */
.cg-row { display: flex; gap: 24px; justify-content: center; padding: 8px 0; }
.cg-card {
    display: flex; flex-direction: column; align-items: center;
    gap: 6px; flex: 1; max-width: 140px;
}
.cg-title {
    font-size: 12px; font-weight: 600; color: var(--text-muted, #64748B);
    text-transform: uppercase; letter-spacing: 0.5px;
}
.cg-gauge { position: relative; display: flex; align-items: center; justify-content: center; }
.cg-score {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.25rem; font-weight: 700;
}
.cg-badge {
    display: inline-block; padding: 2px 10px; border-radius: 9999px;
    font-size: 10px; font-weight: 700; color: #000; text-transform: uppercase;
}
.cg-day { font-size: 12px; color: var(--text-muted, #64748B); margin-top: 2px; }

/* ── Responsive ── */
@media (max-width: 640px) {
    .wx-day-cell { min-width: 65px; padding: 8px 3px; }
    .df-cell { min-width: 38px; max-width: 38px; font-size: 10px; }
    .bw-card { padding: 10px 12px; }
    .bw-score-pill { font-size: 18px; padding: 3px 10px; }
}
