/* EFECTOS VISUALES ÉPICOS */
.weather-effects {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

/* EFECTO LLUVIA */
.rain-effect {
    position: absolute;
    width: 100%;
    height: 100%;
    background: transparent;
}

.raindrop {
    position: absolute;
    width: 2px;
    height: 15px;
    background: linear-gradient(to bottom, rgba(255,255,255,0.6), rgba(174,194,224,0.8));
    border-radius: 1px;
    animation: rainFall linear infinite;
}

@keyframes rainFall {
    from {
        transform: translateY(-100vh) rotate(10deg);
        opacity: 0.7;
    }
    to {
        transform: translateY(100vh) rotate(10deg);
        opacity: 0;
    }
}


/* EFECTO NIEVE */
.snow-effect {
    position: absolute;
    width: 100%;
    height: 100%;
}

.snowflake {
    position: absolute;
    color: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
    animation: snowFall linear infinite;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

@keyframes snowFall {
    from {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 0.8;
    }
    to {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

/* EFECTO RAYOS */
.lightning-effect {
    position: absolute;
    width: 100%;
    height: 100%;
    background: transparent;
}

.lightning-flash {
    position: absolute;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    opacity: 0;
    animation: lightning 0.2s ease-out;
}

@keyframes lightning {
    0% { opacity: 0; }
    50% { opacity: 0.7; }
    100% { opacity: 0; }
}


/* RAYOS DE SOL */
.sun-rays {
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 200px;
}

.sun-ray {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 4px;
    height: 60px;
    background: linear-gradient(to bottom, rgba(255,193,7,0.6), transparent);
    transform-origin: 2px 0px;
    animation: sunRotation 8s linear infinite;
}

.sun-ray-1 { transform: translateX(-50%) rotate(0deg); animation-delay: 0s; }
.sun-ray-2 { transform: translateX(-50%) rotate(45deg); animation-delay: -2s; }
.sun-ray-3 { transform: translateX(-50%) rotate(90deg); animation-delay: -4s; }
.sun-ray-4 { transform: translateX(-50%) rotate(135deg); animation-delay: -6s; }

@keyframes sunRotation {
    from { transform: translateX(-50%) rotate(var(--rotation, 0deg)); }
    to { transform: translateX(-50%) rotate(calc(var(--rotation, 0deg) + 360deg)); }
}


/* NUBES FLOTANTES */
.floating-clouds {
    position: absolute;
    width: 100%;
    height: 100%;
}

.cloud {
    position: absolute;
    font-size: 2rem;
    opacity: 0.7;
    animation: cloudFloat linear infinite;
}

.cloud-1 {
    top: 20%;
    left: -10%;
    animation-duration: 20s;
    animation-delay: 0s;
}

.cloud-2 {
    top: 40%;
    left: -15%;
    animation-duration: 25s;
    animation-delay: -5s;
    font-size: 1.5rem;
}

.cloud-3 {
    top: 60%;
    left: -12%;
    animation-duration: 30s;
    animation-delay: -10s;
    font-size: 1.8rem;
}

@keyframes cloudFloat {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(calc(100vw + 100px));
    }
}

/* EFECTO ONDAS DE CALOR */
.heat-waves {
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg,
        rgba(255,140,0,0.1) 0%,
        transparent 20%,
        rgba(255,69,0,0.1) 40%,
        transparent 60%,
        rgba(255,140,0,0.1) 80%,
        transparent 100%);
    background-size: 50px 50px;
    animation: heatWave 2s ease-in-out infinite alternate;
}

@keyframes heatWave {
    from {
        transform: translateX(0px) translateY(0px);
        opacity: 0.3;
    }
    to {
        transform: translateX(2px) translateY(-2px);
        opacity: 0.6;
    }
}


/* Asegurar que el contenido esté por encima */
.header,
.controls-panel,
.weather-display,
.forecast-display,
.footer {
    position: relative;
    z-index: 10;
}


/* Reset y configuración base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}


body {
    font-family: 'Arial', sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
}


/* Contenedor principal */
.app-container {
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
    display: flex;
    flex-direction: column;
    transition: all 0.8s ease;
    position: relative;
    z-index: 10;
}

/* Gradientes por condición climática */
.app-container.clear {
    background: linear-gradient(135deg, #FFA726 0%, #FB8C00 50%, #E65100 100%);
}


.app-container.clouds {
    background: linear-gradient(135deg, #78909C 0%, #546E7A 50%, #37474F 100%);
}


.app-container.rain {
    background: linear-gradient(135deg, #42A5F5 0%, #1E88E5 50%, #1565C0 100%);
}


.app-container.snow {
    background: linear-gradient(135deg, #E3F2FD 0%, #90CAF9 50%, #42A5F5 100%);
}


.app-container.thunderstorm {
    background: linear-gradient(135deg, #424242 0%, #212121 50%, #000000 100%);
}


.app-container.hot {
    background: linear-gradient(135deg, #FF5722 0%, #D84315 50%, #BF360C 100%);
}


.app-container.cold {
    background: linear-gradient(135deg, #0D47A1 0%, #1565C0 50%, #1976D2 100%);
}


/* Header */
.header {
    text-align: center;
    margin-bottom: 30px;
}


.main-title {
    font-size: 2rem;
    font-weight: bold;
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    margin-bottom: 10px;
    animation: slideInDown 0.8s ease-out;
}


.subtitle {
    color: rgba(255, 255, 255, 0.8);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    animation: fadeIn 1s ease-out 0.3s both;
}


/* Panel de controles */
.controls-panel {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 24px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.37);
    border: 1px solid rgba(255, 255, 255, 0.18);
    animation: slideInUp 0.8s ease-out 0.2s both;
}


.control-group {
    margin-bottom: 20px;
}


.control-group:last-of-type {
    margin-bottom: 24px;
}


.control-label {
    display: block;
    color: white;
    font-weight: 600;
    margin-bottom: 8px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}


.city-input, .personality-select {
    width: 100%;
    padding: 12px 16px;
    border-radius: 12px;
    border: none;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    font-size: 16px;
    transition: all 0.3s ease;
}


.city-input:focus, .personality-select:focus {
    outline: none;
    background: white;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}


.fetch-weather-btn {
    width: 100%;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 12px;
    padding: 16px;
    font-size: 16px;
    font-weight: bold;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
}


.fetch-weather-btn:hover {
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}


.fetch-weather-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}


.loading-spinner {
    display: inline-block;
}


.loading-spinner i {
    animation: spin 1s linear infinite;
}


.hidden {
    display: none !important;
}


/* Display del clima */
.weather-display {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.37);
    border: 1px solid rgba(255, 255, 255, 0.18);
    animation: slideInUp 0.8s ease-out;
    margin-bottom: 20px;
}


.weather-header {
    text-align: center;
    margin-bottom: 30px;
}


.weather-city {
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    margin-bottom: 20px;
}


.weather-icon-container {
    margin-bottom: 20px;
}


.weather-icon {
    font-size: 4rem;
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    animation: float 3s ease-in-out infinite;
}


.weather-temp {
    font-size: 3rem;
    font-weight: bold;
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}


/* Comentario con personalidad */
.personality-comment {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 24px;
    animation: fadeIn 0.8s ease-out 0.5s both;
}


.personality-text {
    color: white;
    font-weight: 600;
    text-align: center;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    line-height: 1.4;
    font-size: 1rem;
}


/* Detalles del clima */
.weather-details {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}


.detail-item {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    transition: transform 0.3s ease;
}


.detail-item:hover {
    transform: translateY(-3px);
}


.detail-icon {
    color: white;
    font-size: 1.2rem;
    margin-bottom: 8px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}


.detail-value {
    color: white;
    font-size: 0.9rem;
    font-weight: bold;
    margin-bottom: 4px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}


.detail-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.75rem;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}


/* NUEVOS ESTILOS: Pronóstico de 5 días */
.forecast-display {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.37);
    border: 1px solid rgba(255, 255, 255, 0.18);
    animation: slideInUp 0.8s ease-out 0.3s both;
}


.forecast-header {
    text-align: center;
    margin-bottom: 20px;
}


.forecast-title {
    font-size: 1.3rem;
    font-weight: bold;
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    margin-bottom: 5px;
}


.forecast-subtitle {
    color: rgba(255, 255, 255, 0.8);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    font-size: 0.9rem;
}


.forecast-cards {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin-bottom: 25px;
}


.forecast-card {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 12px 6px;
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}


.forecast-card:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-3px);
}


.forecast-day {
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
    margin-bottom: 8px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}


.forecast-icon {
    color: white;
    font-size: 1.2rem;
    margin-bottom: 8px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}


.forecast-temp {
    color: white;
    font-size: 0.8rem;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    margin-bottom: 4px;
}


.forecast-temp-min {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.7rem;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.temperature-chart-container {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}


.chart-title {
    color: white;
    font-size: 1rem;
    font-weight: bold;
    text-align: center;
    margin-bottom: 15px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}


.temperature-chart {
    position: relative;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}


#temp-canvas {
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
}


/* Responsive para forecast */
@media (max-width: 480px) {
    .forecast-cards {
        gap: 6px;
    }
   
    .forecast-card {
        padding: 10px 4px;
    }
   
    .forecast-day {
        font-size: 0.7rem;
    }
   
    .forecast-icon {
        font-size: 1rem;
    }
   
    .forecast-temp {
        font-size: 0.75rem;
    }
   
    .forecast-temp-min {
        font-size: 0.65rem;
    }
   
    #temp-canvas {
        width: 300px;
        height: 100px;
    }
}


/* Footer */
.footer {
    margin-top: auto;
    padding-top: 30px;
}


.footer p {
    color: rgba(255, 255, 255, 0.6);
    text-align: center;
    font-size: 0.875rem;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}


/* Animaciones */
@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


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


@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}


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


