/* ===== RESETAR ESTILOS PADRÃO ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ===== VARIÁVEIS DE COR ===== */
:root {
    --primary-blue: #3b82f6;
    --secondary-blue: #60a5fa;
    --light-blue: #eff6ff;
    --dark-text: #1f2937;
    --light-text: #6b7280;
    --light-bg: #f9fafb;
    --white: #ffffff;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

/* ===== ESTILO GERAL ===== */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--dark-text);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background: var(--white);
    border-radius: 16px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

/* ===== CABEÇALHO ===== */
.header {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--secondary-blue) 100%);
    color: var(--white);
    padding: 40px 20px;
    text-align: center;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.header .subtitle {
    font-size: 1rem;
    opacity: 0.95;
    font-weight: 300;
}

/* ===== SEÇÃO DE BUSCA ===== */
.search-section {
    padding: 30px 20px;
    background: var(--light-bg);
    border-bottom: 1px solid #e5e7eb;
}

.search-box {
    display: flex;
    gap: 10px;
    max-width: 500px;
    margin: 0 auto;
    position: relative;
}

.search-box input {
    flex: 1;
    padding: 12px 16px;
    font-size: 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    transition: var(--transition);
    outline: none;
}

.search-box input:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.search-box button {
    padding: 12px 24px;
    background: var(--primary-blue);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
}

.search-box button:hover {
    background: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

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

/* ===== LISTA DE SUGESTÕES ===== */
.suggestions-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    border: 1px solid #e5e7eb;
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 10;
    margin-top: -8px;
    padding-top: 8px;
}

.suggestion-item {
    padding: 12px 16px;
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 1px solid #f3f4f6;
}

.suggestion-item:hover {
    background: var(--light-blue);
    padding-left: 20px;
}

.suggestion-item:last-child {
    border-bottom: none;
}

/* ===== CARREGAMENTO ===== */
.loading {
    padding: 40px 20px;
    text-align: center;
    font-size: 1.1rem;
    color: var(--primary-blue);
}

.loading p {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* ===== MENSAGEM DE ERRO ===== */
.error-message {
    padding: 20px;
    margin: 20px;
    background: #fee2e2;
    color: var(--error);
    border: 2px solid var(--error);
    border-radius: 8px;
    font-weight: 500;
    text-align: center;
}

/* ===== SEÇÃO DE TEMPO ATUAL ===== */
.weather-section {
    padding: 30px 20px;
    border-bottom: 1px solid #e5e7eb;
}

.weather-section h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: var(--dark-text);
}

.current-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    align-items: start;
}

.city-info h3 {
    font-size: 2rem;
    color: var(--primary-blue);
    margin-bottom: 5px;
}

.timestamp {
    color: var(--light-text);
    font-size: 0.95rem;
}

.weather-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.weather-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: var(--light-bg);
    border-radius: 8px;
    border-left: 4px solid var(--primary-blue);
}

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

.weather-card .label {
    font-size: 0.85rem;
    color: var(--light-text);
    margin-bottom: 5px;
}

.weather-card .value {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--dark-text);
}

.condition-text {
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    color: var(--dark-text) !important;
}

/* ===== CORES DINÂMICAS DE TEMPERATURA ===== */
/* #bceeff - Azul Celeste (<5°C) */
.weather-card.temp-freezing {
    border-left-color: #bceeff;
    background: linear-gradient(135deg, #bceeff 0%, #d4f1ff 100%);
}

.weather-card.temp-freezing .value {
    color: #0369a1 !important;
    font-weight: 900;
}

/* #8fe3ff - Azul Claro (5-10°C) */
.weather-card.temp-very-cold {
    border-left-color: #8fe3ff;
    background: linear-gradient(135deg, #8fe3ff 0%, #a8ecff 100%);
}

.weather-card.temp-very-cold .value {
    color: #0369a1 !important;
    font-weight: 900;
}

/* #53d4ff - Azul Ciano (10-15°C) */
.weather-card.temp-cold {
    border-left-color: #53d4ff;
    background: linear-gradient(135deg, #53d4ff 0%, #7ae1ff 100%);
}

.weather-card.temp-cold .value {
    color: #0369a1 !important;
    font-weight: 900;
}

/* Verde - Fresco (15-20°C) */
.weather-card.temp-cool {
    border-left-color: #10b981;
    background: linear-gradient(135deg, #D1FAE5 0%, #A7F3D0 100%);
}

.weather-card.temp-cool .value {
    color: #047857 !important;
    font-weight: 900;
}

/* Amarelo - Moderado (20-25°C) */
.weather-card.temp-moderate {
    border-left-color: #FBBF24;
    background: linear-gradient(135deg, #FEF3C7 0%, #FCD34D 100%);
}

.weather-card.temp-moderate .value {
    color: #D97706 !important;
    font-weight: 900;
}

/* Laranja - Quente (25-30°C) */
.weather-card.temp-warm {
    border-left-color: #FB923C;
    background: linear-gradient(135deg, #FFEDD5 0%, #FED7AA 100%);
}

.weather-card.temp-warm .value {
    color: #EA580C !important;
    font-weight: 900;
}

/* Vermelho - Muito Quente (>30°C) */
.weather-card.temp-hot {
    border-left-color: #EF4444;
    background: linear-gradient(135deg, #FEE2E2 0%, #FECACA 100%);
}

.weather-card.temp-hot .value {
    color: #DC2626 !important;
    font-weight: 900;
}

.wind-direction {
    font-size: 0.85rem;
    color: var(--light-text);
    margin-top: 3px;
}

/* ===== SEÇÃO DE PREVISÃO ===== */
.forecast-section {
    padding: 30px 20px;
    border-bottom: 1px solid #e5e7eb;
}

.forecast-section h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: var(--dark-text);
}

.table-wrapper {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.forecast-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
}

.forecast-table thead {
    background: var(--light-blue);
}

.forecast-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: var(--primary-blue);
    border-bottom: 2px solid #dbeafe;
}

.forecast-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #f3f4f6;
}

.forecast-table tbody tr:hover {
    background: var(--light-bg);
}

.forecast-table tbody tr:last-child td {
    border-bottom: none;
}

/* ===== RODAPÉ ===== */
.footer {
    background: var(--light-bg);
    padding: 20px;
    text-align: center;
    font-size: 0.9rem;
    color: var(--light-text);
    border-top: 1px solid #e5e7eb;
}

.footer strong {
    color: var(--primary-blue);
}

/* ===== ESTADOS HIDDEN ===== */
.hidden {
    display: none !important;
}

/* ===== RESPONSIVO ===== */
@media (max-width: 768px) {
    .header h1 {
        font-size: 1.8rem;
    }

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

    .current-info {
        grid-template-columns: 1fr;
        gap: 20px;
    }

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

    .weather-card {
        justify-content: space-between;
    }

    .forecast-table {
        font-size: 0.9rem;
    }

    .forecast-table th,
    .forecast-table td {
        padding: 10px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    .container {
        border-radius: 12px;
    }

    .header {
        padding: 30px 15px;
    }

    .header h1 {
        font-size: 1.5rem;
    }

    .search-section {
        padding: 20px 15px;
    }

    .weather-section,
    .forecast-section {
        padding: 20px 15px;
    }

    .weather-section h2,
    .forecast-section h2 {
        font-size: 1.2rem;
    }
}
