/**
 * ============================================================
 * ClubPromoter AI — Stile Ottimizzato per Uso Notturno
 * ============================================================
 * Palette: grigi freddi (Shadow Grey → Bright Snow).
 * Progettato per PR che lavorano di notte con cellulare al buio.
 * Font grandi, font-weight alto, contrasto morbido, zero neon.
 * Accenti: ambra caldo e teal tenue per non affaticare gli occhi.
 */

/* ── Variabili CSS ──────────────────────────────────────────── */
:root {
    /* Palette Inspired by DICE.fm */
    --shadow-grey:    #121212;
    --gunmetal:       #181818;
    --iron-grey:      #222222;
    --slate-grey:     #6c757d;
    --pale-slate:     #adb5bd;
    --pale-slate-lt:  #ced4da;
    --alabaster:      #dee2e6;
    --platinum:       #e9ecef;
    --bright-snow:    #ffffff;

    /* Accenti High Contrast */
    --accent:         #ffed00;   /* Giallo vibrancy massima */
    --accent-hover:   #e6d500;
    --accent-soft:    #333000;
    --teal:           #00e676;   /* Verde elettrico (successo) */
    --teal-soft:      #002e18;
    --coral:          #ff3d00;   /* Rosso elettrico (erore) */
    --coral-soft:     #330c00;
    --warn:           #ffed00;

    /* Superfici Stark Black/White */
    --bg-body:        #000000;
    --bg-card:        #0a0a0a;
    --bg-card-hover:  #141414;
    --bg-input:       #141414;
    --border:         #333333;
    --border-focus:   #ffed00;

    /* Testo */
    --text-primary:   #ffffff;
    --text-secondary: #cccccc;
    --text-muted:     #888888;

    /* Niente ombre morbide, geometrie crude */
    --shadow:         none;
    --shadow-lg:      none;

    /* Bordi taglienti */
    --radius:         0px;
    --radius-sm:      0px;
    --radius-xs:      0px;

    /* Font */
    --font:           'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
}


/* ── Reset & Base ───────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: var(--font);
    background-color: var(--bg-body);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    letter-spacing: -0.3px;
    line-height: 1.3;
}


/* ── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-body);
}
::-webkit-scrollbar-thumb {
    background: var(--iron-grey);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--slate-grey);
}


/* ══════════════════════════════════════════════════════════════
   LOGIN PAGE
   ══════════════════════════════════════════════════════════════ */

.login-page {
    background: var(--bg-body);
}

/* Particelle di sfondo – molto sottili */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.particle {
    position: absolute;
    border-radius: 50%;
    opacity: 0;
    animation: float-particle 12s infinite ease-in-out;
}

@keyframes float-particle {
    0%   { transform: translateY(100vh) scale(0); opacity: 0; }
    10%  { opacity: 0.25; }
    90%  { opacity: 0.08; }
    100% { transform: translateY(-10vh) scale(1); opacity: 0; }
}

