/* ============================================================
   TEMA BLU SCURO - allseeyingeye2 area operatori
   v3 - 08/09/2026. Base navy come la barra menu (#1a1a2e -> #16213e).
   Strato aggiuntivo: attivo SOLO con <html class="theme-dark">.
   Non modifica main.css. Disattivare = rimuovere il <link> in index.php.
   PRINCIPIO: sfondi navy + testo chiaro; MA bolle chat e note restano
   CHIARE con testo SCURO (come nel tema chiaro), cosi' sono leggibili.
   ============================================================ */

/* --- sfondi principali (navy uguale al menu) --- */
html.theme-dark, html.theme-dark body { background:#16213e !important; color:#e6eaf5 !important; }
html.theme-dark .app-main__outer, html.theme-dark .app-main__inner,
html.theme-dark .app-main, html.theme-dark #pageContainer { background:#16213e !important; }

/* --- card / riquadri (navy un filo piu' chiaro) --- */
html.theme-dark .card, html.theme-dark .widget-content, html.theme-dark #noteCont,
html.theme-dark .call-card, html.theme-dark .call-card-header, html.theme-dark .call-card-body,
html.theme-dark .main-card, html.theme-dark .dropdown-menu {
    background:#1e2b4d !important; background-image:none !important;
    color:#e6eaf5 !important; border-color:#2c3a5e !important;
}
html.theme-dark .card, html.theme-dark .call-card { box-shadow:0 2px 14px rgba(0,0,0,0.4) !important; }

/* --- testo generico chiaro + titoli/nomi/timer che erano scuri --- */
html.theme-dark .text-muted, html.theme-dark .text-secondary { color:#9fb0d0 !important; }
html.theme-dark a { color:#8ea2ff; }
html.theme-dark h2.title, html.theme-dark .title,
html.theme-dark .call-card b, html.theme-dark .call-card-header b,
html.theme-dark .call-card-body, html.theme-dark .call-card-body *,
html.theme-dark .timeLeftCall,
html.theme-dark div.chatTab b, html.theme-dark div.chatTab label { color:#e6eaf5 !important; }

/* --- input / select / textarea / box anteprima / tab chat: navy scuro, testo chiaro --- */
html.theme-dark input[type="text"], html.theme-dark input[type="email"],
html.theme-dark input[type="password"], html.theme-dark input[type="number"],
html.theme-dark input[type="search"], html.theme-dark input.form-control,
html.theme-dark select, html.theme-dark textarea, html.theme-dark textarea.form-control,
html.theme-dark .msgBreakBox, html.theme-dark div.chatTab {
    background:#26335a !important; color:#e9ecf7 !important; border-color:#3a4a72 !important;
}
html.theme-dark div.chatTab.selected { background:#31406e !important; }
html.theme-dark ::placeholder { color:#8695b8 !important; }

/* === LE BOLLE CHAT restano CHIARE (blu/rosa) ma con TESTO SCURO === */
html.theme-dark div.chatMessage, html.theme-dark div.chatMessage *,
html.theme-dark div.chatLeftMessage, html.theme-dark div.chatLeftMessage *,
html.theme-dark div.chatRightMessage, html.theme-dark div.chatRightMessage * { color:#1e2438 !important; }

/* === LE NOTE LATERALI: sfondo chiaro netto + testo scuro (erano invisibili) === */
html.theme-dark .noteWrapper { background:#e8ecf7 !important; border-color:#c9d2e8 !important; }
html.theme-dark .noteWrapper, html.theme-dark .noteWrapper * { color:#1e2438 !important; }
html.theme-dark .noteInfo, html.theme-dark b.noteInfo { color:#5a6785 !important; }
html.theme-dark #noteUtente1 *, html.theme-dark #noteUtente2 *, html.theme-dark #noteUtente3 * { color:#1e2438 !important; }

/* --- tabelle --- */
html.theme-dark .table, html.theme-dark table { color:#e6eaf5 !important; }
html.theme-dark .table td, html.theme-dark .table th,
html.theme-dark table td, html.theme-dark table th { border-color:#2c3a5e !important; }
html.theme-dark .table-striped tbody tr:nth-of-type(odd),
html.theme-dark .table-hover tbody tr:hover { background:rgba(255,255,255,0.04) !important; }
html.theme-dark thead th, html.theme-dark .thead-dark th { background:#26335a !important; color:#e6eaf5 !important; }

/* --- bordi / hr / utility bianche --- */
html.theme-dark hr { border-color:#2c3a5e !important; }
html.theme-dark .bg-white, html.theme-dark .bg-light { background:#1e2b4d !important; color:#e6eaf5 !important; }
html.theme-dark .btn-light, html.theme-dark .btn-outline-secondary { background:#26335a !important; color:#e6eaf5 !important; border-color:#3a4a72 !important; }

/* --- BANNER GIALLO: giallo chiaro + testo SCURO --- */
html.theme-dark [style*="fff8e1"] { color:#5a4a10 !important; }
html.theme-dark [style*="fff8e1"] b, html.theme-dark [style*="fff8e1"] span, html.theme-dark [style*="fff8e1"] div { color:#5a4a10 !important; }

/* NON tocco i pulsanti colorati (btn-success/warning/danger/primary): restano coi loro colori. */

/* ============================================================
   RIFINITURE NOTTE v4 (08/09/2026): scrollbar, area messaggi, bolle
   ============================================================ */
/* scrollbar scure ovunque */
html.theme-dark ::-webkit-scrollbar { width:10px; height:10px; }
html.theme-dark ::-webkit-scrollbar-track { background:#16213e; }
html.theme-dark ::-webkit-scrollbar-thumb { background:#3a4a72; border-radius:6px; }
html.theme-dark ::-webkit-scrollbar-thumb:hover { background:#4a5a86; }

/* area messaggi della conversazione: navy dedicato per far staccare le bolle */
html.theme-dark #messagesCont, html.theme-dark #messageCont { background:#182444 !important; }

/* bolle piu' armoniose col navy (tinte piene morbide) + testo scuro (gia' impostato sopra) */
html.theme-dark div.chatLeftMessage { background:#d5e3f2 !important; background-image:none !important; }
html.theme-dark div.chatRightMessage { background:#efd6dc !important; background-image:none !important; }

/* separatori data/ora nella conversazione: grigio-azzurro leggibile */
html.theme-dark #messagesCont a, html.theme-dark #messageCont a,
html.theme-dark #messagesCont u, html.theme-dark #messageCont u { color:#9fb0d0 !important; }

/* card chiamate: bordo accento morbido per rifinire */
html.theme-dark .call-card { border:1px solid #2c3a5e !important; }

/* la barra viola "RISPONDI COME": lascio il gradiente, va bene sul navy */

/* --- PULSANTE FLOTTANTE luna/sole --- */
#themeToggleBtn{ position:fixed; right:18px; bottom:18px; z-index:99999;
    width:48px; height:48px; border-radius:50%; border:none; cursor:pointer;
    background:linear-gradient(135deg,#667eea,#764ba2); color:#fff;
    font-size:20px; line-height:48px; text-align:center;
    box-shadow:0 4px 16px rgba(0,0,0,0.35); transition:transform .15s; }
#themeToggleBtn:hover{ transform:scale(1.08); }
#themeToggleBtn:active{ transform:scale(0.96); }
