:root {
    --primary-color: #1a6ca2;
    --secondary-color: #2c3e50;
    --accent-color: #e74c3c;
    --light-bg: #121212;
    --dark-bg: #1e1e1e;
    --text-color: #e0e0e0;
    --light-text: #f8f9fa;
    --card-bg: #1e1e1e;
    --border-color: #333;
    --chart-temp: #ff6b6b;
    --chart-hum: #4ecdc4;
    --chart-max-temp: #ff9e7d;
    --chart-min-temp: #74b9ff;
    --chart-avg-hum: #55efc4;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-color);
    line-height: 1.6;
    background-color: var(--light-bg);
    padding-bottom: 2rem;
}

.container {
    width: 95%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

header {
    background-color: var(--primary-color);
    color: white;
    text-align: center;
    padding: 1.5rem 0;
    margin-bottom: 2rem;
}

h1 {
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
}

h2 {
    color: var(--text-color);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
    margin: 2rem 0 1rem;
}

h3 {
    color: var(--primary-color);
    margin: 1.5rem 0 0.5rem;
}

h4 {
    color: var(--text-color);
    margin: 1rem 0;
}

.section {
    background-color: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
}

.section-title {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.section-title i {
    margin-right: 0.5rem;
    color: var(--accent-color);
}

.source-link {
    font-size: 0.8rem;
    color: #aaa;
    text-decoration: none;
    display: block;
    margin-bottom: 0.8rem;
}

.source-link:hover {
    color: var(--accent-color);
}

.map-container {
    height: 450px;
    width: 100%;
    margin: 1rem 0;
}

#map {
    height: 100%;
    width: 100%;
    border-radius: 8px;
    background-color: var(--dark-bg);
}

.embed-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    max-width: 100%;
    border-radius: 8px;
    margin: 1rem 0;
    background-color: var(--dark-bg);
    border: 1px solid var(--border-color);
}

.embed-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 8px;
}

audio {
    width: 100%;
    margin: 1rem 0;
    filter: invert(0.9) hue-rotate(180deg);
}

.live-data {
    margin: 1rem 0;
    font-size: 1rem;
    font-weight: bold;
    color: var(--text-color);
}

footer {
    background-color: var(--secondary-color);
    color: white;
    text-align: center;
    padding: 1.5rem 0;
    margin-top: 2rem;
}

footer a {
    color: white;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

.back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: var(--accent-color);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    opacity: 0.7;
    transition: opacity 0.3s;
    z-index: 1000;
}

.back-to-top:hover {
    opacity: 1;
}

/* Estilos para la sección de clima */
.current-weather-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
}

.current-readings {
    flex: 1;
    min-width: 300px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.current-chart {
    flex: 2;
    min-width: 300px;
}

.reading-card {
    background: var(--dark-bg);
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    text-align: center;
    border: 1px solid var(--border-color);
}

.reading-value {
    font-size: 2.5rem;
    font-weight: bold;
    margin: 10px 0;
    color: var(--text-color);
}

.reading-trend {
    font-size: 0.9rem;
    padding: 3px 8px;
    border-radius: 12px;
    display: inline-block;
}

.chart-container {
    background: var(--dark-bg);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    border: 1px solid var(--border-color);
}

.up-trend {
    color: var(--chart-temp);
    background-color: rgba(255, 107, 107, 0.1);
}

.down-trend {
    color: var(--chart-hum);
    background-color: rgba(78, 205, 196, 0.1);
}

.stable-trend {
    color: var(--chart-min-temp);
    background-color: rgba(116, 185, 255, 0.1);
}

/* Estilos para las pestañas */
.weather-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 1rem;
}

.tab-link {
    padding: 10px 15px;
    background-color: var(--dark-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 5px 5px 0 0;
    cursor: pointer;
    transition: all 0.3s;
}

.tab-link:hover {
    background-color: var(--secondary-color);
}

.tab-link.active {
    background-color: var(--primary-color);
    color: white;
    border-bottom: 2px solid var(--accent-color);
}

.tab-content {
    display: none;
    animation: fadeIn 0.5s;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Estilos para los gráficos */
.chartjs-render-monitor {
    filter: brightness(0.8) contrast(1.2);
}

/* Modo oscuro/claro manual */
body.force-dark {
    --light-bg: #121212;
    --dark-bg: #1e1e1e;
    --text-color: #e0e0e0;
    --card-bg: #1e1e1e;
    --border-color: #333;
}

body.force-light {
    --light-bg: #f8f9fa;
    --dark-bg: #343a40;
    --text-color: #333;
    --card-bg: white;
    --border-color: #ddd;
}

#darkModeToggle {
    position: fixed;
    bottom: 70px;
    right: 20px;
    z-index: 1000;
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Preload animation */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s linear infinite;
}

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

/* Media Queries for Responsive Design */
@media (max-width: 768px) {
    h1 {
        font-size: 1.5rem;
    }
    
    .section {
        padding: 1rem;
    }
    
    .map-container {
        height: 350px;
    }
    
    .current-weather-container {
        flex-direction: column;
    }
    
    .current-readings {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .container {
        width: 100%;
        padding: 0 10px;
    }
    
    h1 {
        font-size: 1.2rem;
    }
    
    h3 {
        font-size: 1rem;
    }
    
    .section {
        padding: 0.8rem;
    }
    
    .map-container {
        height: 300px;
    }
    
    .current-readings {
        grid-template-columns: 1fr;
    }
    
    .weather-tabs {
        flex-direction: column;
    }
    
    .tab-link {
        border-radius: 5px;
    }
}   
        
        
        @keyframes spin {
            to {
                transform: rotate(360deg);
            }
        }
