/* assets/style.css (VERSÃO FINAL COMPLETA) */

/* ==========================================================================
   1. ESTILOS GERAIS
   ========================================================================== */
body {
    font-family: 'Roboto', sans-serif;
    background-color: #f8f9fa;
}

h1, h2, h3, h4, h5, h6 {
    color: #343a40;
    margin-bottom: 0.5rem;
}

/* Fundo azul suave (Fallback) */
.bg-gemini-blue {
    background-color: #e6f0ff !important;
}

/* ==========================================================================
   2. CORES E STATUS (Mapa e Cards)
   ========================================================================== */

/* Verde Vibrante (RiskGeo Green) - Usado para Chuva e Umidade Livre */
.bg-lighter-green {
    background-color: #2ecc71 !important;
}

/* Sobrescreve o Success do Bootstrap para ficar igual ao nosso verde */
.bg-success {
    background-color: #2ecc71 !important;
}

/* Garante texto preto no badge verde claro */
.badge-black-text-custom {
    color: #000000 !important;
    font-weight: bold;
}

/* Força texto preto nos badges padrão */
.badge-black-text {
    color: #000 !important;
    font-weight: bold;
}

/* Amarelo Ouro Vibrante (Atenção) - Modificado para ser mais vivo */
.bg-warning {
    background-color: #FFEE00 !important;
    color: #000 !important;
}

/* Laranja (Alerta) */
.bg-orange {
    background-color: #fd7e14 !important;
}
.badge-orange {
    color: #fff;
    background-color: #fd7e14 !important;
}

/* Vermelho (Crítico/Paralisação) */
.bg-danger {
    background-color: #dc3545 !important;
}

/* Força texto preto em cards de alerta coloridos para leitura */
.card.bg-warning, .card.bg-warning h5, .card.bg-warning p,
.card.bg-orange, .card.bg-orange h5, .card.bg-orange p {
    color: #000 !important;
}

/* ==========================================================================
   3. COMPONENTES DO MAPA (Gauges e Cards Flutuantes)
   ========================================================================== */

/* Cards Flutuantes Laterais */
.map-summary-card {
    position: absolute;
    z-index: 1000;
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 0;
    max-height: calc(80vh - 4rem);
    overflow-y: auto;
}

.map-summary-card-body {
    padding: 0.5rem;
}

/* GAUGES VERTICAIS (Barras de Nível no Mapa) */
.gauge-vertical-container {
    position: relative;
    background-color: #e9ecef; /* Fundo cinza claro */
    border-radius: 0.25rem;
    overflow: hidden;
    margin: 0 auto;
    display: flex;
    align-items: flex-end; /* Faz a barra crescer de baixo */
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
}

.gauge-bar {
    width: 100%;
    transition: height 0.5s ease-out; /* Animação suave ao subir/descer */
}

.gauge-label {
    position: absolute;
    width: 100%;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    text-align: center;
    font-weight: bold;
    color: #000;
    pointer-events: none;
    text-shadow: 0px 0px 2px rgba(255,255,255,0.8);
}

/* CARD DE RODAPÉ (HUD - Inspeção ao Clicar) */
.hud-footer-card {
    transition: all 0.2s ease-in-out;
    animation: slideUp 0.3s ease-out;
    position: relative;
    z-index: 1002;
    border: 1px solid #dee2e6;
}

@keyframes slideUp {
    from { transform: translate(0, 20px); opacity: 0; }
    to { transform: translate(0, 0); opacity: 1; }
}

/* ==========================================================================
   4. LOGIN MODERNO (Glassmorphism & Botão Premium)
   ========================================================================== */

/* Card com efeito de vidro fosco */
.login-card-glass {
    background: rgba(255, 255, 255, 0.75) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.6) !important;
    border-radius: 24px !important;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15) !important;
}

/* Inputs Modernos */
.form-control-modern {
    background: rgba(255, 255, 255, 0.9) !important;
    border: 1px solid #e1e5eb !important;
    border-radius: 12px !important;
    padding: 12px 15px !important;
    font-size: 0.95rem !important;
    transition: all 0.3s ease;
}

.form-control-modern:focus {
    background: #fff !important;
    border-color: #00C09D !important;
    box-shadow: 0 0 0 4px rgba(0, 192, 157, 0.1) !important;
}

/* BOTÃO DE LOGIN GRADIENTE */
.btn-login-modern {
    background: linear-gradient(90deg, #0062E6 0%, #33AEFF 100%) !important;
    border: none !important;
    border-radius: 12px !important;
    padding: 14px 24px !important;
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    letter-spacing: 1px !important;
    color: #ffffff !important;
    box-shadow: 0 4px 20px rgba(0, 98, 230, 0.3), inset 0 1px 0px rgba(255, 255, 255, 0.4) !important;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
    position: relative;
    z-index: 1;
}

.btn-login-modern:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 30px rgba(0, 98, 230, 0.5), inset 0 1px 0px rgba(255, 255, 255, 0.5) !important;
    filter: brightness(1.05);
}

