/* ================= BASE ================= */
*{
    box-sizing:border-box;
}

body{
    margin:0;
    font-family:'Raleway', system-ui;
    color:#e5e7eb;

    background:
    linear-gradient(rgba(5,10,20,.85), rgba(5,10,20,.95)),
    url('./bg-ysf.jpg');

    background-size:cover;
    background-position:center;
    background-attachment:fixed;
}

.container-fluid{
    padding-left:15px;
    padding-right:15px;
}

/* TITULO */
h2{
    text-align:center;
    color:#67e8f9;
    margin:20px 0;
    text-shadow:0 0 6px rgba(103,232,249,.4);
}

/* ================= BLOQUES ================= */
.block{
    background:rgba(17,24,39,.65);
    backdrop-filter:blur(4px);
    border-radius:12px;
    padding:14px;
    margin-bottom:15px;

    box-shadow:
        0 0 12px rgba(0,255,255,.05),
        inset 0 0 8px rgba(255,255,255,.02);
}

/* TITULOS */
.block-title{
    font-size:14px;
    font-weight:300;
    color:#67e8f9;
    margin-bottom:10px;
}

/* ================= TABLAS ================= */
#activeDiv{
    overflow-x:auto;
}

table{
    width:100%;
    min-width:600px;
    background:transparent;
}

th{
    font-size:11px;
    color:#64748b;
    font-weight:400;
    text-align:center;
}

td{
    font-size:13px;
    text-align:center;
    border-bottom:1px solid rgba(255,255,255,.05);

    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
}

/* ================= CALLSIGN ================= */
.callsign{
    font-weight:700;
    color:#22d3ee;
    text-shadow:0 0 6px rgba(34,211,238,.4);
}

/* ================= FLAGS ================= */
.flag{
    width:18px;
    height:12px;
    margin-right:6px;
    vertical-align:middle;
    border-radius:2px;
}

/* ================= ACTIVE TX ================= */
.tx{
    color:#22c55e;
    font-weight:600;
    text-shadow:0 0 8px #22c55e;
    animation:pulse 1s infinite;
}

@keyframes pulse{
    0%{opacity:1}
    50%{opacity:.4}
    100%{opacity:1}
}

/* ================= LAST HEARD ================= */
.lh-header,
.lh-row{
    display:grid;
    grid-template-columns: 1.3fr 0.9fr 0.6fr 0.8fr 0.9fr 0.6fr 0.9fr;
    padding:4px 5px;
    text-align:center;
}

.lh-header{
    font-size:11px;
    color:#64748b;
    border-bottom:1px solid rgba(255,255,255,.08);
    margin-bottom:4px;
}

.lh-row{
    border-bottom:1px solid rgba(255,255,255,.04);
    transition:.2s;
}

.lh-row span{
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
}

.lh-call{
    text-align:left;
    color:#22d3ee;
    font-weight:700;
}

.lh-user{
    color:#38bdf8;
    font-size:12px;
    opacity:.9;
}

.lh-row:hover{
    background:rgba(34,211,238,.06);
    border-radius:6px;
    transform:translateX(2px);
}

/* ================= ONLINE ================= */
.on-header,
.on-row{
    display:grid;
    grid-template-columns: 1.5fr 0.6fr 1.2fr 0.6fr 1fr 0.8fr;
    padding:6px;
    align-items:center;
}

.on-header{
    font-size:11px;
    color:#64748b;
    border-bottom:1px solid rgba(255,255,255,.08);
}

.on-row{
    border-bottom:1px solid rgba(255,255,255,.04);
    transition:.2s;
}

.on-row span{
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
}

.on-call{
    color:#22d3ee;
    font-weight:700;
}

.on-status{
    color:#22c55e;
    font-weight:600;
}

.on-row:hover{
    background:rgba(59,130,246,.08);
    border-radius:6px;
}

/* ================= NO TX ================= */
.no-tx{
    text-align:center;
    opacity:.6;
    padding:10px;
}

/* ================= MENSAJES ================= */
.info-box{
    font-size:13px;
    line-height:1.6;
}

.msg{
    padding:6px 8px;
    margin-bottom:6px;
    background:rgba(255,255,255,.03);
    border-left:3px solid #22d3ee;
    border-radius:4px;
}

