/* v2 Weather UI */
.vnx-weather-widget {
    --vnx-w-bg: #fff;
    --vnx-w-border: #e5e7eb;
    --vnx-w-text: #0f172a;
    --vnx-w-muted: #64748b;
    --vnx-w-brand: #2b5d8f;
    --vnx-w-soft: #f8fafc;
    --vnx-w-good: #16a34a;
    --vnx-w-moderate: #ca8a04;
    --vnx-w-poor: #dc2626;
    display: block;
    width: 100%;
    max-width: 980px;
    border: 1px solid var(--vnx-w-border);
    border-radius: 16px;
    background: var(--vnx-w-bg);
    color: var(--vnx-w-text);
    overflow: hidden;
    /* box-shadow: 0 3px 14px rgba(15, 23, 42, 0.06); */
}

.vnx-weather-widget *,
.vnx-weather-widget *::before,
.vnx-weather-widget *::after { box-sizing: border-box; }

.vnx-weather-widget__header {
    background: linear-gradient(135deg, #2b5d8f, #355f93);
    color: #fff;
    padding: 16px 18px 14px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.vnx-weather-widget__header-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.vnx-weather-widget__subtitle {
    margin: 0;
    padding: 0;
    font-size: 13px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.82);
    line-height: 1.35;
}

.vnx-weather-widget__title {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 22px;
    font-weight: 700;
}

.vnx-weather-widget__title i { font-size: 18px; }

.vnx-weather-widget__live-badge {
    display: inline-flex;
    flex-shrink: 0;
    align-self: flex-start;
    border-radius: 999px;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.22);
    font-size: 12px;
    font-weight: 600;
}

.vnx-weather-widget__body { padding: 16px 18px 18px; }

.vnx-weather-section { padding-top: 14px; }
.vnx-weather-section + .vnx-weather-section {
    border-top: 1px solid var(--vnx-w-border);
    margin-top: 14px;
}

.vnx-weather-section__title {
    margin: 0 0 10px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #6b7280;
    font-weight: 700;
}

/* Marine block heading — UI reference grey-blue */
.vnx-weather-section:has(> .vnx-weather-marine-grid) .vnx-weather-section__title {
    color: #5a7184;
}

.vnx-weather-top-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.vnx-weather-card {
    /* border: 1px solid #edf2f7; */
    /* border-radius: 12px; */
    padding: 12px;
    /* background: #fbfdff; */
}

.vnx-weather-current-main {
    display: flex;
    align-items: center;
    gap: 12px;
}

.vnx-weather-current-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fffaf0;
    color: #f59e0b;
    font-size: 28px;
}

.vnx-weather-current-temp {
    font-size: 40px;
    line-height: 1;
    font-weight: 800;
}

.vnx-weather-current-desc {
    margin-top: 4px;
    font-size: 18px;
    color: var(--vnx-w-muted);
    text-transform: capitalize;
}

