/* ==========================================================================
   HOJA DE ESTILOS PREMIUM - PORTAL ALERTA FSA (RESPONSIVE)
   ========================================================================== */

:root {
    --bg-dark: #070b13;
    --bg-card: #0d1729;
    --border-color: #1c2e4f;
    --text-main: #ffffff;
    --text-muted: #6b7c96;
    --cyan: #00d1ff;
    --red: #ff4c4c;
    --green: #00e676;
    --header-height: 80px;
    --topbar-height: 40px;
    --navbar-height: 50px;
}

body, html { 
    margin: 0; 
    padding: 0; 
    font-family: 'Roboto', sans-serif; 
    background-color: var(--bg-dark); 
    color: var(--text-main); 
    height: 100%; 
    overflow-x: hidden; 
    overflow-y: auto; /* Permite scroll vertical */
}

/* ==========================================================================
   1. TOP-BAR / MARQUESINA
   ========================================================================== */
.top-bar-mu { position: fixed; top: 0; left: 0; width: 100%; height: var(--topbar-height); background-color: rgba(7, 11, 19, 0.95); border-bottom: 1px solid var(--border-color); z-index: 1001; overflow: hidden; }
.marquee-wrapper { height: 100%; display: flex; align-items: center; }
.marquee-content { display: inline-block; white-space: nowrap; color: var(--text-main); font-size: 13px; font-weight: bold; animation: marquee 30s linear infinite; gap: 15px; display: flex; }
@keyframes marquee { 0% { transform: translateX(100%); } 100% { transform: translateX(-100%); } }

/* ==========================================================================
   2. PORTAL_HEADER
   ========================================================================== */
