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

:root {
    --cream: #FAF6F1;
    --magenta: #E91E8C;
    --black: #1A1A1A;
    --gray: #6B6B6B;
    --light-gray: #E5E5E5;
}

body {
    font-family: 'Georgia', 'Times New Roman', serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    transition: background 0.8s ease;
}

/* Backgrounds dinámicos según clima */
body.clear {
    background: linear-gradient(135deg, #FDB99B 0%, #CF8BF3 50%, #A770EF 100%);
}

body.clouds {
    background: linear-gradient(135deg, #E0E7FF 0%, #B8C5F2 100%);
}

body.rain {
    background: linear-gradient(135deg, #4A5568 0%, #2D3748 100%);
}

body.snow {
    background: linear-gradient(135deg, #E6EFFF 0%, #D4E4FF 100%);
}

body.thunderstorm {
    background: linear-gradient(135deg, #2D3748 0%, #1A202C 100%);
}

body.mist,
body.fog {
    background: linear-gradient(135deg, #C9D6DF 0%, #E3EFF3 100%);
}

/* Contenedor principal */
.container {
    max-width: 500px;
    width: 100%;
    animation: fadeIn 1s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 2rem;
}

.logo {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.app-title {
    font-size: 2rem;
    color: white;
    font-weight: 300;
    letter-spacing: 3px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

/* Search Section */
.search-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 2rem;
    border-radius: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    margin-bottom: 2rem;
}

.search-container {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.search-input {
    flex: 1;
    padding: 1rem 1.5rem;
    border: 2px solid var(--light-gray);
    border-radius: 50px;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
    font-family: inherit;
}

.search-input:focus {
    border-color: var(--magenta);
    box-shadow: 0 0 0 3px rgba(233, 30, 140, 0.1);
}

.search-btn {
    padding: 1rem 2rem;
    background: linear-gradient(135deg, var(--magenta), #ff4db8);
    color: white;
    border: none;
    border-radius: 50px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(233, 30, 140, 0.3);
}

.search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(233, 30, 140, 0.4);
}

.search-btn:active {
    transform: translateY(0);
}

.location-btn {
    width: 100%;
    padding: 0.8rem;
    background: transparent;
    border: 2px solid var(--light-gray);
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    color: var(--gray);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.location-btn:hover {
    border-color: var(--magenta);
    color: var(--magenta);
}

/* Weather Card */
.weather-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 3rem 2rem;
    border-radius: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    text-align: center;
    display: none;
    animation: slideUp 0.5s ease;
}

.weather-card.show {
    display: block;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.city-name {
    font-size: 2rem;
    color: var(--black);
    margin-bottom: 0.5rem;
    font-weight: 400;
}

.date {
    color: var(--gray);
    font-size: 1rem;
    margin-bottom: 2rem;
}

.weather-icon {
    font-size: 8rem;
    margin: 1rem 0;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

.temperature {
    font-size: 5rem;
    font-weight: 300;
    color: var(--black);
    margin: 1rem 0;
}

.weather-description {
    font-size: 1.5rem;
    color: var(--gray);
    text-transform: capitalize;
    margin-bottom: 2rem;
    font-style: italic;
}

/* Weather Details */
.weather-details {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--light-gray);
}

.detail-item {
    text-align: center;
}

.detail-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.detail-label {
    font-size: 0.85rem;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.3rem;
}

.detail-value {
    font-size: 1.3rem;
    color: var(--black);
    font-weight: 600;
}

/* Loading */
.loading {
    display: none;
    text-align: center;
    padding: 2rem;
}

.loading.show {
    display: block;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

.loading-text {
    color: white;
    font-size: 1.2rem;
}

/* Error */
.error {
    display: none;
    background: #FEE;
    color: #C33;
    padding: 1rem;
    border-radius: 15px;
    margin-top: 1rem;
    border-left: 4px solid #C33;
}

.error.show {
    display: block;
    animation: shake 0.5s ease;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-10px);
    }

    75% {
        transform: translateX(10px);
    }
}

/* Haiku Section */
.haiku {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 1.5rem;
    border-radius: 20px;
    margin-top: 1.5rem;
    border-left: 4px solid var(--magenta);
}

.haiku-text {
    color: var(--black);
    font-style: italic;
    line-height: 1.8;
    text-align: left;
}

/* Footer */
.footer {
    text-align: center;
    margin-top: 2rem;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 1rem;
    }

    .app-title {
        font-size: 1.5rem;
    }

    .temperature {
        font-size: 4rem;
    }

    .weather-icon {
        font-size: 6rem;
    }

    .weather-details {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .search-container {
        flex-direction: column;
    }
}

/* Animación de lluvia (opcional) */
.rain-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    display: none;
}

.rain-container.show {
    display: block;
}

.raindrop {
    position: absolute;
    width: 2px;
    height: 20px;
    background: linear-gradient(to bottom, transparent, rgba(255, 255, 255, 0.6));
    animation: fall linear infinite;
}

@keyframes fall {
    to {
        transform: translateY(100vh);
    }
}