/* Clima Page Styles - Premium & Dynamic */

:root {
    /* Municipality Colors (from Numeralia) */
    --color-santiago: #0284c7;
    --color-tulancingo: #059669;
    --color-cuautepec: #2563eb;
    --color-singuilucan: #92400e;
    --color-acatlan: #8b5cf6;
    --color-acaxochitlan: #991b1b;
    --color-default: #6b7280;

    /* Active Theme Variable */
    --theme-color: var(--color-santiago);
    --theme-color-soft: rgba(2, 132, 199, 0.1);
    --theme-gradient: linear-gradient(135deg, var(--theme-color), #1e293b);

    /* General Styling */
    --card-bg: rgba(255, 255, 255, 0.95);
    --glass-bg: rgba(255, 255, 255, 0.8);
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-radius: 20px;
    --shadow-premium: 0 10px 30px -5px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

body.page-clima {
    background-color: #f8fafc;
    color: var(--text-main);
    font-family: 'Inter', -apple-system, sans-serif;
    line-height: 1.6;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Tweaks */
.main-header {
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
    border-bottom: 3px solid var(--theme-color);
    transition: border-color 0.5s ease;
}

.location-status {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Controls */
.clima-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    background: var(--glass-bg);
    padding: 15px 25px;
    border-radius: 50px;
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-premium);
}

.location-selector label {
    font-weight: 700;
    margin-right: 12px;
    color: var(--text-main);
}

.location-selector select {
    padding: 10px 20px;
    border-radius: 25px;
    border: 2px solid #e2e8f0;
    background: white;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    transition: all 0.3s ease;
}

.location-selector select:focus {
    border-color: var(--theme-color);
}

.unit-toggle {
    display: flex;
    background: #e2e8f0;
    padding: 4px;
    border-radius: 30px;
}

.unit-toggle button {
    padding: 8px 20px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-weight: 700;
    border-radius: 25px;
    transition: all 0.3s ease;
    color: var(--text-muted);
}

.unit-toggle button.active {
    background: white;
    color: var(--theme-color);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

/* Weather Hero */
.weather-hero {
    background: var(--theme-gradient);
    border-radius: var(--border-radius);
    padding: 60px 40px;
    color: white;
    margin-bottom: 40px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-premium);
    transition: all 0.5s ease;
}

.weather-hero::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: radial-gradient(circle at top right, rgba(255, 255, 255, 0.1), transparent);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
}

.weather-hero h1 {
    font-size: 3rem;
    margin-bottom: 10px;
    letter-spacing: -0.025em;
}

.temp-display {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin: 20px 0;
}

.temperature {
    font-size: 6rem;
    font-weight: 800;
    line-height: 1;
}

.weather-icon-large {
    width: 120px;
    height: 120px;
    filter: drop-shadow(0 10px 15px rgba(0, 0, 0, 0.2));
}

.condition-text {
    font-size: 1.5rem;
    font-weight: 500;
    text-transform: capitalize;
    margin-bottom: 40px;
    opacity: 0.9;
}

.hero-details {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.hero-detail-card {
    background: rgba(255, 255, 255, 0.15);
    padding: 20px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

.hero-detail-card .label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.8;
    margin-bottom: 5px;
}

.hero-detail-card .value {
    font-size: 1.5rem;
    font-weight: 700;
}

/* Map Section */
.map-section {
    margin-bottom: 40px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.section-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
}

.source-tag {
    background: #e2e8f0;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
}

.map-container-premium {
    height: 500px;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-premium);
    border: 1px solid #e2e8f0;
}

.map-container-premium iframe {
    width: 100% !important;
    height: 100% !important;
}

/* Forecast Grid */
.forecast-section {
    margin-bottom: 40px;
}

.forecast-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 15px;
}

.forecast-card {
    background: white;
    padding: 25px 15px;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
    border-bottom: 4px solid transparent;
}

.forecast-card:hover {
    transform: translateY(-5px);
    border-bottom-color: var(--theme-color);
}

.forecast-day {
    font-weight: 700;
    color: var(--text-muted);
    font-size: 0.9rem;
    text-transform: uppercase;
}

.forecast-icon {
    width: 60px;
    height: 60px;
    margin: 10px auto;
}

.forecast-temps {
    font-weight: 800;
    font-size: 1.1rem;
}

.max-temp {
    color: var(--theme-color);
}

.min-temp {
    color: #94a3b8;
}

/* Charts */
.charts-section {
    margin-bottom: 40px;
}

.chart-wrapper {
    height: 350px;
    padding: 30px;
}

/* Details Grid */
.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 60px;
}

.card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-premium);
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.card-icon {
    font-size: 2.5rem;
    background: var(--theme-color-soft);
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
    color: var(--theme-color);
    transition: all 0.3s ease;
}

.card-info h3 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 5px;
}

.detail-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-main);
}

/* Solar Card Specifics */
.sun-times {
    display: flex;
    gap: 20px;
}

.sun-item {
    font-weight: 700;
    font-size: 1.1rem;
}

/* Global Footer Adjustments */
.main-footer {
    background: #1e293b;
    color: #f8fafc;
    padding: 80px 0 40px;
}

.footer-link {
    color: #94a3b8;
    text-decoration: none;
    display: block;
    margin-bottom: 10px;
    transition: color 0.3s;
}

.footer-link:hover {
    color: white;
}

/* Historical Section */
.historical-section {
    margin-bottom: 60px;
}

.historical-section .section-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 20px;
}

.historical-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    align-items: flex-end;
    width: 100%;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.control-group label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
}

.control-group input,
.control-group select {
    padding: 10px 15px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: white;
    font-family: inherit;
    font-size: 0.9rem;
}

.btn-primary {
    background: var(--theme-color);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.btn-secondary {
    background: #f1f5f9;
    color: var(--text-main);
    border: 1px solid #e2e8f0;
    padding: 12px 20px;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.btn-primary:hover,
.btn-secondary:hover {
    filter: brightness(0.95);
    transform: translateY(-2px);
}

.actions-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.historical-chart-card {
    height: 400px;
    margin-top: 20px;
    padding: 20px;
}

.historical-source {
    margin-top: 15px;
    text-align: right;
    font-size: 0.75rem;
    color: #94a3b8;
    line-height: 1.4;
    font-style: italic;
}

.chart-actions-bottom {
    display: flex;
    justify-content: center;
    margin-top: 15px;
}

.chart-actions-bottom button {
    max-width: 300px;
}

/* Responsive Support */
@media (max-width: 768px) {
    .clima-controls {
        flex-direction: column;
        border-radius: 20px;
        gap: 20px;
    }

    .weather-hero h1 {
        font-size: 2.2rem;
    }

    .temperature {
        font-size: 4rem;
    }

    .hero-details {
        grid-template-columns: 1fr;
    }

    .map-container-premium {
        height: 400px;
    }

    .historical-controls {
        grid-template-columns: 1fr;
    }
}