/* Responsive móvil */
@media (max-width: 480px) {
    .main-title { font-size: 1.75rem; }
    .weather-temp { font-size: 2.5rem; }
    .weather-icon { font-size: 3rem; }
    .forecast-cards { gap: 6px; }
    .forecast-card { padding: 10px 4px; }
}

/* LAYOUT DESKTOP/TABLET */
@media (min-width: 1024px) {
    /* ESTADO INICIAL: Centrado */
    .app-container.centered {
        justify-content: center;
        align-items: center;
    }
    
    .app-container.centered .main-content {
        max-width: 500px;
        display: block;
    }
    
    .app-container.centered .right-column {
        display: none;
    }
    
    .app-container.with-data {
        justify-content: flex-start;
        align-items: flex-start;
        padding-top: 60px;
    }
    
    .app-container.with-data .main-content {
        max-width: 1400px;
        width: 100%;
        display: grid;
        grid-template-columns: 400px 1fr;
        gap: 50px;
        margin: 0 auto;
    }
    
    .app-container.with-data .right-column {
        display: flex;
        flex-direction: column;
        gap: 20px;
    }
}

@media (min-width: 1024px) {
    .weather-header {
        display: grid;
        grid-template-columns: 1fr auto;
        gap: 30px;
        align-items: center;
        text-align: left;
    }
    
    .weather-icon-container {
        margin-bottom: 0;
    }
}