.btn-login-modern:active {
    transform: translateY(-1px) scale(0.99);
    box-shadow: 0 3px 10px rgba(0, 98, 230, 0.4) !important;
    filter: brightness(0.95);
}

/* ==========================================================================
   5. FOOTER
   ========================================================================== */
.footer-fixed-bottom {
    position: fixed;
    bottom: 0;
    width: 100%;
    height: 30px;
    z-index: 1020;
    padding-bottom: 5px;
}

/* ==========================================================================
   6. ANIMAÇÃO DE PINOS DO MAPA (SVG) - EFEITO PULSAR
   ========================================================================== */

@keyframes pulse-red {
    0% {
        transform: scale(1);
        filter: drop-shadow(0 0 0 rgba(220, 53, 69, 0.7));
    }
    50% {
        transform: scale(1.2);
        filter: drop-shadow(0 0 10px rgba(220, 53, 69, 1));
    }
    100% {
        transform: scale(1);
        filter: drop-shadow(0 0 0 rgba(220, 53, 69, 0.7));
    }
}

/* Aplica a animação na classe que o Python adiciona quando Nível = 3 */
.custom-marker-div.marker-pulse svg {
    animation: pulse-red 1.5s infinite ease-in-out;
    transform-origin: center bottom;
}

/* Corrige o container do ícone Leaflet para não cortar a animação */
.leaflet-div-icon {
    background: transparent !important;
    border: none !important;
}

/* ==========================================================================
   7. ETIQUETA DE CHUVA NO MAPA (Balão Fixo)
   ========================================================================== */
.rain-label-tooltip {
    background-color: #ffffff !important;
    border: 2px solid #343a40 !important; /* Borda escura para contraste */
    border-radius: 12px !important;       /* Bem arredondado */
    padding: 2px 6px !important;
    font-size: 11px !important;
    font-weight: 900 !important;          /* Extra Negrito */
    color: #000000 !important;
    box-shadow: 0 3px 6px rgba(0,0,0,0.4);
    text-align: center;
    white-space: nowrap;
    z-index: 1000 !important;             /* Garante que fique por cima */
}

/* Remove a setinha padrão do Leaflet para ficar mais limpo */
.leaflet-tooltip-top:before,
.leaflet-tooltip-bottom:before,
.leaflet-tooltip-left:before,
.leaflet-tooltip-right:before {
    display: none !important;
}
/* ==========================================================================
   8. RADAR DE CRÍTICOS (HUD FLUTUANTE)
   ========================================================================== */
@keyframes pulse-alert-bg {
    0% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7); }
    70% { box-shadow: 0 0 0 15px rgba(220, 53, 69, 0); }
    100% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0); }
}

.radar-pulse-critical {
    animation: pulse-alert-bg 2s infinite;
    border: 2px solid #dc3545 !important;
}

.glass-panel {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
/* ... (Mantenha o código anterior do radar vermelho) ... */

/* Animação Laranja (Alerta Nível 2) */
@keyframes pulse-alert-orange {
    0% { box-shadow: 0 0 0 0 rgba(253, 126, 20, 0.7); }
    70% { box-shadow: 0 0 0 15px rgba(253, 126, 20, 0); }
    100% { box-shadow: 0 0 0 0 rgba(253, 126, 20, 0); }
}

.radar-pulse-warning {
    animation: pulse-alert-orange 2s infinite;
    border: 2px solid #fd7e14 !important; /* Laranja do Bootstrap */
    color: #fd7e14 !important;
}

/* ==========================================================================
   9. RADAR VIBRANTE (Filtro CSS para OpenWeatherMap)
   ========================================================================== */
/* Torna as cores do radar muito mais fortes e contrastadas */
.radar-vibrante {
    filter: saturate(3) contrast(1.5) brightness(1.1);
}

/* ==========================================================================
   10. CORREÇÃO RESPONSIVA MOBILE (ANALISTA IA E LAYOUT)
   ========================================================================== */
@media (max-width: 768px) {
    /* Transforma o botão em um quadrado pequeno só com o ícone no celular */
    #btn-abrir-analista-ia {
        right: 15px !important;
        left: auto !important;
        bottom: 40vh !important; /* Move para a lateral direita, mais pro meio da tela */
        width: 50px !important;
        height: 50px !important;
        padding: 0 !important;
        border-radius: 12px !important; /* Quadrado com cantos arredondados */
        font-size: 0 !important; /* Esconde magicamente o texto sem mexer no Python */
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        z-index: 3000 !important;
    }

    /* Garante que o ícone do robô continue grande e centralizado */
    #btn-abrir-analista-ia i {
        font-size: 24px !important;
        margin: 0 !important; /* Remove o espaçamento (me-2) que empurrava o layout */
    }

    /* Redimensiona e centraliza a janela do chat para caber perfeitamente na tela do celular */
    #floating-chat-widget {
        right: 10px !important;
        left: 10px !important;
        width: calc(100% - 20px) !important;
        bottom: 20px !important;
        height: 80vh !important;
        max-height: 80vh !important;
        z-index: 3000 !important;
    }
}