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

body {
    font-family: 'Roboto', sans-serif;
    background: linear-gradient(135deg, #74b9ff 0%, #0984e3 100%);
    color: #333;
    min-height: 100vh;
}

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

/* Header Actualizado */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 1rem 0;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.logo-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.logo-img {
    height: 60px; /* Altura base */
    width: auto;
    max-width: 200px; /* Ancho máximo para pantallas grandes */
    object-fit: contain;
    transition: all 0.3s ease;
}

.last-update {
    font-size: 0.9rem;
    color: #636e72;
    background: #f8f9fa;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    border: 1px solid #e9ecef;
    text-align: right;
}

/* Main Content */
.main {
    padding: 2rem 0;
}

/* Weather Cards */
.weather-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.weather-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

/* Current Weather */
.current-weather {
    margin-bottom: 2rem;
}

.main-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.weather-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.weather-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
}

.location {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    opacity: 0.9;
}

.weather-content {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 2rem;
    align-items: center;
}

.temperature-section {
    text-align: left;
}

.current-temp {
    font-size: 4rem;
    font-weight: 300;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.weather-desc {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    opacity: 0.9;
}

.feels-like {
    font-size: 1rem;
    opacity: 0.8;
}

.weather-icon {
    text-align: center;
}

.weather-icon i {
    font-size: 5rem;
    opacity: 0.9;
}

.weather-details {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1rem;
}

.detail-item i {
    width: 20px;
    opacity: 0.8;
}

/* Weather Grid */
.weather-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    color: #2d3436;
}

.card-header i {
    font-size: 1.5rem;
    color: #0984e3;
}

.card-header h3 {
    font-size: 1.2rem;
    font-weight: 600;
}

/* Card Specific Styles */
.solar-card .card-header i { color: #fdcb6e; }
.rain-card .card-header i { color: #74b9ff; }
.wind-card .card-header i { color: #74b9ff; }

.card-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.solar-item, .rain-item, .wind-item {
    text-align: center;
}

.solar-value, .rain-value, .wind-value {
    font-size: 2rem;
    font-weight: 300;
    color: #2d3436;
    margin-bottom: 0.5rem;
}

.solar-label, .rain-label, .wind-label {
    font-size: 0.9rem;
    color: #636e72;
}

/* Additional Data */
.details-card {
    margin-bottom: 2rem;
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.detail-box {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 12px;
    text-align: center;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.detail-box:hover {
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.detail-label {
    font-size: 0.85rem;
    color: #636e72;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.detail-value {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2d3436;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.loading-spinner {
    text-align: center;
    color: white;
}

.loading-spinner i {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.loading-spinner p {
    font-size: 1.1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .logo-container {
        justify-content: center;
        text-align: center;
    }
    
    .logo-img {
        height: 50px; /* Reducir tamaño en tablets */
        max-width: 180px;
    }
    
    .last-update {
        text-align: center;
        width: 100%;
        margin-top: 0.5rem;
    }
    
    .weather-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 1.5rem;
    }
    
    .temperature-section {
        text-align: center;
    }
    
    .current-temp {
        font-size: 3rem;
    }
    
    .weather-icon i {
        font-size: 4rem;
    }
    
    .weather-details {
        flex-direction: row;
        justify-content: space-around;
        flex-wrap: wrap;
    }
    
    .weather-grid {
        grid-template-columns: 1fr;
    }
    
    .card-content {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .details-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
    
    .container {
        padding: 0 15px;
    }
}

@media (max-width: 480px) {
    .logo-img {
        height: 45px; /* Reducir más en móviles */
        max-width: 160px;
    }
    
    .current-temp {
        font-size: 2.5rem;
    }
    
    .weather-icon i {
        font-size: 3rem;
    }
    
    .solar-value, .rain-value, .wind-value {
        font-size: 1.5rem;
    }
    
    .details-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .last-update {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
}

/* Animation for data updates */
.data-update {
    animation: pulse 0.5s ease-in-out;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Weather condition based colors */
.weather-sunny { color: #fdcb6e; }
.weather-cloudy { color: #636e72; }
.weather-rainy { color: #74b9ff; }
.weather-stormy { color: #a29bfe; }

/* Ajustar grid para 3 tarjetas en lugar de 4 */
.weather-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

/* Asegurar que los valores largos se muestren correctamente */
.solar-value, .rain-value, .wind-value, .detail-value {
    font-size: 1.5rem;
    font-weight: 400; /* Menos grueso para valores largos */
    word-break: break-word;
    overflow-wrap: break-word;
}

.current-temp {
    font-size: 3.5rem; /* Un poco más pequeño para valores decimales largos */
    font-weight: 300;
}