/* Meteo — admin weather charts for nearest stopwatch track */

.settings-container.meteo-container {
    box-sizing: border-box;
    max-width: 960px;
    margin: 0 auto;
    padding-bottom: max(32px, env(safe-area-inset-bottom, 0px));
}

.meteo-main {
    box-sizing: border-box;
    color: #ccc;
    font-family: ui-monospace, "Cousine", monospace;
}

.meteo-hero {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px 20px;
    margin-bottom: 22px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.meteo-track-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #6e7680;
    margin: 0 0 6px;
}

.meteo-track-picker {
    position: relative;
    min-width: min(100%, 18rem);
    max-width: 100%;
}

.meteo-track-btn {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    box-sizing: border-box;
    width: 100%;
    max-width: 28rem;
    margin: 0;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.04);
    color: #f0f2f5;
    font-family: inherit;
    font-size: clamp(1rem, 3.6vw, 1.35rem);
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1.25;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.meteo-track-btn:hover,
.meteo-track-btn--open {
    border-color: rgba(255, 255, 255, 0.38);
    background: rgba(255, 255, 255, 0.07);
}

.meteo-track-btn-label {
    flex: 1 1 auto;
    min-width: 0;
    overflow-wrap: anywhere;
}

.meteo-track-btn-caret {
    flex: 0 0 auto;
    font-size: 0.85em;
    opacity: 0.7;
}

.meteo-track-menu {
    position: absolute;
    z-index: 40;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    max-width: 28rem;
    max-height: min(60vh, 360px);
    overflow: auto;
    padding: 6px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(14, 14, 14, 0.98);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.55);
}

.meteo-track-option {
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    padding: 11px 12px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #d5d9df;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.35;
    text-align: left;
    cursor: pointer;
}

.meteo-track-option:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #fff;
}

.meteo-track-option--active {
    background: rgba(0, 255, 156, 0.12);
    color: #00ff9c;
}

.meteo-track-name {
    margin: 0;
    font-size: clamp(1.25rem, 4vw, 1.75rem);
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #f0f2f5;
    line-height: 1.2;
}

.meteo-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    font-size: 12px;
    color: #7a828e;
    text-align: right;
}

.meteo-meta-live {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #9aa3ad;
}

.meteo-pulse {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #00ff9c;
    box-shadow: 0 0 0 0 rgba(0, 255, 156, 0.45);
    animation: meteo-pulse 1.8s ease-out infinite;
}

.meteo-pulse--paused {
    background: #666;
    box-shadow: none;
    animation: none;
}

@keyframes meteo-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 255, 156, 0.45);
    }
    70% {
        box-shadow: 0 0 0 8px rgba(0, 255, 156, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0, 255, 156, 0);
    }
}

.meteo-status,
.meteo-error {
    margin: 0 0 18px;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.45;
}

.meteo-status {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #9aa3ad;
}

.meteo-error {
    background: rgba(255, 71, 87, 0.08);
    border: 1px solid rgba(255, 71, 87, 0.28);
    color: #ff8a95;
}

.meteo-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 14px 22px;
    margin-bottom: 18px;
    font-size: 12px;
    color: #8a939f;
}

.meteo-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.meteo-legend-swatch {
    width: 28px;
    height: 3px;
    border-radius: 2px;
    background: currentColor;
}

.meteo-legend-item--fact {
    color: #e8e8e8;
}

.meteo-legend-item--fact .meteo-legend-swatch {
    background: #e8e8e8;
}

.meteo-legend-item--forecast {
    color: #7f8a98;
}

.meteo-legend-item--forecast .meteo-legend-swatch {
    background: repeating-linear-gradient(
        90deg,
        #7f8a98 0 6px,
        transparent 6px 10px
    );
}

