/**
 * Weather Complete Styles v4.6 - OPRAVENÉ
 * Kompletné štýly pre všetky formáty výstupov s pekným modrým gradientom pre hlavičku
 */

/* ==========================================================================
   ZÁKLADNÉ KONTAJNERY - OPTIMALIZOVANÉ
   ========================================================================== */

.weather-container {
    margin: 20px 0;
    contain: layout style; /* Core Web Vitals optimalizácia */
}

.weather-debug {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    padding: 15px;
    border-radius: 5px;
    font-family: monospace;
    font-size: 13px;
    margin: 15px 0;
}

/* NOVÉ: Nedostupné údaje styling */
.weather-unavailable {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    padding: 15px;
    border-radius: 5px;
    text-align: center;
    margin: 15px 0;
}

.weather-unavailable h4 {
    margin: 0 0 10px 0;
    font-size: 16px;
}

.weather-unavailable p {
    margin: 0;
    font-size: 14px;
}

/* ==========================================================================
   LOADING STATES - CLS PREVENTION
   ========================================================================== */

.weather-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    color: #6c757d;
    font-size: 14px;
    text-align: center;
    /* Stable dimensions prevent CLS */
}

.weather-loading-mini {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 3px;
    font-size: 14px;
    min-width: 80px; /* Prevent CLS */
    vertical-align: middle; /* NOVÉ: zarovnanie s okolitým textom */
    line-height: 1; /* NOVÉ: konzistentná výška */
}

/* ==========================================================================
   MINI FORMAT WIDGET - OPRAVENÉ (JEDNODUCHÉ)
   ========================================================================== */

/* OPRAVENÉ: Jednoduché mini widget bez podfarbenia a orámovanie - VEDĽA SEBA s vertikálnym zarovnaním */
.weather-mini-widget-simple {
    display: inline-flex;
    flex-direction: row; /* EXPLICITNE: vedľa seba */
    align-items: center; /* Vertikálne vycentruje obsah */
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap; /* Zabráni zlomeniu na nový riadok */
    vertical-align: middle; /* Pre inline zobrazenie s okolitým textom */
    line-height: 1; /* Odstráni extra výšku riadku */
    /* ODSTRÁNENÉ: padding, border-radius, background, border, transition */
}

.weather-mini-icon {
    font-size: 18px;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    flex-shrink: 0; /* NOVÉ: zabráni zmršťovaniu ikony */
}

.weather-mini-temp {
    font-weight: 600;
    letter-spacing: -0.5px;
    line-height: 1; /* NOVÉ: konzistentná výška */
    align-self: center; /* NOVÉ: zabezpečí vertikálne vycentrovanie */
}

/* NOVÉ: Mini widget unavailable state */
.weather-unavailable-mini {
    color: #856404;
    font-style: italic;
}

/* ==========================================================================
   STARÝ MINI WIDGET (pre kompatibilitu) - ZACHOVANÉ
   ========================================================================== */