/* ================= FOOTER ================= */
.footer-pro{
    margin-top:20px;
    padding:20px;

    background:linear-gradient(180deg, rgba(0,0,0,.3), rgba(0,0,0,.6));
    border-top:1px solid rgba(255,255,255,.1);

    font-size:13px;
    color:#9ca3af;
}

.footer-grid{
    display:grid;
    grid-template-columns: repeat(4,1fr);
    gap:20px;
}

.footer-block{
    padding:10px;
}

.f-title{
    color:#67e8f9;
    font-size:12px;
    margin-bottom:6px;
}

.footer-buttons{
    text-align:center;
    margin-top:15px;
}

.footer-buttons a{
    margin:5px;
    padding:6px 12px;
    background:#1f2937;
    border-radius:6px;
    text-decoration:none;
    color:#e5e7eb;
    transition:.2s;
}

.footer-buttons a:hover{
    background:#374151;
}

.footer-signature{
    text-align:center;
    margin-top:15px;
    font-size:11px;
    opacity:.7;
}

.glow{
    color:#22d3ee;
    text-shadow:0 0 6px rgba(34,211,238,.6);
}

/* ================= GRID ================= */
.row{
    margin-left:-10px;
    margin-right:-10px;
}

.col-lg-4{
    padding-left:10px;
    padding-right:10px;
}

/* ================= RESPONSIVE ================= */
@media(max-width:768px){

    .lh-header{
        display:none;
    }

    .lh-row{
        grid-template-columns:1fr;
        text-align:left;
        gap:4px;
    }

    .lh-row span{
        display:block;
    }

    .on-header{
        display:none;
    }

    .on-row{
        grid-template-columns:1fr;
        gap:4px;
    }

    .footer-grid{
        grid-template-columns:1fr;
        text-align:center;
    }

    .col-lg-4{
        margin-bottom:12px;
    }
}






/* ================= TEXTO MÁS COMPACTO EN CARDS ================= */
.block{
    font-size:12px;
}

.block-title{
    font-size:13px;
}

table td{
    font-size:14px;
}

table th{
    font-size:12px;
}

#map{
    width:100%;
    height:250px;
    border-radius:8px;
}


/* ================= HEADER PRO FIX ================= */
.header-pro{
    display:flex;
    justify-content:space-between;
    align-items:center;

    width:100%;
    padding:15px 20px;
    margin-bottom:15px;

    background:rgba(17,24,39,.65);
    backdrop-filter:blur(6px);
    border-radius:12px;

    box-shadow:
        0 0 15px rgba(0,255,255,.05),
        inset 0 0 8px rgba(255,255,255,.02);
}

/* LEFT */
.header-left{
    display:flex;
    flex-direction:column;
}

.header-left h1{
    margin:0;
    font-size:20px;
    color:#67e8f9;
    text-shadow:0 0 10px rgba(103,232,249,.5);
}

.subtitle{
    font-size:12px;
    color:#94a3b8;
}

/* RIGHT */
.header-right{
    display:flex;
    align-items:center;
    gap:20px;
}

/* ON AIR */
.status-box{
    display:flex;
    align-items:center;
    gap:6px;
    font-size:13px;
    font-weight:600;
    color:#22c55e;
}

/* STATS */
.stats{
    display:flex;
    align-items:center;
    gap:12px;
}

.stats span{
    display:flex;
    align-items:center;
    gap:5px;
    font-size:14px;
}

/* SVG fix */
.status-box svg,
.stats svg{
    display:block;
}

/* RESPONSIVE */
@media(max-width:768px){
    .header-pro{
        flex-direction:column;
        align-items:flex-start;
        gap:10px;
    }

    .header-right{
        width:100%;
        justify-content:space-between;
    }
}



/* ================= HEADER CON LOGO ================= */
.header-pro{
    display:grid;
    grid-template-columns: 1fr auto 1fr;
    align-items:center;
}

/* CENTRO */
.header-center{
    display:flex;
    justify-content:center;
    align-items:center;
}

/* LOGO */
.header-logo{
    height:100px;
    max-width:180px;
    object-fit:contain;

    filter: drop-shadow(0 0 8px rgba(56,189,248,.4));
}

/* RESPONSIVE */
@media(max-width:768px){
    .header-pro{
        grid-template-columns:1fr;
        gap:10px;
        text-align:center;
    }

    .header-right{
        justify-content:center;
    }
}





/* ================= FIX FINAL HEADER ================= */
.header-pro{
    display:grid !important;
    grid-template-columns: 1fr auto 1fr;
    align-items:center;
}