.portal-header { position: fixed; top: var(--topbar-height); left: 0; width: 100%; height: var(--header-height); background: linear-gradient(180deg, #0d1729 0%, rgba(7, 11, 19, 0.98) 100%); border-bottom: 2px solid var(--cyan); box-shadow: 0 4px 20px rgba(0, 209, 255, 0.15); z-index: 1000; }
.header-main-container { max-width: 1600px; height: 100%; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; padding: 0 30px; }
.logo-link { display: flex; align-items: center; text-decoration: none; gap: 12px; transition: 0.2s; min-width: 250px; }
.logo-placeholder { font-size: 30px; filter: drop-shadow(0 0 8px rgba(0, 209, 255, 0.6)); animation: rumor 2s infinite ease-in-out; }
.brand-title { color: #ffffff; font-size: 22px; font-weight: 900; letter-spacing: 1.5px; margin: 0; }
.text-cyan { color: var(--cyan); text-shadow: 0 0 10px rgba(0, 209, 255, 0.6); }
.brand-subtitle { color: var(--text-muted); font-size: 11px; font-weight: bold; text-transform: uppercase; letter-spacing: 0.5px; }

.brand-title-full { text-align: center; flex: 1; margin-top: -10px; }
.portal-title { color: #ffffff; font-size: 26px; font-weight: 900; letter-spacing: 2px; margin: 0; text-shadow: 0 0 10px rgba(255,255,255,0.2); }
.portal-subtitle { color: var(--cyan); font-size: 12px; font-weight: bold; text-transform: uppercase; margin: 3px 0 0 0; letter-spacing: 1px; }

.user-logged-nav { display: flex; align-items: center; gap: 10px; background: rgba(28, 46, 79, 0.4); padding: 5px 12px; border-radius: 20px; border: 1px solid #1c2e4f; justify-content: flex-end; }
.user-name-small { color: var(--green); font-size: 12px; font-weight: 700; }
.btn-logout-small { text-decoration: none; background: rgba(255, 76, 76, 0.1); border: 1px solid var(--red); color: var(--red); width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border-radius: 50%; font-size: 10px; font-weight: bold; transition: 0.3s; cursor: pointer; }
.btn-logout-small:hover { background: var(--red); color: #ffffff; box-shadow: 0 0 10px rgba(255, 76, 76, 0.5); }

/* ==========================================================================
   3. PORTAL_NAVBAR
   ========================================================================== */
.portal-navbar { position: fixed; top: calc(var(--topbar-height) + var(--header-height)); left: 0; width: 100%; height: var(--navbar-height); background: rgba(7, 11, 19, 0.98); border-bottom: 1px solid var(--border-color); z-index: 999; display: flex; align-items: center; justify-content: center; }
.navbar-container { display: flex; gap: 30px; }
.nav-btn { text-decoration: none; color: #ffffff; font-weight: 700; font-size: 14px; text-transform: uppercase; padding: 8px 20px; border-radius: 4px; border: 1px solid transparent; transition: 0.3s; display: flex; align-items: center; gap: 8px; }
.nav-btn .icon { font-size: 16px; }
.nav-btn:hover:not(.disabled-future) { color: var(--cyan); background: rgba(0, 209, 255, 0.05); border-color: rgba(0, 209, 255, 0.2); }
.nav-btn.active { color: var(--cyan); border-color: var(--cyan); background: rgba(0, 209, 255, 0.1); box-shadow: inset 0 0 10px rgba(0, 209, 255, 0.2); }
.nav-btn.disabled-future { color: var(--text-muted); cursor: not-allowed; }

/* ==========================================================================
   4. CONTENEDOR PRINCIPAL
   ========================================================================= */
.main-portal-container { 
    margin-top: calc(var(--topbar-height) + var(--header-height) + var(--navbar-height)); 
    padding: 20px; 
    box-sizing: border-box; 
    min-height: calc(100vh - (var(--topbar-height) + var(--header-height) + var(--navbar-height)));
}

.mu-dashboard-grid { 
    display: grid; 
    grid-template-columns: 320px 1fr 320px; 
    gap: 20px; 
    align-items: start;
}

.mu-sidebar-left, .mu-sidebar-right { display: flex; flex-direction: column; gap: 20px; }
.mu-card { background-color: var(--bg-card); border-radius: 8px; overflow: hidden; position: relative; transition: 0.3s; box-shadow: 0 4px 10px rgba(0,0,0,0.3); }
.card-header { padding: 12px; font-weight: 900; font-size: 14px; color: #fff; text-transform: uppercase; letter-spacing: 1px; }
.card-header h4 { margin: 0; text-align: center; display: flex; align-items: center; justify-content: center; gap: 8px; }
.card-content { padding: 15px; }

/* Cuenta y Botones */
.user-panel-small { text-align: center; }
.user-welcome { margin: 0 0 10px 0; color: #fff; font-size: 13px; }
.user-name-big { color: var(--green); font-weight: 900; font-size: 16px; text-shadow: 0 0 10px rgba(0, 230, 118, 0.4); }
.btn-logout-main { display: inline-block; padding: 10px 20px; background: rgba(255, 76, 76, 0.1); color: var(--red); border: 2px solid var(--red); border-radius: 4px; text-decoration: none; font-weight: bold; font-size: 11px; text-transform: uppercase; margin-top: 5px; transition: 0.3s; }
.btn-logout-main:hover { background: var(--red); color: #fff; box-shadow: 0 0 15px rgba(255, 76, 76, 0.6); }

/* Emergencias Rápidas */
.emergencies-quickpanel { display: grid; grid-template-columns: 1fr; gap: 10px; }
.mu-btn-emergency { text-decoration: none; background: rgba(28, 46, 79, 0.4); border: 2px solid var(--border-color); color: var(--text-muted); padding: 15px; border-radius: 8px; text-align: center; font-weight: 900; font-size: 20px; line-height: 1.2; text-transform: uppercase; transition: 0.3s; cursor: pointer; }
.mu-btn-emergency small { font-size: 10px; font-weight: bold; opacity: 0.7; }
.mu-btn-emergency:hover { border-color: #fff; color: #fff; transform: translateY(-3px); }
.police-glow:hover { box-shadow: 0 0 15px rgba(255,255,255,0.2); }
.ambulance-glow:hover { box-shadow: 0 0 15px rgba(0, 230, 118, 0.2); border-color: var(--green); color: var(--green); }
.fire-glow:hover { box-shadow: 0 0 15px rgba(255, 76, 76, 0.2); border-color: var(--red); color: var(--red); }

/* Mapa y Ubicación */
.mu-map-section { position: relative; width: 100%; }
#btn-ubicacion { position: absolute; bottom: 20px; right: 20px; z-index: 1000; padding: 10px 18px; background: rgba(7, 11, 19, 0.9); color: var(--cyan); border: 2px solid var(--cyan); border-radius: 4px; cursor: pointer; font-weight: 900; font-size: 12px; text-transform: uppercase; transition: 0.3s; display: flex; align-items: center; gap: 8px; box-shadow: 0 4px 10px rgba(0,0,0,0.5); }
#btn-ubicacion:hover { background: var(--cyan); color: #fff; box-shadow: 0 0 15px rgba(0, 209, 255, 0.6); }

/* Filtros y Lista */
.mu-input-search { width: 100%; padding: 12px; background-color: var(--bg-dark); color: #fff; border: 1px solid var(--border-color); border-radius: 4px; outline: none; font-weight: bold; font-size: 13px; box-sizing: border-box; }
.mu-input-search:focus { border-color: var(--cyan); box-shadow: 0 0 8px rgba(0, 209, 255, 0.5); }
.mu-list-scrollbar { max-height: 400px; overflow-y: auto; padding-right: 5px; }

/* Bordes y Brillos */
.neon-border-cyan { border: 2px solid var(--cyan); box-shadow: 0 0 10px rgba(0, 209, 255, 0.1); }
.neon-border-red { border: 2px solid var(--red); box-shadow: 0 0 10px rgba(255, 76, 76, 0.1); }
.cyan-glow { background: rgba(0, 209, 255, 0.15); border-bottom: 1px solid var(--cyan); }
.red-glow { background: rgba(255, 76, 76, 0.15); border-bottom: 1px solid var(--red); }

@keyframes rumor { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.1); } }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-dark); border-radius: 4px; }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #41526d; }


/* ==========================================================================
   5. MODO RESPONSIVE (CELULARES Y TABLETS)
   ========================================================================== */
@media (max-width: 1024px) {
    /* Apilar las columnas en dispositivos pequeños */
    .mu-dashboard-grid { 
        grid-template-columns: 1fr; 
    }
    
    /* Reacomodar el Header */
    .portal-header {
        height: auto;
        padding: 10px 0;
        position: relative; /* Lo sacamos de fixed para que fluya natural */
        top: 0;
        margin-top: var(--topbar-height);
    }
    
    .header-main-container {
        flex-direction: column;
        gap: 15px;
        text-align: center;
        padding: 10px;
    }
    
    .logo-link {
        justify-content: center;
    }

    .brand-title-full {
        margin-top: 0;
    }

    .portal-title {
        font-size: 20px;
    }

    .user-logged-nav {
        justify-content: center;
        width: 100%;
    }

    /* Reacomodar la barra de navegación */
    .portal-navbar {
        position: relative;
        top: 0;
        height: auto;
        padding: 15px 10px;
    }

    .navbar-container {
        flex-wrap: wrap;
        gap: 10px;
    }

    .nav-btn {
        width: 100%;
        justify-content: center;
    }

    /* Ajustar el contenedor principal */
    .main-portal-container {
        margin-top: 0; /* Ya no hace falta el margen porque los headers no son fijos */
        padding: 10px;
    }

    /* Ajustar la lista de emergencias a horizontal si queremos ahorrar espacio (opcional) */
    .emergencies-quickpanel {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .mu-btn-emergency {
        padding: 10px;
        font-size: 16px;
    }
}