/* Zachované pre prípad ak sa niekde ešte používa starý formát */
.weather-mini-widget {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.weather-mini-widget:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* MINI WIDGET - Weather condition colors (zachované pre starý formát) */
.weather-hot {
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    color: white;
    border-color: #ff6b35;
}

.weather-warm {
    background: linear-gradient(135deg, #ffa726, #ffcc02);
    color: white;
    border-color: #ffa726;
}

.weather-mild {
    background: linear-gradient(135deg, #66bb6a, #4caf50);
    color: white;
    border-color: #66bb6a;
}

.weather-cool {
    background: linear-gradient(135deg, #42a5f5, #2196f3);
    color: white;
    border-color: #42a5f5;
}

.weather-cold {
    background: linear-gradient(135deg, #5c6bc0, #3f51b5);
    color: white;
    border-color: #5c6bc0;
}

.weather-freezing {
    background: linear-gradient(135deg, #7986cb, #3f51b5);
    color: white;
    border-color: #7986cb;
}

.weather-rainy {
    background: linear-gradient(135deg, #1e88e5, #1565c0);
    color: white;
    border-color: #1e88e5;
}

.weather-snowy {
    background: linear-gradient(135deg, #90a4ae, #607d8b);
    color: white;
    border-color: #90a4ae;
}

.weather-stormy {
    background: linear-gradient(135deg, #424242, #212121);
    color: white;
    border-color: #424242;
}

.weather-windy {
    background: linear-gradient(135deg, #78909c, #546e7a);
    color: white;
    border-color: #78909c;
}

.weather-foggy {
    background: linear-gradient(135deg, #9e9e9e, #757575);
    color: white;
    border-color: #9e9e9e;
}

/* ==========================================================================
   TABLE FORMAT - OPRAVENÉ s pekným modrým gradientom
   ========================================================================== */

.weather-table {
    width: 100%;
    border-collapse: collapse;
    font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-size: 14px;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
    margin: 20px 0;
}

.weather-table th,
.weather-table td {
    padding: 12px 16px;
    border: 1px solid #e9ecef;
    text-align: left;
}

/* OPRAVENÉ: Pekný modrý gradient pre hlavičku */
.weather-table th {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 13px;
}

/* NOVÉ: Subheader pre hlavičku s parametrami */
.weather-subheader th {
    background: rgba(30, 60, 114, 0.8) !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    font-size: 14px !important;
    font-weight: 500 !important;
}

.weather-table tbody tr:nth-child(even) {
    background: #f8f9fa;
}

.weather-table tbody tr:hover {
    background: #e3f2fd;
    transition: background-color 0.2s ease;
}

/* Section headers */
.weather-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%) !important;
    font-weight: bold !important;
    color: #495057 !important;
    font-size: 15px !important;
}

.weather-section td {
    padding: 14px 16px !important;
    border-left: 4px solid #1e3c72 !important; /* OPRAVENÉ: modrá farba namiesto #007bb5 */
}

/* Value cells */
.weather-table td:last-child {
    text-align: center;
    font-weight: 600;
    color: #2c3e50;
    min-width: 120px;
}

/* ==========================================================================
   RESPONSIVE DESIGN - OPTIMALIZOVANÉ
   ========================================================================== */

@media (max-width: 768px) {
    .weather-table {
        font-size: 13px;
        margin: 15px -15px; /* Full width on mobile */
        border-radius: 0;
    }
    
    .weather-table th,
    .weather-table td {
        padding: 10px 12px;
    }
    
    .weather-mini-widget-simple {
        font-size: 13px;
        gap: 4px;
    }
    
    .weather-mini-widget {
        font-size: 13px;
        gap: 4px;
        padding: 3px 6px;
    }
    
    .weather-mini-icon {
        font-size: 16px;
        width: 16px;
        height: 16px;
    }
    
    .weather-container {
        margin: 15px 0;
    }
}

@media (max-width: 480px) {
    .weather-table {
        font-size: 12px;
    }
    
    .weather-table th,
    .weather-table td {
        padding: 8px 10px;
    }
    
    .weather-section td {
        padding: 10px 10px !important;
    }
    
    .weather-mini-widget-simple {
        font-size: 12px;
        gap: 3px;
    }
    
    .weather-mini-widget {
        font-size: 12px;
        gap: 3px;
        padding: 2px 5px;
    }
    
    .weather-mini-icon {
        font-size: 14px;
        width: 14px;
        height: 14px;
    }
}

/* ==========================================================================
   ACCESSIBILITY - OPTIMALIZOVANÉ
   ========================================================================== */

.weather-table {
    /* High contrast mode support */
}

@media (prefers-contrast: high) {
    .weather-table {
        border: 2px solid #000;
    }
    
    .weather-table th {
        background: #000;
        color: #fff;
    }
    
    .weather-table td {
        border-color: #000;
    }
    
    .weather-mini-widget-simple {
        color: #000;
    }
    
    .weather-mini-widget {
        border: 2px solid #000;
        background: #fff;
        color: #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .weather-mini-widget {
        transition: none;
    }
    
    .weather-mini-widget:hover {
        transform: none;
    }
    
    .weather-table tbody tr {
        transition: none;
    }
}

/* ==========================================================================
   PRINT STYLES - OPTIMALIZOVANÉ
   ========================================================================== */

@media print {
    .weather-container {
        margin: 10px 0;
        break-inside: avoid;
    }
    
    .weather-table {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .weather-table th {
        background: #f0f0f0 !important;
        color: #000 !important;
        -webkit-print-color-adjust: exact;
        color-adjust: exact;
    }
    
    .weather-mini-widget-simple {
        color: #000 !important;
    }
    
    .weather-mini-widget {
        background: #f0f0f0 !important;
        color: #000 !important;
        border: 1px solid #000;
        -webkit-print-color-adjust: exact;
        color-adjust: exact;
    }
    
    .weather-loading {
        display: none;
    }
}

/* ==========================================================================
   ANIMATION UTILITIES - OPTIMALIZOVANÉ
   ========================================================================== */

.weather-fade-in {
    animation: weatherFadeIn 0.3s ease-in-out;
}

@keyframes weatherFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.weather-pulse {
    animation: weatherPulse 1.5s ease-in-out infinite;
}

@keyframes weatherPulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

/* ==========================================================================
   UTILITY CLASSES - OPTIMALIZOVANÉ
   ========================================================================== */

.weather-text-center {
    text-align: center;
}

.weather-text-right {
    text-align: right;
}

.weather-font-bold {
    font-weight: 600;
}

.weather-font-normal {
    font-weight: normal;
}

.weather-margin-small {
    margin: 10px 0;
}

.weather-margin-large {
    margin: 30px 0;
}

.weather-padding-small {
    padding: 8px;
}

.weather-padding-large {
    padding: 20px;
}

/* ==========================================================================
   LEGACY BROWSER SUPPORT - OPTIMALIZOVANÉ
   ========================================================================== */

/* Fallback for browsers without CSS Grid */
.no-cssgrid .weather-table {
    display: table;
    width: 100%;
}

/* Fallback for browsers without Flexbox */
.no-flexbox .weather-mini-widget-simple,
.no-flexbox .weather-mini-widget {
    display: inline-block;
    vertical-align: middle;
}

.no-flexbox .weather-mini-icon {
    display: inline-block;
    vertical-align: middle;
    margin-right: 6px;
}

/* IE11 specific fixes */
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
    .weather-mini-widget-simple,
    .weather-mini-widget {
        display: inline-block;
    }
    
    .weather-table {
        border-collapse: separate;
        border-spacing: 0;
    }
}

/* ==========================================================================
   CUSTOM PROPERTIES (CSS VARIABLES) - OPRAVENÉ s modrými tónmi
   ========================================================================== */

:root {
    --weather-primary-color: #1e3c72;
    --weather-secondary-color: #2a5298;
    --weather-success-color: #28a745;
    --weather-warning-color: #ffc107;
    --weather-danger-color: #dc3545;
    --weather-info-color: #17a2b8;
    
    --weather-font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
    --weather-font-size-small: 12px;
    --weather-font-size-normal: 14px;
    --weather-font-size-large: 16px;
    
    --weather-spacing-small: 8px;
    --weather-spacing-normal: 16px;
    --weather-spacing-large: 24px;
    
    --weather-border-radius: 4px;
    --weather-border-width: 1px;
    --weather-box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    
    --weather-transition: all 0.2s ease;
}

/**
 * ROZŠÍRENÉ: Farebné podfarbenie pre kvalitu ovzdušia + UV index s WCAG AA kontrastom
 * Pridať do weather-styles.css na koniec
 */

/* ==========================================================================
   AIR QUALITY + UV INDEX COLOR CODING - WCAG AA COMPLIANT
   ========================================================================== */

/* Výborná kvalita / Nízky UV (0-2) - Zelená */
.aq-excellent {
    background-color: #28a745 !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) !important;
}

/* Dobrá kvalita / Stredný UV (3-5) - Žltá */
.aq-good {
    background-color: #ffc107 !important;
    color: #212529 !important; /* Tmavý text pre lepší kontrast na žltej */
    font-weight: 600 !important;
    text-shadow: none !important;
}

/* Stredná kvalita / Vysoký UV (6-7) - Oranžová */
.aq-moderate {
    background-color: #fd7e14 !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) !important;
}

/* Nezdravá kvalita / Veľmi vysoký UV (8-10) - Červená */
.aq-unhealthy {
    background-color: #dc3545 !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
}

/* Veľmi nezdravá kvalita - Tmavo červená */
.aq-very-unhealthy {
    background-color: #bd2130 !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
}

/* Nebezpečná kvalita / Extrémny UV (11+) - Fialová */
.aq-hazardous {
    background-color: #6f42c1 !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
}

/* ==========================================================================
   AIR QUALITY + UV INDEX HOVER EFFECTS
   ========================================================================== */

.weather-table .aq-excellent:hover,
.weather-table .aq-good:hover,
.weather-table .aq-moderate:hover,
.weather-table .aq-unhealthy:hover,
.weather-table .aq-very-unhealthy:hover,
.weather-table .aq-hazardous:hover {
    transform: scale(1.02);
    transition: transform 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* ==========================================================================
   HIGH CONTRAST MODE SUPPORT
   ========================================================================== */

@media (prefers-contrast: high) {
    .aq-excellent,
    .aq-good,
    .aq-moderate,
    .aq-unhealthy,
    .aq-very-unhealthy,
    .aq-hazardous {
        border: 2px solid #000000 !important;
        font-weight: 700 !important;
    }
    
    .aq-good {
        background-color: #ffdd00 !important;
        color: #000000 !important;
    }
}

/* ==========================================================================
   PRINT STYLES FOR AIR QUALITY + UV INDEX
   ========================================================================== */

@media print {
    .aq-excellent {
        background-color: #d4edda !important;
        color: #155724 !important;
        -webkit-print-color-adjust: exact;
        color-adjust: exact;
    }
    
    .aq-good {
        background-color: #fff3cd !important;
        color: #856404 !important;
        -webkit-print-color-adjust: exact;
        color-adjust: exact;
    }
    
    .aq-moderate {
        background-color: #ffe8d4 !important;
        color: #8b4513 !important;
        -webkit-print-color-adjust: exact;
        color-adjust: exact;
    }
    
    .aq-unhealthy,
    .aq-very-unhealthy {
        background-color: #f8d7da !important;
        color: #721c24 !important;
        -webkit-print-color-adjust: exact;
        color-adjust: exact;
    }
    
    .aq-hazardous {
        background-color: #e2d9f3 !important;
        color: #4c2a85 !important;
        -webkit-print-color-adjust: exact;
        color-adjust: exact;
    }
}

/* ==========================================================================
   MOBILE RESPONSIVE FOR AIR QUALITY + UV INDEX
   ========================================================================== */

@media (max-width: 768px) {
    .aq-excellent,
    .aq-good,
    .aq-moderate,  
    .aq-unhealthy,
    .aq-very-unhealthy,
    .aq-hazardous {
        font-size: 12px !important;
        padding: 6px 8px !important;
    }
}

@media (max-width: 480px) {
    .aq-excellent,
    .aq-good,
    .aq-moderate,
    .aq-unhealthy,
    .aq-very-unhealthy,
    .aq-hazardous {
        font-size: 11px !important;
        padding: 5px 6px !important;
    }
}

/* ==========================================================================
   ACCESSIBILITY IMPROVEMENTS FOR UV INDEX
   ========================================================================== */

/* Focus styles pre keyboard navigation */
.weather-table td.aq-excellent:focus,
.weather-table td.aq-good:focus,
.weather-table td.aq-moderate:focus,
.weather-table td.aq-unhealthy:focus,
.weather-table td.aq-very-unhealthy:focus,
.weather-table td.aq-hazardous:focus {
    outline: 3px solid #005fcc;
    outline-offset: 2px;
}

/* Screen reader support s UV info */
.aq-excellent::after { content: " (Výborná kvalita / Nízky UV)"; speak: literal; }
.aq-good::after { content: " (Dobrá kvalita / Stredný UV)"; speak: literal; }
.aq-moderate::after { content: " (Stredná kvalita / Vysoký UV)"; speak: literal; }
.aq-unhealthy::after { content: " (Nezdravá kvalita / Veľmi vysoký UV)"; speak: literal; }
.aq-very-unhealthy::after { content: " (Veľmi nezdravá kvalita)"; speak: literal; }
.aq-hazardous::after { content: " (Nebezpečná kvalita / Extrémny UV)"; speak: literal; }

/* Skryť dodatočný text pre vizuálnych používateľov */
.aq-excellent::after,
.aq-good::after,
.aq-moderate::after,
.aq-unhealthy::after,
.aq-very-unhealthy::after,
.aq-hazardous::after {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* ==========================================================================
   UV INDEX SPECIFIC TOOLTIPS (Optional Enhancement)
   ========================================================================== */

/* Tooltip pre UV index na hover */
/*.weather-table td[class*="aq-"]:hover::before {
    content: attr(data-uv-info);
    position: absolute;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
    z-index: 1000;
    margin-top: -30px;
    margin-left: 10px;
    pointer-events: none;
}*/

/* ==========================================================================
   ANIMATION SUPPORT
   ========================================================================== */

/* Jemná animácia pre farebné bunky */
.aq-excellent,
.aq-good,
.aq-moderate,
.aq-unhealthy,
.aq-very-unhealthy,
.aq-hazardous {
    transition: all 0.3s ease !important;
}

/* Zakázať animácie pre používateľov s preferenciou */
@media (prefers-reduced-motion: reduce) {
    .aq-excellent,
    .aq-good,
    .aq-moderate,
    .aq-unhealthy,
    .aq-very-unhealthy,
    .aq-hazardous {
        transition: none !important;
    }
    
    .weather-table .aq-excellent:hover,
    .weather-table .aq-good:hover,
    .weather-table .aq-moderate:hover,
    .weather-table .aq-unhealthy:hover,
    .weather-table .aq-very-unhealthy:hover,
    .weather-table .aq-hazardous:hover {
        transform: none !important;
    }
}

/* ==========================================================================
   LEGEND FOR COLORS (Optional)
   ========================================================================== */

.weather-color-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
    font-size: 11px;
}

.weather-color-legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.weather-color-legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}