/* estilos de Weather App beta 2
   diseño con glassmorphism y GIF de fondo segun el clima
   gris y azul oscuro para que se vea bien sobre los GIFs */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: system-ui, Arial, sans-serif;
    background: linear-gradient(135deg, #485461, #28313b) no-repeat fixed;
    background-size: cover;
    color: white;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.5;
    transition: background-image 0.8s ease;
}

/* oscurecemos un poco el fondo del GIF para que el texto se lea bien */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.35);
    z-index: -1;
    pointer-events: none;
}

header {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding: 18px 20px;
}

header h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
}

header p {
    font-size: 13px;
    opacity: 0.85;
}

main {
    flex: 1;
    max-width: 600px;
    width: 100%;
    margin: 0 auto;
    padding: 20px;
}

section {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 16px;
    padding: 18px;
    margin-bottom: 18px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

#resultado {
    display: none;
    text-align: center;
}

/* formulario */
form {
    display: flex;
    gap: 10px;
}

input {
    flex: 1;
    padding: 10px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    color: white;
}

input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.6);
}

button {
    background: rgba(255, 255, 255, 0.25);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-family: inherit;
}

button:hover {
    background: rgba(255, 255, 255, 0.4);
}

/* mensajes */
#cargando {
    display: none;
    color: rgba(255, 255, 255, 0.85);
    font-size: 14px;
    margin-top: 10px;
    animation: pulse 1.5s ease infinite;
}

#error {
    color: rgba(255, 200, 200, 0.95);
    font-size: 14px;
    margin-top: 10px;
    display: none;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }
}

/* resultado */
#ciudad {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 10px;
}

#icono-clima {
    font-size: 80px;
    line-height: 1;
    margin-bottom: 8px;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

#temp {
    font-size: 56px;
    font-weight: 700;
    margin-bottom: 6px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

#descripcion {
    font-size: 18px;
    margin-bottom: 20px;
    text-transform: capitalize;
    opacity: 0.9;
}

#detalles {
    display: flex;
    justify-content: center;
    gap: 24px;
    font-size: 14px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 14px;
    margin-top: 8px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

#detalles .detalle {
    text-align: center;
}

#detalles .label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    margin-bottom: 2px;
}

#detalles .valor {
    font-weight: 600;
    font-size: 18px;
}

/* pie de pagina */
footer {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
    padding: 14px;
    font-size: 12px;
}


/* === BETA 3: estilos del pronostico y el grafico === */

#pronostico {
    display: none;
    text-align: center;
}

#pronostico h2 {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 14px;
    color: white;
    text-align: left;
}

/* lista de los 5 dias */
#lista-dias {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 18px;
}

.dia-pronostico {
    flex: 1;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 10px 6px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.dia-nombre {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dia-icono {
    font-size: 28px;
    line-height: 1;
    margin-bottom: 8px;
}

.dia-temps {
    display: flex;
    justify-content: center;
    gap: 6px;
    font-size: 13px;
}

.temp-max {
    font-weight: 600;
    color: white;
}

.temp-min {
    color: rgba(255, 255, 255, 0.55);
}

/* grafico de temperaturas */
#grafico {
    width: 100%;
    max-width: 560px;
    height: 200px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    margin: 0 auto;
    display: block;
}

/* leyenda del grafico */
#grafico-leyenda {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.75);
    margin-top: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
}

#grafico-leyenda .punto-max,
#grafico-leyenda .punto-min {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 4px;
}

#grafico-leyenda .punto-max {
    background: #ff6b6b;
}

#grafico-leyenda .punto-min {
    background: #74c0fc;
}

/* responsivo: en pantallas pequeñas los dias se apilan */
@media (max-width: 480px) {
    #lista-dias {
        flex-wrap: wrap;
    }

    .dia-pronostico {
        flex: 1 1 30%;
        margin-bottom: 6px;
    }
}


/* === BETA 4: estilos de favoritos, estrella y boton ubicacion === */

/* boton de ubicacion */
#btn-ubicacion {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

#btn-ubicacion:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* estrella de favorito */
#estrella-favorito {
    display: inline-block;
    font-size: 28px;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    margin-left: 10px;
    vertical-align: middle;
    transition: color 0.2s, transform 0.2s;
    user-select: none;
}

#estrella-favorito:hover {
    transform: scale(1.2);
    color: rgba(255, 255, 255, 0.9);
}

#estrella-favorito.activa {
    color: #fbbf24;
    text-shadow: 0 0 12px rgba(251, 191, 36, 0.6);
}

/* seccion de favoritos */
#favoritos {
    margin-top: 12px;
}

#favoritos-titulo {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

#favoritos-lista {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.chip-favorito {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: white;
    padding: 4px 10px;
    border-radius: 14px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
    display: inline-flex;
    align-items: center;
}

.chip-favorito:hover {
    background: rgba(255, 255, 255, 0.3);
}

.chip-cruz {
    margin-left: 6px;
    font-size: 15px;
    line-height: 1;
    opacity: 0.7;
}

.chip-cruz:hover {
    opacity: 1;
    color: rgba(255, 200, 200, 0.9);
}

/* === BETA 4: cambiar font a Space Grotesk === */
/* pongo !important para pisar el system-ui que puse en la beta 2 */
body,
header,
input,
button,
#ciudad,
#temp,
#descripcion,
#detalles,
.dia-pronostico,
.dia-nombre,
.chip-favorito,
#favoritos-titulo,
footer {
    font-family: 'Space Grotesk', sans-serif !important;
}


/* === WEATHER APP PATCH: estilos de settings + welcome === */

#btn-settings {
    position: absolute;
    top: 18px;
    right: 20px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: background 0.15s;
    z-index: 100;
}

#btn-settings:hover {
    background: rgba(255, 255, 255, 0.3);
}

#panel-settings {
    position: absolute;
    top: 60px;
    right: 20px;
    background: rgba(20, 20, 30, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 16px;
    z-index: 100;
    min-width: 220px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.settings-fila {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.settings-fila:not(:last-child) {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.settings-fila>span {
    color: rgba(255, 255, 255, 0.85);
    font-size: 13px;
    font-family: 'Space Grotesk', sans-serif;
}

.settings-toggle {
    display: flex;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 2px;
    gap: 2px;
}

.settings-toggle button {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    padding: 4px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    transition: all 0.15s;
}

.settings-toggle button.active {
    background: rgba(255, 255, 255, 0.25);
    color: white;
}

.settings-toggle button:hover:not(.active) {
    color: rgba(255, 255, 255, 0.9);
}


/* --- welcome state --- */
#welcome-state {
    text-align: center;
    padding: 60px 20px;
    color: white;
}

.welcome-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
    animation: welcome-pulse 3s ease infinite;
}

@keyframes welcome-pulse {

    0%,
    100% {
        opacity: 0.4;
        transform: scale(1);
    }

    50% {
        opacity: 0.7;
        transform: scale(1.05);
    }
}

#welcome-state h2 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
    font-family: 'Space Grotesk', sans-serif;
}

#welcome-state p {
    font-size: 14px;
    opacity: 0.7;
    font-family: 'Space Grotesk', sans-serif;
}


/* ajustar el header para que el boton quepa */
header {
    position: relative;
    padding-right: 64px;
}