/* Card Login */
.login-card {
    width: 100%;
    max-width: 440px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2.5rem;
    box-shadow: var(--shadow-lg);
    position: relative;
    z-index: 1;
    animation: card-appear 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes card-appear {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Logo */
.logo-icon {
    width: 80px;
    height: 80px;
    border-radius: 0%;  /* Bordi squadrati */
    background: var(--accent); /* Logo a contrasto */
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: var(--bg-body); /* Icona scura su logo giallo */
    margin-bottom: 1.2rem;
}

.brand-title {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 0.3rem;
    color: var(--bright-snow);
}

.brand-subtitle {
    color: var(--slate-grey);
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 2.5px;
    text-transform: uppercase;
}

.text-accent {
    color: var(--accent) !important;
}


/* ══════════════════════════════════════════════════════════════
   FORM ELEMENTS — grandi e leggibili
   ══════════════════════════════════════════════════════════════ */

.form-label {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--pale-slate);
    letter-spacing: 0.2px;
    margin-bottom: 0.45rem;
}

.form-control, .form-select {
    background-color: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    padding: 0.8rem 1rem;
    font-family: var(--font);
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.25s ease;
}

.form-control:focus, .form-select:focus {
    background-color: var(--bg-card-hover);
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
    color: var(--bright-snow);
}

.form-control::placeholder {
    color: var(--slate-grey);
    font-weight: 400;
}

.input-group-text {
    background-color: var(--gunmetal);
    border: 1px solid var(--border);
    color: var(--accent);
    font-size: 1.05rem;
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.form-text {
    color: var(--slate-grey);
    font-size: 0.85rem;
    font-weight: 400;
}


/* ══════════════════════════════════════════════════════════════
   BUTTONS — touch-friendly, visibili al buio
   ══════════════════════════════════════════════════════════════ */

.btn-neon {
    background: var(--accent);
    border: none;
    color: #000000;
    font-weight: 800;
    font-size: 1.05rem;
    padding: 0.85rem 1.6rem;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    transition: all 0.2s ease;
    min-height: 50px;
}

.btn-neon:hover {
    background: var(--accent-hover);
    color: #000000;
}

.btn-neon:active {
    background: #ccbe00;
}

.btn-outline-accent {
    border: 1.5px solid var(--accent);
    color: var(--accent);
    background: transparent;
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: var(--radius-sm);
    padding: 0.6rem 1.2rem;
    transition: all 0.25s ease;
}

.btn-outline-accent:hover {
    background: var(--accent-soft);
    color: var(--accent-hover);
}

.btn-outline-light {
    border-color: var(--iron-grey) !important;
    color: var(--pale-slate) !important;
    font-weight: 600;
}

.btn-outline-light:hover {
    background: rgba(255,255,255,0.05) !important;
    color: var(--bright-snow) !important;
}

/* Pulsanti piccoli tabella — touch-friendly */
.btn-sm {
    min-width: 40px;
    min-height: 38px;
    font-size: 1rem;
}


/* ══════════════════════════════════════════════════════════════
   NAVBAR
   ══════════════════════════════════════════════════════════════ */

.navbar {
    background: rgba(26, 29, 33, 0.95) !important;
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 0.85rem 1rem;
}

.navbar-brand {
    font-size: 1.3rem;
    font-weight: 700;
}

.nav-link {
    font-weight: 600;
    font-size: 1rem;
    padding: 0.55rem 1rem !important;
    border-radius: var(--radius-sm);
    transition: all 0.25s ease;
    color: var(--pale-slate) !important;
}

.nav-link:hover {
    color: var(--accent) !important;
    background: var(--accent-soft);
}

.nav-link.active {
    color: var(--accent) !important;
    background: var(--accent-soft);
}

.nav-link.text-danger {
    color: var(--coral) !important;
}
.nav-link.text-danger:hover {
    background: var(--coral-soft);
}


/* ══════════════════════════════════════════════════════════════
   CARDS
   ══════════════════════════════════════════════════════════════ */

.glass-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.glass-card:hover {
    border-color: #555555;
}

.glass-card .card-header {
    background: #000000;
    border-bottom: 2px solid var(--border);
    padding: 1.2rem 1.5rem;
    border-radius: var(--radius) var(--radius) 0 0;
}

.glass-card .card-header h5 {
    font-weight: 700;
    font-size: 1.15rem;
}

.glass-card .card-body {
    padding: 1.5rem;
}

.glass-card .card-footer {
    background: rgba(255, 255, 255, 0.015);
    border-top: 1px solid var(--border);
    padding: 1rem 1.5rem;
    border-radius: 0 0 var(--radius) var(--radius);
}


/* ══════════════════════════════════════════════════════════════
   DASHBOARD
   ══════════════════════════════════════════════════════════════ */

.dashboard-page {
    background: var(--bg-body);
    min-height: 100vh;
}

/* Placeholder icona */
.placeholder-icon {
    font-size: 3.5rem;
    color: var(--iron-grey);
    opacity: 0.5;
}

/* Area testo generato — leggibilissima */
.generated-text-area {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1.5rem;
    font-size: 1.05rem;
    font-weight: 500;
    line-height: 1.8;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 500px;
    overflow-y: auto;
    color: var(--platinum);
}

/* Titolo pagina */
.page-title {
    font-weight: 700;
    font-size: 1.6rem;
    color: var(--bright-snow);
}


/* ══════════════════════════════════════════════════════════════
   TABLE (Storico)
   ══════════════════════════════════════════════════════════════ */

.table-dark {
    --bs-table-bg: transparent;
    --bs-table-hover-bg: rgba(255, 255, 255, 0.03);
    --bs-table-border-color: var(--border);
}

.table-dark thead th {
    background: rgba(255, 255, 255, 0.03);
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--pale-slate);
    padding: 1rem;
    border-bottom: 1px solid rgba(173, 181, 189, 0.15);
    white-space: nowrap;
}

.table-dark tbody td {
    padding: 0.9rem 1rem;
    vertical-align: middle;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--platinum);
}