/* POSICIONES */
.header-left{
    justify-self:start;
}

.header-center{
    justify-self:center;
}

.header-right{
    justify-self:end;
    display:flex;
    align-items:center;
    gap:20px;
}


/* ROOMS */
.room-row{
    display:flex;
    justify-content:space-between;
    padding:6px 8px;
    border-bottom:1px solid rgba(255,255,255,0.05);
    font-size:13px;
}

.room-dgid{
    color:#38bdf8;
    font-weight:600;
    width:40px;
}

.room-name{
    flex:1;
    color:#e2e8f0;
}

.room-users{
    color:#22c55e;
    font-weight:600;
}




/* ===== ROOMS ===== */

.rooms-header,
.room-row{
    display: grid;
    grid-template-columns: 80px 1fr 80px;
    align-items: center;
    text-align: center;
    padding: 8px 10px;
}

/* Header */
.rooms-header{
    font-weight: 600;
    border-bottom: 1px solid #333;
    color: #9ca3af;
}

/* Filas */
.room-row{
    border-bottom: 1px solid #1f2937;
    transition: 0.2s;
}

/* Hover */
.room-row:hover{
    background: #111827;
}

/* Activas */
.room-active{
    background: rgba(34,197,94,0.1);
    color: #22c55e;
    font-weight: 600;
}

/* Columnas específicas */
.room-dgid{
    font-weight: bold;
}

.room-name{
    text-align: center;
}

.room-users{
    font-weight: bold;
}

/* ================= PEANUT ================= */

/* Contador header */
#stat-peanut{
    display:flex;
    align-items:center;
    gap:5px;
    font-size:14px;
    color:#f59e0b; /* color peanut */
    transition:0.3s;
}

/* efecto suave */
#stat-peanut svg{
    filter: drop-shadow(0 0 4px rgba(245,158,11,.6));
}

/* cuando no hay usuarios */
#stat-peanut[style*="opacity: 0.4"]{
    filter: grayscale(60%);
}

/* ================= LISTADO PEANUT ================= */

#peanutDiv{
    font-size:13px;
}

/* header */
.peanut-header{
    display:grid;
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
    padding:6px;
    font-size:11px;
    color:#64748b;
    border-bottom:1px solid rgba(255,255,255,.08);
}

/* filas */
.peanut-row{
    display:grid;
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
    padding:6px;
    align-items:center;
    border-bottom:1px solid rgba(255,255,255,.04);
    transition:.2s;
}

/* hover */
.peanut-row:hover{
    background:rgba(245,158,11,.08);
    border-radius:6px;
}

/* callsign */
.peanut-call{
    color:#fbbf24;
    font-weight:700;
}

/* nombre */
.peanut-name{
    color:#fde68a;
    font-size:12px;
}

/* sala */
.peanut-room{
    color:#f59e0b;
    font-weight:600;
}

/* tiempo */
.peanut-time{
    color:#9ca3af;
    font-size:12px;
}


.on-call svg{
    margin-right:4px;
    vertical-align:middle;
}


#onlineDiv{
    max-height: 400px;   /* ajusta a tu gusto */
    overflow-y: auto;    /* activa scroll vertical */
    padding-right: 4px;  /* espacio para scrollbar */
}


/* ===== FIX FOOTER ABAJO SIN ROMPER NADA ===== */

html, body{
    min-height:100%;
}

.container-fluid{
    min-height:calc(100vh - 120px);
}



/* ===== FOOTER FULL WIDTH ALIGN ===== */
.footer-pro{
    width:100%;
}

/* fuerza alineación con grid principal */
.footer-grid{
    max-width:100%;
}

/* firma SIEMPRE centrada y alineada */
.footer-signature{
    text-align:center;
    width:100%;
    display:block;
}

/* ===== FOOTER COMPACTO ===== */
.footer-pro.small{
    padding:10px 12px;
    margin-bottom:10px;
}

/* grid más compacto */
.footer-pro.small .footer-grid{
    grid-template-columns: repeat(2,1fr);
    gap:10px;
}

/* texto más pequeño */
.footer-pro.small .f-title{
    font-size:11px;
}

.footer-pro.small{
    font-size:12px;
}

/* firma más discreta */
.footer-pro.small .footer-signature{
    font-size:10px;
    margin-top:8px;
    opacity:.6;
}