/* ==========================================================
   CONFERENZA ITALIA - YSF REFLECTOR DASHBOARD
   Restyling grafico - nessuna modifica alla logica PHP
   ========================================================== */

:root {
    --bg: #07111f;
    --panel: #0d1b2d;
    --panel2: #10243b;
    --border: #1e5275;
    --text: #edf6ff;
    --muted: #9eb3c7;
    --cyan: #00d9ff;
    --green: #19df87;
    --purple: #b45cff;
    --gold: #ffc928;
}

html, body {
    background:
        radial-gradient(circle at 15% 0%, #12365b 0, transparent 32%),
        radial-gradient(circle at 90% 10%, #16295c 0, transparent 28%),
        linear-gradient(135deg, #050b14, #081525 55%, #050c16);
    background-attachment: fixed;
    color: var(--text);
    min-height: 100%;
}

body {
    font-family: "Segoe UI", Arial, sans-serif;
}

/* HEADER */
.navbar.bg-dark {
    background: linear-gradient(90deg,#071426,#10335a,#071426) !important;
    border-bottom: 2px solid #168fd1;
    box-shadow: 0 4px 22px rgba(0,0,0,.45);
    padding: 18px 22px;
}

.navbar-brand {
    color: white !important;
    font-size: 21px;
    font-weight: 700;
    letter-spacing: .3px;
    white-space: normal;
}

.navbar-brand:before {
    content: "📡  ";
}

/* linea tricolore */
.navbar:after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -5px;
    width: 100%;
    height: 3px;
    background: linear-gradient(
        90deg,
        #009246 0 33.33%,
        #ffffff 33.33% 66.66%,
        #ce2b37 66.66% 100%
    );
}

/* CONTENITORE */
.container-fluid {
    padding: 18px 22px;
}

/* CARD */
.card {
    background: linear-gradient(145deg,var(--panel),var(--panel2));
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 13px;
    overflow: hidden;
    box-shadow: 0 7px 22px rgba(0,0,0,.30);
    margin-bottom: 18px;
}

.card-header {
    background: linear-gradient(90deg,#12457a,#173269);
    color: #fff;
    border-bottom: 1px solid #2675a8;
    font-weight: 700;
    font-size: 18px;
    padding: 13px 17px;
}

.card-body {
    background: transparent;
    color: var(--text);
}

/* prima zona TX */
.container-fluid > .row:first-of-type .card {
    border-color: #1778b5;
}

/* TITOLI */
h1,h2,h3,h4,h5,h6 {
    color: #fff;
}

h3.text-center {
    color: #fff;
    font-weight: 800;
    text-shadow: 0 0 18px rgba(0,217,255,.45);
}

/* TABELLE */
table,
table.dataTable {
    color: #eaf4ff !important;
    background: transparent !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
}

table thead th,
table.dataTable thead th {
    color: #fff !important;
    background: #10253d !important;
    border-bottom: 1px solid #28618a !important;
    padding: 12px !important;
}

table tbody td,
table.dataTable tbody td {
    color: #dcecff !important;
    background: rgba(10,25,43,.88) !important;
    border-top: 1px solid rgba(74,113,145,.28) !important;
    padding: 10px 12px !important;
}

table tbody tr:nth-child(even) td,
table.dataTable tbody tr:nth-child(even) td {
    background: rgba(16,39,63,.92) !important;
}

table tbody tr:hover td,
table.dataTable tbody tr:hover td {
    background: #163d60 !important;
}

/* DataTables */
.dataTables_wrapper,
.dataTables_info,
.dataTables_length,
.dataTables_filter {
    color: var(--muted) !important;
}

.dataTables_wrapper select,
.dataTables_wrapper input {
    background: #081725 !important;
    color: white !important;
    border: 1px solid #39769d !important;
    border-radius: 6px;
    padding: 5px 8px;
}

/* link */
a {
    color: #42cfff;
}

a:hover {
    color: #8be6ff;
}

/* barre progress */
.progress {
    background: #24364a;
    height: 17px;
    border-radius: 20px;
    overflow: hidden;
}

.progress-bar {
    background: linear-gradient(90deg,#00b96b,#1ee88e);
}

/* logo */
#Logo {
    display: flex;
    align-items: center;
    justify-content: center;
}

#Logo img {
    background: #0d1b2d !important;
    border: 1px solid #2786ba !important;
    box-shadow: 0 5px 22px rgba(0,0,0,.45) !important;
}

/* footer */
body > .card:last-of-type {
    margin: 15px 22px 25px;
    color: #8faac0;
    font-size: 13px;
}

/* scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #06101c;
}

::-webkit-scrollbar-thumb {
    background: #245b80;
    border-radius: 10px;
}

/* responsive */
@media (max-width: 900px) {
    .navbar-brand {
        font-size: 16px;
    }

    .container-fluid {
        padding: 12px;
    }

    #Logo img {
        max-width: 100%;
        height: auto;
    }
}


/* ==========================================================
   TESTATA CONFERENZA ITALIA
   ========================================================== */

.ci-brand {
    display: flex !important;
    flex-direction: column;
    align-items: flex-start;
    text-decoration: none !important;
    line-height: 1.15;
}

.ci-brand:before {
    content: "📡";
    position: absolute;
    margin-left: -38px;
    margin-top: 7px;
    font-size: 27px;
}

.ci-brand-main {
    display: block;
    font-size: 29px;
    font-weight: 800;
    letter-spacing: 1.5px;
    color: #ffffff;
    text-shadow:
        0 0 10px rgba(0,217,255,.20),
        0 2px 5px rgba(0,0,0,.45);
}

.ci-brand-sub {
    display: block;
    margin-top: 7px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 2px;
    color: #93dfff;
}

.ci-reflector-box {
    width: 100%;
    min-height: 150px;
    border: 1px solid #2687bd;
    border-radius: 14px;
    background:
        radial-gradient(circle at 50% 0%, rgba(0,217,255,.18), transparent 55%),
        linear-gradient(145deg,#0c2138,#0a1728);
    box-shadow:
        0 8px 24px rgba(0,0,0,.35),
        inset 0 0 20px rgba(0,140,220,.08);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 14px 10px;
    text-align: center;
}

.ci-reflector-icon {
    font-size: 28px;
    line-height: 1;
    margin-bottom: 5px;
}

.ci-reflector-small {
    color: #8fdcff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
}

.ci-reflector-number {
    color: #ffffff;
    font-size: 30px;
    font-weight: 800;
    line-height: 1.1;
    margin-top: 3px;
}

.ci-reflector-name {
    color: #19df87;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .8px;
    margin-top: 5px;
}

/* disattiva la vecchia icona automatica per evitare doppione */
.navbar-brand:not(.ci-brand):before {
    content: "";
}

@media (max-width: 900px) {
    .ci-brand-main {
        font-size: 21px;
    }

    .ci-brand-sub {
        font-size: 10px;
        letter-spacing: 1px;
    }

    .ci-reflector-box {
        min-height: 120px;
    }
}


/* ==========================================================
   YSF 22890 - RESPONSIVE SMARTPHONE DEFINITIVO
   Solo grafica - nessuna modifica alla logica
   ========================================================== */

@media (max-width: 767px) {

    html,
    body {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    body {
        -webkit-text-size-adjust: 100%;
    }

    /* TESTATA */
    .navbar.bg-dark {
        padding: 12px 10px !important;
    }

    .navbar .container-fluid {
        padding: 0 8px !important;
    }

    .navbar-brand,
    .ci-brand {
        width: 100%;
        max-width: 100%;
        margin: 0 !important;
        padding-left: 35px;
        white-space: normal !important;
    }

    .ci-brand:before {
        margin-left: -32px;
        margin-top: 4px;
        font-size: 23px;
    }

    .ci-brand-main {
        font-size: 20px !important;
        letter-spacing: .6px;
        line-height: 1.15;
    }

    .ci-brand-sub {
        font-size: 9px !important;
        letter-spacing: .5px !important;
        line-height: 1.45;
        margin-top: 5px;
        overflow-wrap: anywhere;
    }

    /* CONTENITORE GENERALE */
    body > .container-fluid,
    .container-fluid {
        width: 100%;
        max-width: 100%;
        padding: 8px !important;
    }

    /*
       La prima riga usa col-10 + col-2.
       Sul telefono diventano due blocchi verticali.
    */
    .container-fluid > .row:first-of-type {
        display: flex;
        flex-direction: column;
        margin-left: 0;
        margin-right: 0;
    }

    .container-fluid > .row:first-of-type > .col-10,
    .container-fluid > .row:first-of-type > .col-2 {
        flex: 0 0 100% !important;
        width: 100% !important;
        max-width: 100% !important;
        padding-left: 0;
        padding-right: 0;
    }

    #Logo {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
        margin-top: 8px;
    }

    #Logo img {
        display: block;
        max-width: 100% !important;
        height: auto !important;
        margin: 0 auto;
    }

    /* BOX YSF 22890 */
    .ci-reflector-box {
        width: 100%;
        min-height: 100px !important;
        padding: 10px 8px;
        margin: 0;
    }

    .ci-reflector-icon {
        font-size: 23px;
    }

    .ci-reflector-small {
        font-size: 10px;
    }

    .ci-reflector-number {
        font-size: 26px;
    }

    .ci-reflector-name {
        font-size: 12px;
    }

    /* ALTRE ROW BOOTSTRAP */
    .container-fluid > .row {
        margin-left: 0;
        margin-right: 0;
    }

    .container-fluid > .row > .col,
    .container-fluid > .row > [class*="col-"] {
        min-width: 0;
    }

    /*
       Le colonne generiche della zona dashboard
       diventano verticali su smartphone.
    */
    .container-fluid > .row:not(:first-of-type) {
        display: flex;
        flex-direction: column;
    }

    .container-fluid > .row:not(:first-of-type) > .col {
        width: 100%;
        max-width: 100%;
        flex: 0 0 100%;
        padding-left: 0;
        padding-right: 0;
    }

    /* CARD */
    .card {
        width: 100%;
        max-width: 100%;
        margin-bottom: 10px;
        border-radius: 10px;
    }

    .card-header {
        padding: 10px 9px;
        font-size: 15px;
        line-height: 1.25;
        overflow-wrap: anywhere;
    }

    .card-body {
        padding: 9px !important;
        min-width: 0;
    }

    h3.text-center {
        font-size: 18px;
        line-height: 1.25;
    }

    /* TABELLE */
    .table-responsive,
    .dataTables_wrapper {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    table,
    table.dataTable {
        width: 100% !important;
        min-width: 580px;
        font-size: 12px;
    }

    table thead th,
    table.dataTable thead th {
        padding: 8px 7px !important;
        white-space: nowrap;
    }

    table tbody td,
    table.dataTable tbody td {
        padding: 8px 7px !important;
        white-space: nowrap;
    }

    /* DATATABLE CONTROLLI */
    .dataTables_length,
    .dataTables_filter,
    .dataTables_info,
    .dataTables_paginate {
        width: 100% !important;
        float: none !important;
        text-align: left !important;
        margin: 6px 0;
    }

    .dataTables_filter input {
        max-width: 170px;
    }

    /* FOOTER */
    body > .card:last-of-type {
        margin: 10px 8px 16px !important;
    }
}


/* TELEFONI PICCOLI */
@media (max-width: 420px) {

    .ci-brand-main {
        font-size: 18px !important;
    }

    .ci-brand-sub {
        font-size: 8px !important;
    }

    .ci-reflector-number {
        font-size: 23px;
    }

    .card-header {
        font-size: 14px;
    }

    table,
    table.dataTable {
        min-width: 520px;
        font-size: 11px;
    }
}



/* ==========================================================
   YSF MOBILE TABLE CARDS DEFINITIVE
   Solo smartphone - desktop invariato
   ========================================================== */

@media (max-width:767px) {

    /*
       Annulla la larghezza minima mobile precedente
    */
    #currtx,
    #lh,
    #gateways,
    #diskuse {
        min-width:0 !important;
        width:100% !important;
        max-width:100% !important;
    }

    /*
       CURRENTLY TXING + LAST HEARD
    */
    #currtx,
    #lh {
        display:block !important;
        border:0 !important;
    }

    #currtx thead,
    #lh thead {
        display:none !important;
    }

    #currtx tbody,
    #lh tbody {
        display:block !important;
        width:100% !important;
    }

    #currtx tbody tr,
    #lh tbody tr {
        display:block !important;
        width:100% !important;
        margin:0 0 10px 0 !important;
        padding:7px !important;
        border:1px solid #b7c4d0 !important;
        border-radius:9px !important;
        background:#f7f9fb !important;
        box-shadow:0 2px 6px rgba(0,0,0,.10);
    }

    #currtx tbody td,
    #lh tbody td {
        display:flex !important;
        width:100% !important;
        max-width:100% !important;
        min-width:0 !important;
        justify-content:space-between;
        align-items:center;
        gap:10px;
        padding:7px 5px !important;
        border:0 !important;
        border-bottom:1px solid #dde3e8 !important;
        white-space:normal !important;
        overflow-wrap:anywhere;
        text-align:right !important;
        font-size:12px !important;
    }

    #currtx tbody td:last-child,
    #lh tbody td:last-child {
        border-bottom:0 !important;
    }

    #currtx tbody td::before,
    #lh tbody td::before {
        flex:0 0 88px;
        text-align:left;
        color:#245b89;
        font-weight:700;
        white-space:nowrap;
    }

    /* Currently TXing */
    #currtx td:nth-child(1)::before { content:"Time"; }
    #currtx td:nth-child(2)::before { content:"Callsign"; }
    #currtx td:nth-child(3)::before { content:"Target"; }
    #currtx td:nth-child(4)::before { content:"Gateway"; }
    #currtx td:nth-child(5)::before { content:"TX-Time"; }

    /* Last Heard */
    #lh td:nth-child(1)::before { content:"Time"; }
    #lh td:nth-child(2)::before { content:"Callsign"; }
    #lh td:nth-child(3)::before { content:"Target"; }
    #lh td:nth-child(4)::before { content:"Gateway"; }
    #lh td:nth-child(5)::before { content:"Dur (s)"; }


    /*
       CONNECTED YSF GATEWAYS
       Due sole colonne: scheda compatta
    */
    #gateways {
        display:block !important;
    }

    #gateways thead {
        display:none !important;
    }

    #gateways tbody {
        display:block !important;
        width:100% !important;
    }

    #gateways tbody tr {
        display:block !important;
        width:100% !important;
        margin-bottom:8px !important;
        padding:6px !important;
        border:1px solid #b7c4d0 !important;
        border-radius:8px !important;
        background:#f7f9fb !important;
    }

    #gateways tbody td {
        display:flex !important;
        width:100% !important;
        justify-content:space-between;
        gap:10px;
        padding:6px 4px !important;
        border:0 !important;
        border-bottom:1px solid #dde3e8 !important;
        white-space:normal !important;
        text-align:right !important;
        font-size:12px !important;
    }

    #gateways tbody td:last-child {
        border-bottom:0 !important;
    }

    #gateways td::before {
        flex:0 0 115px;
        text-align:left;
        color:#245b89;
        font-weight:700;
    }

    #gateways td:nth-child(1)::before {
        content:"Reporting Time";
    }

    #gateways td:nth-child(2)::before {
        content:"Callsign";
    }


    /*
       DISK USE
    */
    #diskuse {
        display:block !important;
    }

    #diskuse thead {
        display:none !important;
    }

    #diskuse tbody {
        display:block !important;
        width:100% !important;
    }

    #diskuse tbody tr {
        display:block !important;
        width:100% !important;
        margin-bottom:9px !important;
        padding:6px !important;
        border:1px solid #b7c4d0 !important;
        border-radius:8px !important;
        background:#f7f9fb !important;
    }

    #diskuse tbody td {
        display:flex !important;
        width:100% !important;
        justify-content:space-between;
        gap:10px;
        padding:6px 4px !important;
        border:0 !important;
        border-bottom:1px solid #dde3e8 !important;
        white-space:normal !important;
        overflow-wrap:anywhere;
        text-align:right !important;
        font-size:12px !important;
    }

    #diskuse tbody td:last-child {
        border-bottom:0 !important;
    }

    #diskuse td::before {
        flex:0 0 80px;
        text-align:left;
        color:#245b89;
        font-weight:700;
    }

    #diskuse td:nth-child(1)::before { content:"Filesystem"; }
    #diskuse td:nth-child(2)::before { content:"Mount"; }
    #diskuse td:nth-child(3)::before { content:"Use"; }
    #diskuse td:nth-child(4)::before { content:"Free"; }
    #diskuse td:nth-child(5)::before { content:"Used"; }
    #diskuse td:nth-child(6)::before { content:"Total"; }


    /*
       Link e valori lunghi
    */
    #currtx a,
    #lh a,
    #gateways a,
    #diskuse a {
        overflow-wrap:anywhere;
        word-break:break-word;
    }
}

@media (max-width:420px) {

    #currtx tbody td::before,
    #lh tbody td::before {
        flex-basis:76px;
    }

    #gateways td::before {
        flex-basis:105px;
    }
}