.meteo-charts {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.meteo-card {
    box-sizing: border-box;
    padding: 16px 14px 12px;
    border-radius: 14px;
    border: 1px solid var(--mx-settings-card-border, #2c2c2c);
    background: var(--mx-settings-card-bg, rgba(15, 15, 15, 0.96));
}

.meteo-card-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px 16px;
    margin-bottom: 10px;
}

.meteo-card-title {
    margin: 0;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #9aa3ad;
}

.meteo-card-value {
    font-size: 15px;
    font-weight: 600;
    color: #f0f2f5;
    font-variant-numeric: tabular-nums;
}

.meteo-card-value span {
    color: #6e7680;
    font-weight: 500;
    margin-left: 4px;
}

.meteo-chart-wrap {
    width: 100%;
    overflow: hidden;
    touch-action: none;
    cursor: crosshair;
    user-select: none;
    -webkit-user-select: none;
}

.meteo-chart-wrap svg {
    display: block;
    width: 100%;
    height: auto;
    pointer-events: none;
}

.meteo-card-value--scrub {
    color: #ffffff;
}

.meteo-card-value--scrub span {
    color: #9aa3ad;
}

.meteo-chart-scrub {
    stroke: #ffffff;
    stroke-width: 1.5;
    opacity: 0.95;
}

.meteo-chart-scrub-label {
    fill: #ffffff;
    font-size: 27px;
    font-weight: 700;
    font-family: ui-monospace, "Cousine", monospace;
    letter-spacing: 0.04em;
}

.meteo-chart-grid {
    stroke: rgba(255, 255, 255, 0.06);
    stroke-width: 1;
}

.meteo-chart-axis {
    fill: #6e7680;
    font-size: 10px;
    font-family: ui-monospace, "Cousine", monospace;
}

.meteo-chart-line-fact {
    fill: none;
    stroke-width: 2.25;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.meteo-chart-line-forecast {
    fill: none;
    stroke-width: 2.25;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 5 5;
    opacity: 0.72;
}

.meteo-chart-area-fact {
    opacity: 0.12;
}

.meteo-chart-now {
    stroke: #00ff9c;
    stroke-width: 1.25;
    stroke-dasharray: 3 4;
    opacity: 0.85;
}

.meteo-chart-now-label {
    fill: #00ff9c;
    font-size: 9px;
    font-family: ui-monospace, "Cousine", monospace;
    letter-spacing: 0.04em;
}

.meteo-series-temp .meteo-chart-line-fact,
.meteo-series-temp .meteo-chart-line-forecast {
    stroke: #ff9f43;
}

.meteo-series-temp .meteo-chart-area-fact {
    fill: #ff9f43;
}

.meteo-series-humidity .meteo-chart-line-fact,
.meteo-series-humidity .meteo-chart-line-forecast {
    stroke: #54a0ff;
}

.meteo-series-humidity .meteo-chart-area-fact {
    fill: #54a0ff;
}

.meteo-series-dust .meteo-chart-line-fact,
.meteo-series-dust .meteo-chart-line-forecast {
    stroke: #c4a574;
}

.meteo-series-dust .meteo-chart-area-fact {
    fill: #c4a574;
}

.meteo-series-pm10 .meteo-chart-line-fact,
.meteo-series-pm10 .meteo-chart-line-forecast {
    stroke: #a55eea;
}

.meteo-series-pm10 .meteo-chart-area-fact {
    fill: #a55eea;
}

.meteo-series-wind .meteo-chart-line-fact,
.meteo-series-wind .meteo-chart-line-forecast {
    stroke: #00d2d3;
}

.meteo-series-wind .meteo-chart-area-fact {
    fill: #00d2d3;
}

.meteo-card--track-map {
    margin-top: 18px;
}

.meteo-card--track-map-solo {
    margin-top: 0;
}

.meteo-track-map-stage {
    position: relative;
    width: 100%;
    border-radius: 10px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.25);
}

.meteo-track-wind {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 0;
    padding: 12px;
    pointer-events: none;
    background: radial-gradient(
        circle at center,
        rgba(0, 0, 0, 0.18) 0%,
        rgba(0, 0, 0, 0.05) 42%,
        transparent 68%
    );
}

.meteo-track-wind-compass {
    position: relative;
    width: clamp(110px, 28vw, 168px);
    height: clamp(110px, 28vw, 168px);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background:
        radial-gradient(circle at center, rgba(0, 210, 211, 0.16), transparent 70%),
        rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(2px);
}

.meteo-track-wind-n {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.72);
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.55);
}

.meteo-track-wind-arrow {
    width: 48%;
    height: auto;
    color: #00d2d3;
    transform-origin: 50% 50%;
    transition: transform 0.18s linear, color 0.2s ease;
    filter: drop-shadow(0 3px 10px rgba(0, 0, 0, 0.55));
}

.meteo-track-wind--scrub .meteo-track-wind-arrow {
    color: #ffffff;
    filter: drop-shadow(0 3px 12px rgba(0, 0, 0, 0.6));
    transition: transform 0.05s linear, color 0.15s ease;
}

.meteo-track-wind--empty .meteo-track-wind-arrow {
    color: #888;
    filter: none;
    opacity: 0.45;
}

.meteo-track-wind-meta {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 12px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(4px);
}

.meteo-track-wind-speed {
    font-size: clamp(1.35rem, 4.5vw, 1.9rem);
    font-weight: 700;
    color: #f0f2f5;
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
}

.meteo-track-wind-speed span {
    margin-left: 8px;
    font-size: 0.45em;
    font-weight: 600;
    color: #b8c0cc;
    vertical-align: middle;
}

.meteo-track-wind-dir {
    font-size: 12px;
    color: #c5ccd6;
    letter-spacing: 0.02em;
}

.meteo-track-wind--scrub .meteo-track-wind-speed {
    color: #ffffff;
}

.meteo-track-map-img {
    display: block;
    position: relative;
    z-index: 1;
    width: 100%;
    height: auto;
    max-height: min(70vh, 640px);
    object-fit: contain;
    border-radius: 10px;
    background: transparent;
}

