/* =========================================================
   SUPERENALOTTO UI THEME - "GLASS MA LEGGIBILE"
   Manopole in :root -> cambi qui e vedi tutto aggiornarsi.
   ========================================================= */

/* =========================
   0) MANOPOLE (TOKENS)
   ========================= */
:root {
    /* Background */
    --bg-base: #0b1220;

    /* Sfondo immagine */
    --bg-img-opacity: .55;
    /* <<< vuoi 0.50+? qui. (0.50–0.85) */
    --bg-img-saturate: .95;
    /* 0.6 più soft, 1.1 più vivace */
    --bg-img-contrast: 1.00;
    /* 0.9 più morbido, 1.05 più deciso */

    /* Overlay sopra lo sfondo (serve SEMPRE con opacity alta) */
    --bg-overlay-alpha: .42;
    /* 0.30 più “sfondo visibile”, 0.55 più leggibile */
    --bg-grad-1: rgba(88, 101, 242, .18);
    --bg-grad-2: rgba(34, 197, 94, .12);

    /* Testi */
    --text-primary: rgba(255, 255, 255, .94);
    --text-muted: rgba(255, 255, 255, .78);
    --text-subtle: rgba(255, 255, 255, .62);

    /* Font sizes (tutti in rem) */
    --fs-base: 1rem;
    /* testo normale */
    --fs-label: 0.98rem;
    /* label campi */
    --fs-small: 0.92rem;
    /* form-text / hint */
    --fs-table: 0.98rem;
    /* tabella */
    --fs-nav: 1.00rem;

    /* Glass cards */
    --card-alpha: .74;
    /* 0.70–0.85 (più alto = più leggibile) */
    --card-border-alpha: .18;
    --card-blur: 10px;

    /* Table */
    --table-head-bg: rgba(255, 255, 255, .10);
    --table-row-border: rgba(255, 255, 255, .16);
    --table-row-hover: rgba(255, 255, 255, .10);
    --table-striped: rgba(255, 255, 255, .07);

    /* Accento (bottoni focus) */
    --accent: rgba(88, 101, 242, .95);
    --accent-soft: rgba(88, 101, 242, .22);

    /* Navbar */
    --nav-bg: rgba(10, 14, 24, .94);
    --nav-border: rgba(255, 255, 255, .10);

    /* Radius / shadow */
    --radius: 16px;
    --shadow: 0 12px 30px rgba(0, 0, 0, .22);
}

/* =========================
   1) BASE + BACKGROUND FIXED
   ========================= */
html,
body {
    height: 100%;
    min-height: 100vh;
}

body {
    background: var(--bg-base);
    color: var(--text-primary);
    font-size: var(--fs-base);
}

/* Sfondo SEMPRE fullscreen, indipendente dall’altezza del body */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    background: url("sfondo.png") center/cover no-repeat;
    opacity: var(--bg-img-opacity);
    filter: saturate(var(--bg-img-saturate)) contrast(var(--bg-img-contrast));
    pointer-events: none;
    z-index: -2;
}

/* Overlay + gradient: è quello che ti salva la leggibilità */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    background:
        radial-gradient(1000px 520px at 12% 0%, var(--bg-grad-1), transparent 60%),
        radial-gradient(900px 480px at 90% 10%, var(--bg-grad-2), transparent 55%),
        rgba(11, 18, 32, var(--bg-overlay-alpha));
    pointer-events: none;
    z-index: -1;
}

/* =========================
   2) BOOTSTRAP OVERRIDES (testi “spenti”)
   ========================= */
/* Bootstrap 5.3 usa queste variabili per text-*-emphasis */
:root {
    --bs-body-color: var(--text-primary);
    --bs-secondary-color: var(--text-muted);
    --bs-tertiary-color: var(--text-subtle);

    --bs-secondary-color-rgb: 255, 255, 255;
    --bs-tertiary-color-rgb: 255, 255, 255;
}

/* forzatura per la combo che ti dava grigio morto */
.form-text.text-light-emphasis {
    color: var(--text-muted) !important;
    font-size: var(--fs-small);
}

/* =========================
   3) NAVBAR
   ========================= */
