:root {
    --primary: #4a90e2;
    --dark: #2c3e50;
    --light: #f4f7f6;
    --bg-gradient: linear-gradient(135deg, #a1c4fd 0%, #c2e9fb 100%);
    --danger: #e74c3c;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-gradient);
    min-height: 100vh;
    margin: 0;
    color: var(--dark);
}

/* --- HEADER Y BUSCADOR --- */
header {
    background: white;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

#searchForm {
    position: relative;
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 1rem;
}

input {
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 25px;
    width: 250px;
    outline: none;
    font-family: inherit;
}

header button {
    padding: 12px 25px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
    transition: 0.3s;
}

header button:hover {
    background: #357abd;
}

.suggestions-box {
    position: absolute;
    top: 100%;       
    left: 0;         
    transform: none; 
    width: 250px;    
    margin-left: 570px; 
    background: white;
    border-radius: 8px;
    box-shadow: 0 8px 15px rgba(0,0,0,0.15);
    z-index: 100;
    overflow: hidden;
}

.suggestion-item {
    padding: 10px 15px;
    cursor: pointer;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.suggestion-item:hover {
    background: #f0f7ff;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 240px 1fr 240px;
    gap: 20px;
    max-width: 1250px;
    margin: 30px auto;
    padding: 0 20px;
    align-items: start;
}

.side-panel {
    background: rgba(255, 255, 255, 0.7);
    padding: 20px;
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.side-panel h3 {
    font-size: 1rem;
    margin: 0;
    border-bottom: 1px solid rgba(0,0,0,0.1);
    padding-bottom: 10px;
}

/* Listas laterales */
.vertical-list, #favList {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0;
    list-style: none; 
    margin: 15px 0 0 0;
}

.history-chip, .fav-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    color: var(--dark); 
    border: none;
    padding: 10px 15px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600; 
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    width: 100%;
    box-sizing: border-box;
    text-decoration: none;
}

.history-chip:hover, .fav-item:hover {
    background: #f8f9fa;
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.history-chip span, .fav-item span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* La tachita de eliminar */
.delete-btn {
    background: transparent;
    border: none;
    color: #bbb;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    padding: 0 0 0 10px;
    line-height: 1;
    transition: color 0.2s;
}

.delete-btn:hover {
    color: var(--danger);
}


.card {
    background: white;
    padding: 30px;
    border-radius: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    text-align: center;
}

.hidden { display: none; }

.weather-details {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin: 20px 0;
    padding: 15px;
    background: rgba(74, 144, 226, 0.05);
    border-radius: 15px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.detail-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #888;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.detail-value {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--dark);
}

.btn-fav {
    background-color: var(--primary);
    color: white;
    border: 2px solid var(--primary);
    padding: 12px 25px;
    border-radius: 25px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    display: block;
    margin: 20px auto 0;
}

.btn-fav:hover {
    background-color: white;
    color: var(--primary);
    transform: scale(1.05);
    box-shadow: 0 4px 10px rgba(74, 144, 226, 0.2);
}

.forecast-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.forecast-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 15px;
    text-align: center;
    transition: 0.3s;
}

.forecast-item:hover {
    background: #edf2f7;
}


@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr 1fr; 
        max-width: 95%;
    }
    
    .main-display {
        grid-column: span 2;
        order: -1; 
    }
}

@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
        margin: 15px auto;
        padding: 0 10px;
    }

    header {
        padding: 1rem;
    }

    #searchForm {
        flex-direction: column; 
        align-items: center;
    }

    input {
        width: 100%;
        max-width: 300px;
    }

    header button {
        width: 100%;
        max-width: 300px;
    }

    .suggestions-box {
        width: 100%;
        max-width: 300px;
        left: 50%;
        transform: translateX(-50%); 
    }

    .main-display {
        grid-column: span 1;
    }

    .weather-details {
        gap: 20px; 
    }

    .forecast-grid {
        grid-template-columns: repeat(3, 1fr); 
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .forecast-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .card {
        padding: 15px;
    }
}