/* ===========================
   RESET & BASE
=========================== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg: #0f1923;
    --bg-card: #1a2635;
    --bg-card-2: #1e2d40;
    --accent: #4fc3f7;
    --accent-2: #81d4fa;
    --text: #e8f4fd;
    --text-muted: rgba(232, 244, 253, 0.5);
    --border: rgba(79, 195, 247, 0.15);
    --font-display: 'Syne', sans-serif;
    --font-body: 'Space Grotesk', sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    min-height: 100vh;
    padding: 2rem 1rem;
    background-image:
        radial-gradient(ellipse at 20% 50%, rgba(79, 195, 247, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(129, 212, 250, 0.04) 0%, transparent 40%);
}

/* ===========================
   LAYOUT
=========================== */
.app-wrapper {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* ===========================
   HEADER
=========================== */
.header {
    text-align: center;
    padding: 1rem 0;
}

.logo {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 800;
    color: var(--accent);
    letter-spacing: -0.5px;
}

.tagline {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
}

/* ===========================
   BÚSQUEDA
=========================== */
.search-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.search-box {
    display: flex;
    gap: 0.75rem;
}

.search-box input {
    flex: 1;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.9rem 1.2rem;
    color: var(--text);
    font-family: var(--font-body);
    font-size: 0.95rem;
    transition: border-color 0.2s;
    outline: none;
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.search-box input:focus {
    border-color: var(--accent);
}

.search-box button {
    background: var(--accent);
    color: var(--bg);
    border: none;
    border-radius: 12px;
    padding: 0.9rem 1.5rem;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
    white-space: nowrap;
}

.search-box button:hover {
    opacity: 0.85;
}

.search-box button:active {
    transform: scale(0.97);
}

.search-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    padding-left: 0.5rem;
}

/* ===========================
   ESTADOS
=========================== */
.empty-state,
.error-state,
.loading {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.empty-icon {
    font-size: 3rem;
}

.error-state {
    color: #ef5350;
}

.hidden {
    display: none !important;
}

/* Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ===========================
   WEATHER CARD
=========================== */
.weather-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 2rem;
    animation: fadeUp 0.4s ease both;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

.card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.city-info h1 {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1.1;
}

.city-info p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
}

.weather-icon {
    font-size: 3.5rem;
    line-height: 1;
}

.temp-main {
    display: flex;
    align-items: flex-start;
    gap: 0.2rem;
    margin-bottom: 0.5rem;
}

.temp-main span:first-child {
    font-family: var(--font-display);
    font-size: 5rem;
    font-weight: 800;
    line-height: 1;
    color: var(--accent);
}

.unit {
    font-size: 2rem !important;
    color: var(--text-muted) !important;
    margin-top: 0.8rem;
}

.description {
    font-size: 1rem;
    color: var(--text-muted);
    text-transform: capitalize;
    margin-bottom: 2rem;
}

/* ===========================
   DETALLES
=========================== */
.details-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.detail-item {
    background: var(--bg-card-2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.detail-icon {
    font-size: 1.3rem;
}

.detail-label {
    font-size: 0.72rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-muted);
}

.detail-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--accent-2);
}

/* ===========================
   FOOTER DE CARD
=========================== */
.card-footer {
    border-top: 1px solid var(--border);
    padding-top: 1rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: right;
}

/* ===========================
   CIUDADES RÁPIDAS
=========================== */
.quick-cities {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.quick-label {
    font-size: 0.75rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-muted);
}

.quick-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.quick-btn {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    color: var(--text);
    font-family: var(--font-body);
    font-size: 0.82rem;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.quick-btn:hover {
    background: var(--bg-card-2);
    border-color: var(--accent);
    color: var(--accent);
}

/* ===========================
   RESPONSIVE
=========================== */
@media (max-width: 480px) {
    .temp-main span:first-child {
        font-size: 4rem;
    }

    .weather-card {
        padding: 1.5rem;
    }

    .details-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Animación logo */
.logo-icon {
    display: inline-block;
    transition: opacity 0.3s ease, transform 0.3s ease;
}