.meteo-track-map-empty {
    position: relative;
    z-index: 1;
    padding: 28px 16px;
    text-align: center;
    font-size: 13px;
    line-height: 1.45;
    color: #7a828e;
    border-radius: 10px;
    border: 1px dashed rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.2);
    min-height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.meteo-wind-arrows {
    display: grid;
    grid-template-columns: repeat(24, minmax(0, 1fr));
    gap: 2px;
    margin-top: 10px;
    padding: 0 2px;
}

.meteo-wind-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 0;
}

.meteo-wind-arrow {
    width: 14px;
    height: 18px;
    color: #9aa3ad;
    transition: color 0.2s ease, opacity 0.2s ease;
}

.meteo-wind-arrow--fact {
    color: #e8e8e8;
}

.meteo-wind-arrow--forecast {
    color: #5c6570;
    opacity: 0.85;
}

.meteo-wind-arrow--muted {
    opacity: 0.25;
}

.meteo-wind-hour {
    font-size: 8px;
    color: #5c6570;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.meteo-wind-hint {
    margin: 10px 0 0;
    font-size: 11px;
    color: #5c6570;
    line-height: 1.4;
}

@media (max-width: 720px) {
    .settings-container.meteo-container .header-row h1 {
        font-size: clamp(0.95rem, 4.2vw, 1.15rem);
    }

    .meteo-hero {
        align-items: flex-start;
        flex-direction: column;
    }

    .meteo-meta {
        align-items: flex-start;
        text-align: left;
    }

    .meteo-card {
        padding: 14px 10px 10px;
        border-radius: 12px;
    }

    .meteo-wind-arrows {
        grid-template-columns: repeat(12, minmax(0, 1fr));
        row-gap: 10px;
    }

    .meteo-wind-cell--hide-sm {
        display: none;
    }

    .meteo-wind-arrow {
        width: 16px;
        height: 20px;
    }

    .meteo-wind-hour {
        font-size: 9px;
    }
}

html[data-theme="light"] .meteo-track-wind {
    background: radial-gradient(
        circle at center,
        rgba(255, 255, 255, 0.28) 0%,
        rgba(255, 255, 255, 0.08) 42%,
        transparent 68%
    );
}

html[data-theme="light"] .meteo-track-wind-compass {
    border-color: rgba(0, 0, 0, 0.14);
    background:
        radial-gradient(circle at center, rgba(0, 180, 180, 0.18), transparent 70%),
        rgba(255, 255, 255, 0.55);
}

html[data-theme="light"] .meteo-track-wind-n {
    color: #5a6472;
    text-shadow: none;
}

html[data-theme="light"] .meteo-track-wind-meta {
    background: rgba(255, 255, 255, 0.78);
}

html[data-theme="light"] .meteo-track-wind-speed {
    color: #1a1f28;
    text-shadow: none;
}

html[data-theme="light"] .meteo-track-wind-speed span,
html[data-theme="light"] .meteo-track-wind-dir {
    color: #5a6472;
}

html[data-theme="light"] .meteo-track-wind--scrub .meteo-track-wind-arrow {
    color: #1a1f28;
}

html[data-theme="light"] .meteo-track-wind--scrub .meteo-track-wind-speed {
    color: #1a1f28;
}

html[data-theme="light"] .meteo-track-name,
html[data-theme="light"] .meteo-track-btn {
    color: #1a1f28;
}

html[data-theme="light"] .meteo-track-btn {
    border-color: rgba(0, 0, 0, 0.14);
    background: rgba(255, 255, 255, 0.72);
}

html[data-theme="light"] .meteo-track-btn:hover,
html[data-theme="light"] .meteo-track-btn--open {
    border-color: rgba(0, 0, 0, 0.28);
    background: #fff;
}

html[data-theme="light"] .meteo-track-menu {
    background: #fff;
    border-color: rgba(0, 0, 0, 0.12);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.14);
}

html[data-theme="light"] .meteo-track-option {
    color: #1a1f28;
}

html[data-theme="light"] .meteo-track-option:hover {
    background: rgba(0, 0, 0, 0.05);
}

html[data-theme="light"] .meteo-track-option--active {
    background: rgba(0, 160, 100, 0.12);
    color: #0a7a4c;
}

html[data-theme="light"] .meteo-card-value,
html[data-theme="light"] .meteo-card-value--scrub {
    color: #1a1f28;
}

html[data-theme="light"] .meteo-card-value span,
html[data-theme="light"] .meteo-card-value--scrub span {
    color: #5a6472;
}

html[data-theme="light"] .meteo-chart-scrub {
    stroke: #1a1f28;
}

html[data-theme="light"] .meteo-chart-scrub-label {
    fill: #1a1f28;
}

html[data-theme="light"] .meteo-legend-item--fact {
    color: #1a1f28;
}

html[data-theme="light"] .meteo-legend-item--fact .meteo-legend-swatch {
    background: #1a1f28;
}

html[data-theme="light"] .meteo-chart-grid {
    stroke: rgba(0, 0, 0, 0.08);
}

html[data-theme="light"] .meteo-wind-arrow--fact {
    color: #1a1f28;
}

html[data-theme="light"] .meteo-status {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.08);
    color: #5a6472;
}