.weather-city {
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    margin-bottom: 20px;
}

.weather-icon-container {
    margin-bottom: 20px;
}

.weather-icon {
    font-size: 4rem;
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    animation: float 3s ease-in-out infinite;
}

.weather-temp {
    font-size: 3rem;
    font-weight: bold;
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

@media (min-width: 1024px) {
    .weather-city { font-size: 2rem; }
    .weather-temp { font-size: 5rem; }
    .weather-icon { font-size: 6rem; }
}

.personality-comment {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 24px;
    animation: fadeIn 0.8s ease-out 0.5s both;
}

@media (min-width: 768px) {
    .personality-comment {
        padding: 25px;
        margin-bottom: 30px;
    }
    
    .personality-text {
        font-size: 1.1rem;
        line-height: 1.5;
    }
}

@media (min-width: 1024px) {
    .personality-comment {
        padding: 30px;
    }
    
    .personality-text {
        font-size: 1.2rem;
        line-height: 1.6;
    }
}

.personality-text {
    color: white;
    font-weight: 600;
    text-align: center;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    line-height: 1.4;
    font-size: 1rem;
}

@media (min-width: 1440px) {
    .app-container.centered .main-content {
        max-width: 600px;
    }
    
    .app-container.with-data .main-content {
        max-width: 1600px;
        gap: 60px;
    }
}

@media (min-width: 1024px) {
    .app-container.with-data .header {
        text-align: left;
    }
    
    .main-title {
        font-size: 2.5rem;
    }
}
@media (min-width: 1024px) {
    .personality-text {
        font-size: 1.2rem;
        line-height: 1.6;
    }
}

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

@media (min-width: 768px) {
    .weather-details {
        gap: 20px;
    }
    
    .detail-item {
        padding: 20px;
    }
    
    .detail-icon {
        font-size: 1.5rem;
        margin-bottom: 12px;
    }
    
    .detail-value {
        font-size: 1.1rem;
        margin-bottom: 6px;
    }
    
    .detail-label {
        font-size: 0.85rem;
    }
}

@media (min-width: 1024px) {
    .weather-details {
        gap: 25px;
    }
    
    .detail-item {
        padding: 25px;
    }
    
    .detail-icon {
        font-size: 1.8rem;
    }
    
    .detail-value {
        font-size: 1.2rem;
    }
    
    .detail-label {
        font-size: 0.9rem;
    }
}

.detail-item {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    transition: transform 0.3s ease;
}

.detail-item:hover {
    transform: translateY(-3px);
}

.detail-icon {
    color: white;
    font-size: 1.2rem;
    margin-bottom: 8px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.detail-value {
    color: white;
    font-size: 0.9rem;
    font-weight: bold;
    margin-bottom: 4px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.detail-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.75rem;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}