.navbar {
    background: var(--nav-bg) !important;
    border-bottom: 1px solid var(--nav-border) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.navbar .navbar-brand {
    color: rgba(255, 255, 255, .96) !important;
    font-weight: 800;
    font-size: 1.20rem;
}

.navbar .nav-link {
    color: rgba(255, 255, 255, .84) !important;
    font-weight: 650;
    font-size: var(--fs-nav);
}

.navbar .nav-link:hover {
    color: rgba(255, 255, 255, .98) !important;
}

/* =========================
   4) GLASS CARD
   ========================= */
.card-glass {
    background: rgba(20, 28, 48, var(--card-alpha)) !important;
    border: 1px solid rgba(255, 255, 255, var(--card-border-alpha));
    border-radius: var(--radius);
    backdrop-filter: blur(var(--card-blur));
    -webkit-backdrop-filter: blur(var(--card-blur));
    box-shadow: var(--shadow);
}

/* =========================
   5) LABEL + FORM CONTROLS
   ========================= */
.form-label {
    color: var(--text-primary);
    font-weight: 800;
    font-size: var(--fs-label);
    letter-spacing: .01em;
    margin-bottom: .35rem;
}

.form-text {
    color: var(--text-muted);
    font-size: var(--fs-small);
}

.form-control,
.form-select {
    background-color: rgba(255, 255, 255, .10);
    border-color: rgba(255, 255, 255, .22);
    color: rgba(0, 0, 0, .82);
    /* <<< su sfondo chiaro: testo nero leggibile */
}

.form-control::placeholder {
    color: rgba(0, 0, 0, .45);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 .25rem var(--accent-soft);
}

/* =========================
   6) TABLE (VISIBILE DAVVERO)
   ========================= */
.table {
    --bs-table-bg: transparent;
    --bs-table-striped-bg: var(--table-striped);
    --bs-table-hover-bg: var(--table-row-hover);
    color: var(--text-primary);
    font-size: var(--fs-table);
}

.table thead {
    background: var(--table-head-bg);
}

.table thead th {
    color: rgba(255, 255, 255, .96);
    font-weight: 900;
    border-bottom-color: var(--table-row-border) !important;
}

.table td,
.table th {
    border-top-color: var(--table-row-border) !important;
}

/* =========================
   7) BUTTONS
   ========================= */
.btn-primary {
    background: var(--accent);
    border-color: rgba(88, 101, 242, .98);
}

.btn-primary:hover {
    filter: brightness(1.05);
}

.btn-outline-light {
    border-color: rgba(255, 255, 255, .45);
    color: rgba(255, 255, 255, .92);
}

.btn-outline-light:hover {
    border-color: rgba(255, 255, 255, .65);
}

/* =========================
   8) UTILITY / LOADER
   ========================= */
#loadingBox {
    min-height: 260px;
}
/* =========================================
   FIX VISIBILITÀ: GLASS SCURO + CONTROLLI
   ========================================= */

/* Sfondo: tienilo pure alto ma l'overlay deve proteggere la UI */
:root {
    --bg-img-opacity: .70;
    /* puoi stare alto, ok */
    --bg-overlay-alpha: .62;
    /* ↑ più overlay = più leggibilità */
    --card-alpha: .78;
    /* card più “solida” */
    --card-border-alpha: .22;

    --text-primary: rgba(255, 255, 255, .94);
    --text-muted: rgba(255, 255, 255, .82);
    /* ↑ prima era troppo spento */
    --text-subtle: rgba(255, 255, 255, .72);

    --field-bg: rgba(20, 50, 126, 0.55);
    --field-border: rgba(255, 255, 255, .18);
    --field-text: rgba(255, 255, 255, .92);
    --field-placeholder: rgba(255, 255, 255, .55);

    --focus: rgba(120, 135, 255, .95);
    --focus-soft: rgba(120, 135, 255, .25);
}

/* Card più “app”, meno latte annacquato */
.card-glass {
    background: rgba(14, 20, 34, var(--card-alpha)) !important;
    border: 1px solid rgba(255, 255, 255, var(--card-border-alpha));
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* Label: belle presenti */
.form-label {
    color: var(--text-primary) !important;
    font-weight: 800;
}

/* Testi informativi (es: "Nessun risultato (ancora).") */
.text-light-emphasis,
.form-text.text-light-emphasis,
#top10Empty {
    color: var(--text-muted) !important;
    font-weight: 650;
}

/* Controlli: scuri e leggibili */
.form-control,
.form-select {
    background: var(--field-bg) !important;
    border-color: var(--field-border) !important;
    color: var(--field-text) !important;
}

/* Placeholder */
.form-control::placeholder {
    color: var(--field-placeholder) !important;
}

/* Focus: niente nero */
.form-control:focus,
.form-select:focus {
    border-color: var(--focus) !important;
    box-shadow: 0 0 0 .25rem var(--focus-soft) !important;
    background: rgba(57, 98, 192, 0.65) !important;
    color: var(--field-text) !important;
}

/* Fix specifico per input number su Chrome/Win (evita look “native” brutto) */
input[type="number"] {
    appearance: textfield;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Select: freccia visibile */
.form-select {
    background-image: var(--bs-form-select-bg-img) !important;
}

/* Tabella più leggibile su glass */
.table {
    color: var(--text-primary) !important;
}

.table thead {
    background: rgba(255, 255, 255, .08) !important;
}

.table thead th {
    color: rgba(255, 255, 255, .95) !important;
    border-bottom-color: rgba(255, 255, 255, .18) !important;
}

.table td,
.table th {
    border-top-color: rgba(190, 22, 22, 0.24) !important;
}
/* FIX: testo tabella Top10 leggibile su glass scuro */
#tblTop10,
#tblTop10 td,
#tblTop10 th {
    color: rgba(255, 255, 255, .94) !important;
}

/* opzionale: se Bootstrap insiste con variabili della table */
#tblTop10.table {
    --bs-table-color: rgba(255, 255, 255, .94);
    --bs-table-striped-color: rgba(255, 255, 255, .94);
    --bs-table-hover-color: rgba(255, 255, 255, .94);
}