/* Badge esito */
.badge-successo {
    background: var(--teal-soft);
    color: var(--teal);
    border: 1px solid rgba(91, 168, 160, 0.2);
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.35em 0.7em;
}

.badge-errore {
    background: var(--coral-soft);
    color: var(--coral);
    border: 1px solid rgba(201, 107, 107, 0.2);
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.35em 0.7em;
}

/* ID cella */
.id-cell {
    font-family: 'Courier New', monospace;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--slate-grey);
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}


/* ══════════════════════════════════════════════════════════════
   ALERTS — leggibili senza abbagliare
   ══════════════════════════════════════════════════════════════ */

.alert {
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: var(--radius-sm);
}

.alert-success {
    background: var(--teal-soft);
    border: 1px solid rgba(91, 168, 160, 0.2);
    color: var(--teal);
}

.alert-danger {
    background: var(--coral-soft);
    border: 1px solid rgba(201, 107, 107, 0.2);
    color: var(--coral);
}

.alert-warning {
    background: rgba(201, 168, 78, 0.1);
    border: 1px solid rgba(201, 168, 78, 0.2);
    color: var(--warn);
}


/* ══════════════════════════════════════════════════════════════
   MODAL
   ══════════════════════════════════════════════════════════════ */

.modal-content {
    background: var(--bg-card) !important;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}

.modal-header {
    border-bottom: 1px solid var(--border);
    padding: 1.2rem 1.5rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid var(--border);
    padding: 1rem 1.5rem;
}

.modal-title {
    font-weight: 700;
    font-size: 1.15rem;
}


/* ══════════════════════════════════════════════════════════════
   BADGE generico
   ══════════════════════════════════════════════════════════════ */

.badge.bg-secondary {
    background: var(--gunmetal) !important;
    color: var(--pale-slate);
    font-weight: 600;
    font-size: 0.85rem;
}

.badge.bg-success {
    background: rgba(91, 168, 160, 0.2) !important;
    color: var(--teal) !important;
    font-weight: 600;
}

.badge.bg-danger {
    background: var(--coral-soft) !important;
    color: var(--coral) !important;
    font-weight: 600;
}


/* ══════════════════════════════════════════════════════════════
   RESPONSIVE — Ottimizzato mobile per PR di notte
   ══════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    body {
        font-size: 17px;  /* Leggermente più grande su mobile */
    }

    .login-card {
        margin: 1rem;
        padding: 2rem;
    }

    .brand-title {
        font-size: 1.8rem;
    }

    .glass-card .card-body {
        padding: 1.2rem;
    }

    .glass-card .card-header {
        padding: 1rem 1.2rem;
    }

    .generated-text-area {
        max-height: 400px;
        padding: 1.2rem;
        font-size: 1.05rem;
    }

    .page-title {
        font-size: 1.35rem;
    }

    .form-control, .form-select {
        font-size: 1.05rem;
        padding: 0.85rem 1rem;
    }

    .form-label {
        font-size: 1rem;
    }

    .btn-neon {
        font-size: 1.1rem;
        padding: 0.9rem 1.4rem;
        min-height: 54px;
    }

    /* Tabella: font più grande, spaziatura generosa */
    .table-responsive {
        font-size: 0.9rem;
    }

    .table-dark thead th {
        font-size: 0.8rem;
        padding: 0.8rem 0.6rem;
    }

    .table-dark tbody td {
        padding: 0.75rem 0.6rem;
        font-size: 0.9rem;
    }

    .navbar {
        padding: 0.7rem 0.8rem;
    }

    .nav-link {
        font-size: 1.05rem;
        padding: 0.6rem 0.8rem !important;
    }
}

@media (max-width: 576px) {
    body {
        font-size: 17px;
    }

    .login-card {
        padding: 1.6rem;
        border-radius: 12px;
    }

    .logo-icon {
        width: 70px;
        height: 70px;
        font-size: 1.8rem;
    }

    .brand-title {
        font-size: 1.6rem;
    }

    .btn-neon {
        padding: 0.85rem 1.2rem;
        font-size: 1.05rem;
    }

    .btn-sm {
        min-width: 44px;
        min-height: 42px;
    }
}


/* ══════════════════════════════════════════════════════════════
   ANIMATIONS — sottili, non distraenti
   ══════════════════════════════════════════════════════════════ */

.fade-in {
    animation: fadeIn 0.4s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.spinner-border {
    border-color: var(--accent);
    border-right-color: transparent;
}

/* Toast notifica */
.toast-success {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 9999;
    animation: slideInRight 0.35s ease;
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to   { transform: translateX(0); opacity: 1; }
}
