/**
 * Weather Gauges - Pure CSS/SVG stílusok
 * Meteorológiai műszer-szerű megjelenítés
 */

/* === Gauge Container === */
.weather-gauges-section {
    margin-bottom: 2rem;
}

.gauges-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}

/* Desktop: 4 oszlop */
@media (min-width: 900px) {
    .gauges-container {
        grid-template-columns: repeat(4, 1fr);
        gap: 1.5rem;
    }
}

/* Tablet: 2x2 grid - alapértelmezett */
@media (min-width: 600px) and (max-width: 899px) {
    .gauges-container {
        gap: 1.25rem;
    }
}

/* Mobil: 2 oszlop kisebb gap-pel */
@media (max-width: 599px) {
    .gauges-container {
        gap: 0.75rem;
    }
}

/* === Egyedi Gauge === */
.gauge-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    background: var(--card, #ffffff);
    border-radius: var(--radius, 0.5rem);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.gauge-wrapper:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.gauge-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--muted-foreground, #4d5a7a);
    margin-bottom: 0.5rem;
    text-align: center;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.gauge-title svg,
.gauge-title i {
    width: 1rem;
    height: 1rem;
    color: var(--primary, #2962ff);
}

/* === SVG Gauge === */
.gauge-svg-container {
    position: relative;
    width: 100%;
    max-width: 160px;
    aspect-ratio: 1;
}

.gauge-svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

/* Gauge háttér ív */
.gauge-bg {
    fill: none;
    stroke: var(--muted, #d1e0fa);
    stroke-width: 12;
    stroke-linecap: round;
}

/* Gauge érték ív */
.gauge-value-arc {
    fill: none;
    stroke-width: 12;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s ease-out, stroke 0.5s ease;
}

/* Gauge mutató (tű) */
.gauge-needle {
    fill: var(--foreground, #2a3042);
    transition: transform 1s ease-out;
    transform-origin: center;
}

/* Gauge középső kör */
.gauge-center {
    fill: var(--card, #ffffff);
    stroke: var(--border, #c7d6f0);
    stroke-width: 2;
}

/* === Gauge színzónák === */
.gauge-zone {
    fill: none;
    stroke-width: 14;
    stroke-linecap: butt;
    opacity: 0.3;
}

/* Hőmérséklet zónák */
.zone-cold { stroke: #3b82f6; }      /* Kék - hideg */
.zone-cool { stroke: #06b6d4; }      /* Cián - hűvös */
.zone-comfortable { stroke: #22c55e; } /* Zöld - kellemes */
.zone-warm { stroke: #eab308; }      /* Sárga - meleg */
.zone-hot { stroke: #ef4444; }       /* Piros - forró */

/* Páratartalom zónák */
.zone-dry { stroke: #f59e0b; }       /* Narancssárga - száraz */
.zone-optimal { stroke: #22c55e; }   /* Zöld - optimális */
.zone-humid { stroke: #3b82f6; }     /* Kék - párás */

/* Szélsebesség zónák */
.zone-calm { stroke: #22c55e; }      /* Zöld - szélcsend */
.zone-light { stroke: #84cc16; }     /* Világoszöld - gyenge */
.zone-moderate { stroke: #eab308; }  /* Sárga - mérsékelt */
.zone-strong { stroke: #f97316; }    /* Narancssárga - erős */
.zone-gale { stroke: #ef4444; }      /* Piros - viharos */

/* === Gauge értékek megjelenítése === */
.gauge-value-display {
    position: absolute;
    bottom: 20%;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
}

.gauge-current-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--foreground, #2a3042);
    line-height: 1;
}

.gauge-unit {
    font-size: 0.75rem;
    color: var(--muted-foreground, #4d5a7a);
    margin-top: 0.2rem;
}

/* Reszponzív méretezés */
@media (max-width: 599px) {
    .gauge-current-value {
        font-size: 1.2rem;
    }
    
    .gauge-unit {
        font-size: 0.65rem;
    }
    
    .gauge-title {
        font-size: 0.75rem;
    }
    
    .gauge-wrapper {
        padding: 0.75rem;
    }
}

/* === Skála jelölések === */
.gauge-tick {
    stroke: var(--muted-foreground, #4d5a7a);
    stroke-width: 2;
}

.gauge-tick-label {
    font-size: 0.6rem;
    fill: var(--muted-foreground, #4d5a7a);
    text-anchor: middle;
}

/* === Kompasz (szélirány) === */
.compass-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    background: var(--card, #ffffff);
    border-radius: var(--radius, 0.5rem);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.compass-wrapper:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.compass-svg-container {
    position: relative;
    width: 100%;
    max-width: 160px;
    aspect-ratio: 1;
}

.compass-svg {
    width: 100%;
    height: 100%;
}

.compass-ring {
    fill: none;
    stroke: var(--muted, #d1e0fa);
    stroke-width: 3;
}

.compass-cardinal {
    font-size: 0.75rem;
    font-weight: 700;
    fill: var(--foreground, #2a3042);
    text-anchor: middle;
    dominant-baseline: middle;
}

.compass-cardinal-n {
    fill: var(--primary, #2962ff);
}

.compass-tick {
    stroke: var(--muted-foreground, #4d5a7a);
    stroke-width: 1;
}

.compass-needle {
    transition: transform 1s ease-out;
    transform-origin: center;
}

.compass-needle-north {
    fill: #ef4444;
}

.compass-needle-south {
    fill: var(--muted-foreground, #4d5a7a);
}

.compass-center {
    fill: var(--card, #ffffff);
    stroke: var(--border, #c7d6f0);
    stroke-width: 2;
}

.compass-value-display {
    position: absolute;
    bottom: 10%;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    background: var(--card, #ffffff);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius, 0.5rem);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.compass-direction {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary, #2962ff);
}

.compass-degrees {
    font-size: 0.7rem;
    color: var(--muted-foreground, #4d5a7a);
}

/* === Frissítés időbélyeg === */
.gauges-timestamp {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border, #c7d6f0);
    font-size: 0.8rem;
    color: var(--muted-foreground, #4d5a7a);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.gauges-timestamp svg,
.gauges-timestamp i {
    width: 0.9rem;
    height: 0.9rem;
    margin-right: 0.3rem;
}

.gauges-source {
    font-size: 0.75rem;
}

.gauges-source a {
    color: var(--primary, #2962ff);
}

/* === Animációk === */
@keyframes gauge-appear {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.gauge-wrapper,
.compass-wrapper {
    animation: gauge-appear 0.5s ease-out;
}

.gauge-wrapper:nth-child(1) { animation-delay: 0s; }
.gauge-wrapper:nth-child(2) { animation-delay: 0.1s; }
.gauge-wrapper:nth-child(3) { animation-delay: 0.2s; }
.compass-wrapper:nth-child(4) { animation-delay: 0.3s; }

/* === Főoldali kompakt változat === */
.weather-gauges-compact .gauges-container {
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}

.weather-gauges-compact .gauge-wrapper,
.weather-gauges-compact .compass-wrapper {
    padding: 0.75rem;
}

.weather-gauges-compact .gauge-svg-container,
.weather-gauges-compact .compass-svg-container {
    max-width: 100px;
}

.weather-gauges-compact .gauge-current-value {
    font-size: 1rem;
}

.weather-gauges-compact .gauge-unit {
    font-size: 0.6rem;
}

.weather-gauges-compact .gauge-title {
    font-size: 0.7rem;
}

@media (max-width: 768px) {
    .weather-gauges-compact .gauges-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .weather-gauges-compact .gauges-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    
    .weather-gauges-compact .gauge-svg-container,
    .weather-gauges-compact .compass-svg-container {
        max-width: 80px;
    }
}

/* === Betöltési állapot === */
.gauge-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 160px;
    color: var(--muted-foreground, #4d5a7a);
}

.gauge-loading::after {
    content: '';
    width: 24px;
    height: 24px;
    border: 3px solid var(--muted, #d1e0fa);
    border-top-color: var(--primary, #2962ff);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* === Hiba állapot === */
.gauge-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 160px;
    color: var(--destructive, #ff4d4f);
    text-align: center;
    padding: 1rem;
}

.gauge-error svg {
    width: 2rem;
    height: 2rem;
    margin-bottom: 0.5rem;
}

