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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.5s ease;
    background-color: #f5f5f5;
}

/* State-based backgrounds */
body.rain {
    background-color: #4a5568;
}

body.no-rain {
    background-color: #fef3c7;
}

.container {
    text-align: center;
    padding: 20px;
    width: 100%;
    max-width: 400px;
}

/* Input Section */
.input-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.title {
    font-size: 2.5rem;
    font-weight: 300;
    color: #4a5568;
    margin-bottom: 20px;
    letter-spacing: -0.02em;
}

#locationInput {
    font-size: 1.2rem;
    padding: 16px 24px;
    border: 2px solid #e2e8f0;
    border-radius: 50px;
    width: 100%;
    max-width: 300px;
    text-align: center;
    outline: none;
    transition: border-color 0.2s;
}

#locationInput:focus {
    border-color: #a0aec0;
}

.divider {
    color: #a0aec0;
    font-size: 0.9rem;
}

#geoButton {
    font-size: 1rem;
    padding: 12px 24px;
    background: none;
    border: 2px solid #e2e8f0;
    border-radius: 50px;
    color: #4a5568;
    cursor: pointer;
    transition: all 0.2s;
}

#geoButton:hover {
    border-color: #a0aec0;
    background: #fff;
}

/* Answer Section */
.answer-section {
    display: none;
}

.answer {
    font-size: clamp(4rem, 20vw, 10rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1;
    margin-bottom: 20px;
    transition: color 0.3s;
}

body.rain .answer {
    color: #fff;
}

body.no-rain .answer {
    color: #d97706;
}

.location {
    font-size: 1rem;
    color: #718096;
    margin-bottom: 40px;
}

body.rain .location {
    color: rgba(255, 255, 255, 0.7);
}

.reset {
    font-size: 0.9rem;
    padding: 10px 20px;
    background: none;
    border: 1px solid currentColor;
    border-radius: 50px;
    color: #a0aec0;
    cursor: pointer;
    transition: all 0.2s;
}

body.rain .reset {
    color: rgba(255, 255, 255, 0.5);
    border-color: rgba(255, 255, 255, 0.3);
}

body.rain .reset:hover {
    color: #fff;
    border-color: #fff;
}

body.no-rain .reset:hover {
    color: #d97706;
    border-color: #d97706;
}

/* Loading State */
.loading {
    display: none;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e2e8f0;
    border-top-color: #a0aec0;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Error State */
.error {
    display: none;
}

.error p {
    color: #e53e3e;
    margin-bottom: 16px;
}

#retryButton {
    font-size: 0.9rem;
    padding: 10px 20px;
    background: none;
    border: 1px solid #e53e3e;
    border-radius: 50px;
    color: #e53e3e;
    cursor: pointer;
    transition: all 0.2s;
}

#retryButton:hover {
    background: #e53e3e;
    color: #fff;
}

/* Utility: show/hide */
.hidden {
    display: none !important;
}

.visible {
    display: flex !important;
    flex-direction: column;
    align-items: center;
}
