/* ==========================
   STILE GENERALE
========================== */
body {
    font-family: 'Nunito', Arial, sans-serif;
    margin: 10px;
    background-image: url('/sfondo.png');
    background-repeat: repeat;    /* Ripete l’immagine orizzontalmente e verticalmente */
    background-position: top left;
    background-size: auto;        /* Mantiene dimensioni originali */
    background-attachment: fixed; /* Mantiene fisso durante lo scroll */
}

body, .container {
    padding-top: 20px; /* spazio sopra per il link */
}

h1 {
    color: #993f74;
    font-size: 2.5rem;
    font-weight: bold;
}

h2 {
    color: #471533;
}

/* ==========================
   INPUT & FORM
========================== */
input[name="days_to_show"] {
    width: 70px;
    padding: 10px 12px;
    font-size: 1.5rem;
    font-weight: bold;
}

input[type=text] {
    width: 100%;
    font-weight: bold;
    box-sizing: border-box;
    font-size: 1rem;
    padding: 6px 8px;
    text-align: left;
    border-radius: 4px;
}

form {
    margin: 0 auto;
}

form input[type="text"],
form input[type="password"] {
    text-align: left;
    width: 100%;
    padding: 12px 16px;
    border: 1.8px solid #993f74;
    border-radius: 7px;
    font-size: 1.25rem;
    background: #fff;
    margin-bottom: 16px;
    box-sizing: border-box;
    transition: border 0.3s;
}

form input[type="text"]:focus,
form input[type="password"]:focus {
    border: 2.2px solid #471533;
}

form button.salva {
    width: 140px;
    height: 40px;
    font-weight: bold;
    font-size: 1rem;
    border-radius: 8px;
    background-color: #4CAF50;
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 0 5px rgba(0,128,0,0.6);
    transition: background-color 0.3s;
}

form button.salva:hover {
    background-color: #449d48;
}

/* ==========================
   LABELS
========================== */
.label-titolo-form {
    color: #471533;
    display: block;
    font-family: 'Nunito', Arial, sans-serif;
    user-select: none;
    font-size: 1.5rem; /* adatta a tuo piacere */
    font-weight: 700;
    margin-bottom: 0.5em;
}

.label-fasce-giornaliere {
    font-weight: bold;
    color: #993f74;
    display: block;
    margin-bottom: 6px;
}

/* ==========================
   BOTTONE DOWNLOAD CSV
========================== */

.bottone-download {
    font-size: 1.0rem;      /* più piccolo */
    text-decoration: none;  /* togli sottolineatura */
    padding: 10px 15px;      /* rendi il bottone più piccolo */
    border-radius: 6px;     /* angoli arrotondati */
    display: inline-block;  /* per gestire margini e padding */
    background-color: #993f74; /* colore di sfondo */
    color: white;           /* colore testo */
    border: none;           /* nessun bordo */
    cursor: pointer;        /* puntatore mouse */
    font-weight: bold;
    transition: background-color 0.3s;
}

.bottone-download:hover {
    background-color: #7a2b57; /* colore al passaggio del mouse */
}


/* ==========================
   STRUTTURA GIORNI & FASCE
========================== */
.giorni-orari-wrapper {
    border: none !important;
    background-color: transparent !important;
    margin-bottom: 20px;
    align-content: flex-start;
    width: calc(150px * 4 + 10px * 3);
    max-width: 100%;
    justify-content: flex-start;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.giorno {
    flex: 1 1 120px;
    margin-bottom: 10px;
    max-width: 230px;
    width: 100%;  
}

.fascia-toggle {
    cursor: pointer;
    display: block; 
    padding: 5px 10px;
    border-radius: 6px;
    border: 1.5px solid;
    user-select: none;
    margin: 4px 0;
    width: 120px;
}

.fascia-attiva {
    background-color: #b8e994cc;
    border-color: #4CAF5088;
    color: #1a1a1a;
}

.fascia-bloccata {
    background-color: #f7a6a6cc;
    border-color: #f4433688;
    color: #770000;
}

.fasce-giornaliere-textarea {
    width: 100%;
    max-width: 150px;
    border-radius: 6px;
    border: 1.8px solid #993f74;
    font-size: 1rem;
    font-weight: bold;
    padding: 8px;
    margin-bottom: 20px;
    font-family: 'Nunito', Arial, sans-serif;
    resize: vertical;
    box-sizing: border-box;
}

/* ==========================
   SCELTA PROCLAMATORI
========================== */
.scelta-proclamatori input[type="radio"] {
    display: none;
}

.scelta-proclamatori label {
    display: inline-block;
    cursor: pointer;
    margin-right: 15px;
    user-select: none;
    vertical-align: middle;
}

.scelta-proclamatori span {
    display: inline-block;
    width: 40px;
    height: 40px;
    line-height: 40px;
    font-size: 1.5rem;
    font-weight: 700;
    font-family: 'Nunito', Arial, sans-serif;
    background-color: #FFF3F0;
    color: #993f74;
    border-radius: 12px;
    text-align: center;
    border: 3px solid #993f74;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: background-color 0.3s, color 0.3s, border-color 0.3s, box-shadow 0.3s;
}

.scelta-proclamatori input[type="radio"]:checked + span {
    background-color: #b8e994;
    color: #1a1a1a;
    border-color: #4CAF50;
    box-shadow: 0 4px 12px rgba(0, 128, 0, 0.5);
}

/* ==========================
   BOTTONI
========================== */
button {
    margin-top: 5px;
    font-weight: bold;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 6px 12px;
}

button.cancella {
    background-color: #f44336;
    color: white;
    border: none;
    border-radius: 4px;
}

button.salva {
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
}

#btnSalva, 
#btnLogout {
    position: fixed;
    right: 20px;
    z-index: 1000;
    width: 140px;
    height: 40px;
    font-weight: bold;
    font-size: 1rem;
    border-radius: 8px;
    cursor: pointer;
    color: white;
    border: none;
}