.vnx-weather-current-meta {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.vnx-weather-meta-pill {
    border: 1px solid  #9CA3AF;
    background: #fff;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    color: #334155;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.vnx-weather-meta-pill i {
    color: #3b82f6;
    font-size: 11px;
}

.vnx-weather-insight-box {
    border: 1px solid #bbf7d0;
    background: #f0fdf4;
    border-radius: 12px;
    padding: 10px 12px;
}
.vnx-weather-insight-box.is-moderate { border-color: #fde68a; background: #fffbeb; }
.vnx-weather-insight-box.is-poor { border-color: #fecaca; background: #fef2f2; }

.vnx-weather-insight-head {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 22px;
    color: #166534;
}
.vnx-weather-insight-box.is-moderate .vnx-weather-insight-head { color: #92400e; }
.vnx-weather-insight-box.is-poor .vnx-weather-insight-head { color: #991b1b; }

.vnx-weather-insight-score {
    margin-left: auto;
    min-width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(255,255,255,.8);
    font-weight: 800;
}

.vnx-weather-insight-note {
    margin: 8px 0 0;
    font-size: 13px;
    color: #334155;
}

.vnx-weather-hourly {
    display: grid;
    grid-template-columns: repeat(8, minmax(84px, 1fr));
    gap: 8px;
    overflow-x: auto;
}

.vnx-weather-hourly-card {
    border: 1px solid #edf2f7;
    background: #fbfdff;
    border-radius: 10px;
    padding: 8px;
    min-width: 84px;
    text-align: center;
}
.vnx-weather-hourly-time { font-size: 12px; color: #64748b; font-weight: 600; }
.vnx-weather-hourly-icon { margin: 4px 0; color: #f59e0b; font-size: 20px; }
.vnx-weather-hourly-temp { font-size: 14px; font-weight: 500; line-height: 1.5; }
.vnx-weather-hourly-rain {
    font-size: 12px;
    color: #4DA3FF;
    margin-top: 4px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.vnx-weather-marine-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}
.vnx-weather-marine-card {
    border: none;
    border-radius: 14px;
    padding: 12px 12px 14px;
}

/* Waves — pale blue */
.vnx-weather-marine-grid .vnx-weather-marine-card:nth-child(1) {
    background: #ebf8ff;
}
.vnx-weather-marine-grid .vnx-weather-marine-card:nth-child(1) .vnx-weather-marine-label i {
    color: #0056d2;
}

/* Wind — pale mint */
.vnx-weather-marine-grid .vnx-weather-marine-card:nth-child(2) {
    background: #f0fff4;
}
.vnx-weather-marine-grid .vnx-weather-marine-card:nth-child(2) .vnx-weather-marine-label i {
    color: #38a169;
}

/* Tide — pale lavender */
.vnx-weather-marine-grid .vnx-weather-marine-card:nth-child(3) {
    background: #faf5ff;
}
.vnx-weather-marine-grid .vnx-weather-marine-card:nth-child(3) .vnx-weather-marine-label i {
    color: #805ad5;
}
.vnx-weather-marine-grid .vnx-weather-marine-card:nth-child(3) .vnx-weather-marine-value {
    color: #44337a;
}

/* Visibility — pale cream */
.vnx-weather-marine-grid .vnx-weather-marine-card:nth-child(4) {
    background: #fffbeb;
}
.vnx-weather-marine-grid .vnx-weather-marine-card:nth-child(4) .vnx-weather-marine-label i {
    color: #dd6b20;
}
.vnx-weather-marine-grid .vnx-weather-marine-card:nth-child(4) .vnx-weather-marine-value {
    color: #744210;
}

.vnx-weather-marine-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #64748b;
    font-weight: 600;
    margin-bottom: 6px;
}

.vnx-weather-marine-label i {
    width: 16px;
    text-align: center;
    font-size: 14px;
}
.vnx-weather-marine-value {
    display: block;
    font-size: 18px;
    line-height: 1.05;
    font-weight: 700;
    color: #0f172a;
}
.vnx-weather-marine-value-unit {
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
}
.vnx-weather-marine-sub {
    display: block;
    margin-top: 6px;
    color: #94a3b8;
    font-size: 12px;
    font-weight: 500;
}
.vnx-weather-water-temp {
    margin: 12px 0 0;
    font-size: 13px;
    font-weight: 500;
    color: #5a7184;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.vnx-weather-water-temp > i {
    font-size: 14px;
    opacity: 0.92;
}

.vnx-weather-days {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}
.vnx-weather-day-card {
    border: 1px solid #edf2f7;
    border-radius: 14px;
    background: #fff;
    padding: 12px;
}
.vnx-weather-day-card.is-highlight {
    border-color: #93c5fd;
    box-shadow: inset 0 0 0 1px #93c5fd;
}
.vnx-weather-day-date { font-weight: 700; margin-bottom: 8px; font-size: 17px; }
.vnx-weather-day-top { display: flex; align-items: center; justify-content: space-between; }
.vnx-weather-day-desc { font-size: 14px; color: #64748b; text-transform: capitalize; }
.vnx-weather-day-icon { color: #f59e0b; font-size: 26px; }
.vnx-weather-day-temp { margin-top: 10px; font-size: 18px; line-height: 1; font-weight: 700; }
.vnx-weather-day-rain {
    margin-top: 8px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #1F78D1;
    font-weight: 600;
}

.vnx-weather-widget--error .vnx-weather-widget__body,
.vnx-weather-widget__empty {
    padding: 12px;
    border-radius: 10px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    color: #9a3412;
    text-align: center;
    font-size: 13px;
}

.vnx-weather-widget__sr {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

.vnx-weather-widget__skeleton {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.vnx-weather-widget__skeleton-line,
.vnx-weather-widget__skeleton-box {
    background: linear-gradient(90deg, #f3f4f6 0%, #e5e7eb 50%, #f3f4f6 100%);
    background-size: 200% 100%;
    animation: vnx-weather-shimmer 1.2s infinite linear;
    border-radius: 8px;
}
.vnx-weather-widget__skeleton-line { height: 16px; }
.vnx-weather-widget__skeleton-line--short { width: 60%; height: 12px; }
.vnx-weather-widget__skeleton-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; }
.vnx-weather-widget__skeleton-box { height: 70px; }

@keyframes vnx-weather-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.vnx-weather-widget--compact {
    max-width: 420px;
    border-color: #a6ddff;
    border-radius: 14px;
    background: #f4fbff;
    box-shadow: none;
}
.vnx-weather-widget--compact .vnx-weather-widget__header {
    padding: 12px 14px;
    align-items: center;
}
.vnx-weather-widget--compact .vnx-weather-widget__title {
    font-size: 16px;
}
.vnx-weather-widget--compact .vnx-weather-widget__title i {
    font-size: 14px;
}
.vnx-weather-widget--compact .vnx-weather-widget__live-badge {
    font-size: 11px;
    padding: 3px 8px;
}
.vnx-weather-widget--compact .vnx-weather-hourly,
.vnx-weather-widget--compact .vnx-weather-marine-grid { display: none; }
.vnx-weather-widget--compact .vnx-weather-section__title { display: none; }
.vnx-weather-widget--compact .vnx-weather-section {
    padding-top: 0;
}
.vnx-weather-widget--compact .vnx-weather-section + .vnx-weather-section {
    border-top: 0;
    margin-top: 12px;
}
.vnx-weather-widget--compact .vnx-weather-top-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.vnx-weather-widget--compact .vnx-weather-days {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}
.vnx-weather-widget--compact .vnx-weather-card,
.vnx-weather-widget--compact .vnx-weather-day-card {
    padding: 10px;
}
.vnx-weather-widget--compact .vnx-weather-top-grid .vnx-weather-card {
    /* border: 1px solid #d6efff; */
    /* border-radius: 12px; */
    /* background: #ffffff; */
}
.vnx-weather-widget--compact .vnx-weather-current-main { gap: 10px; }
.vnx-weather-widget--compact .vnx-weather-current-icon {
    width: 44px;
    height: 44px;
    font-size: 24px;
    border-radius: 12px;
    background: none !important;
}
.vnx-weather-widget--compact .vnx-weather-current-temp { font-size: 20px; font-weight: 700; }
.vnx-weather-widget--compact .vnx-weather-current-desc {
    font-size: 12px;
    font-weight: 500;
    color: #64748b;
    margin-top: 2px;
    text-transform: capitalize;
}
.vnx-weather-widget--compact .vnx-weather-insight-box {
    border: 1px solid #86efac;
    background: #edfff3;
}
.vnx-weather-widget--compact .vnx-weather-insight-head { font-size: 16px; gap: 6px; line-height: 1.35; }
.vnx-weather-widget--compact .vnx-weather-insight-note { font-size: 13px; margin-top: 4px; }
.vnx-weather-widget--compact .vnx-weather-insight-score { min-width: 22px; height: 22px; font-size: 12px; }
.vnx-weather-widget--compact .vnx-weather-current-meta { margin-top: 6px; gap: 4px; }
.vnx-weather-widget--compact .vnx-weather-meta-pill { font-size: 10px; padding: 2px 6px; }
.vnx-weather-widget--compact .vnx-weather-day-card {
    border: 1px solid #d8ebfb;
    background: #ffffff;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;   /* 🔥 center ngang */
    text-align: center;    /* 🔥 center text */
    gap: 6px;
}
.vnx-weather-widget--compact .vnx-weather-day-card.is-highlight {
    border-color: #1d4f8f;
    background: #edf6ff;
    box-shadow: inset 0 0 0 1px #9cc5eb;
}
.vnx-weather-widget--compact .vnx-weather-day-date {
    font-size: 11px;
    margin-bottom: 5px;
    font-weight: 600;
    color: #64748b;
}
.vnx-weather-widget--compact .vnx-weather-day-desc { font-size: 11px; }
.vnx-weather-widget--compact .vnx-weather-day-icon { font-size: 16px; color: #f59e0b; }
.vnx-weather-widget--compact .vnx-weather-day-temp { font-size: 14px; margin-top: 8px; font-weight: 500; line-height: 1.05; }
.vnx-weather-widget--compact .vnx-weather-day-rain {
    margin-top: 6px;
    font-size: 11px;
    color: #166534;
    background: #d1fae5;
    border: 1px solid #86efac;
    border-radius: 999px;
    padding: 2px 8px;
}
.vnx-weather-widget--compact .vnx-weather-widget__body { padding: 12px; }

@media (max-width: 900px) {
    .vnx-weather-top-grid,
    .vnx-weather-marine-grid,
    .vnx-weather-days { grid-template-columns: 1fr; }
    .vnx-weather-hourly { grid-template-columns: repeat(4, minmax(84px, 1fr)); }
}