#btnSalva {
    bottom: 70px;
    background-color: #4CAF50;
    box-shadow: 0 0 5px rgba(0,128,0,0.6);
    transition: background-color 0.3s;
}
#btnSalva:hover {
    background-color: #449d48;
}

#btnLogout {
    bottom: 20px;
    background-color: #f44336;
    box-shadow: 0 0 5px rgba(244,67,54,0.6);
    transition: background-color 0.3s;
}
#btnLogout:hover {
    background-color: #d73931;
}

.bottone-salva-impostazioni {
    font-weight: bold;
    border-radius: 8px;
    padding: 12px 26px;
    font-size: 1.3rem;
    border: none;
    cursor: pointer;
    background-color: #993f74;
    color: white;
    box-shadow: 0 0 5px rgba(0,0,0,0.3);
    transition: background-color 0.3s;
}
.bottone-salva-impostazioni:hover {
    background-color: #7a2b57;
}

/* ==========================
   TABELLE
========================== */
.tabella-container {
    width: 100%;
    overflow-x: auto;
}

.tabella {
    border-collapse: separate;
    border-spacing: 4px;
    width: 100%;
    max-width: 700px;
    min-width: 300px;
    table-layout: fixed;
    word-wrap: break-word;
}

.tabella td, 
.tabella th {
    border: 1px solid #888;
    padding: 8px;
    text-align: center;
    vertical-align: middle;
    border-radius: 4px;
    position: relative;
}

.riquadro-verde {
    background: #b8e994;
}
.riquadro-giallo {
    background: #ffeaa7;
}
.riquadro-rosa {
    background: #FFF3F0;
}

.fascia-oraria {
    white-space: pre-line;
    font-weight: bold;
    font-size: 0.9rem;
    width: 60px;
    max-width: 60px;
    padding: 5px 3px;
    word-break: break-word;
    vertical-align: middle;
    text-align: center;
    background-color: white;
}

.nome-cella {
    cursor: pointer;
    padding: 12px 8px;
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-weight: bold;
    color: #222;
    background: transparent;
    box-sizing: border-box;
    transition: box-shadow 0.2s;
}
.nome-cella:hover {
    box-shadow: 0 0 0 2px #81ecec;
}
.nome-placeholder {
    color: #aaa;
    font-style: italic;
}
.nome-scritto {
    color: #1a1a1a;
}

/* ==========================
   LINK / ACCESSO
========================== */
.accesso-admin {
    position: fixed;
    bottom: 50px; /* sposta più in alto */
    right: 10px;
    background-color: #993f74;
    color: white;
    padding: 6px 14px;
    font-weight: bold;
    font-size: 0.85rem;
    border-radius: 12px;
    font-family: 'Nunito', Arial, sans-serif;
    box-shadow: 0 0 5px rgba(0,0,0,0.3);
    text-decoration: none;
    cursor: pointer;
    user-select: none;
    z-index: 1000;
}
.accesso-admin:hover {
    background-color: #7a2b57;
}

/* ==========================
   POPUP / SUPPORTO
========================== */

.accesso-supporto {
    position: fixed;
    bottom: 10px; /* rimane in basso */
    right: 10px;
    background-color: #686868;
    color: white;
    padding: 6px 14px;
    font-weight: bold;
    font-size: 0.85rem;
    border-radius: 12px;
    font-family: 'Nunito', Arial, sans-serif;
    box-shadow: 0 0 5px rgba(0,0,0,0.3);
    text-decoration: none;
    cursor: pointer;
    user-select: none;
    z-index: 1000;
}

.accesso-supporto:hover {
  background-color: #505050;
  color: #fff;
}



/* ==========================
   RESPONSIVE
========================== */
/* Schermi pc (desktop) */
@media (min-width: 800px) {
    input[type=text] {
        width: 200px;
        text-align: center;
        margin-left: auto;
        margin-right: auto;
        display: block;
    }
    .container {
        max-width: 900px;
        margin-left: auto;
        margin-right: auto;
        padding: 20px;
    }
}

/* Schermi mobile (cellulare e tablet) */
@media (max-width: 600px) {
    .tabella {
        min-width: 320px;
    }
    h1 {
        font-size: 1.8rem;
    }
    h2 {
        font-size: 1.1rem;
    }
    button {
        font-size: 0.9rem;
        padding: 5px 10px;
    }
    input[type=text] {
        font-size: 0.9rem;
        padding: 6px 8px;
    }
}
