/* ---------- LAYOUT GENERICO + LAYOUT SPECIFICO PER index.php ---------- */

/* Reset di base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Stile globale */
body {
    font-family: 'Georgia', serif;
    background-color: #f9f7f2;
    color: #333;
    min-height: 100vh;
    display: flex; /* Il body diventa un contenitore verticale */
    flex-direction: column;
}

/* HEADER */
header {
    background-color: #2c3e50;
    color: white;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* WRAPPER PER NAV + MAIN
   Questi due elementi verranno affiancati */
.content-wrapper {
    flex: 1;                   /* Occupa tutto lo spazio possibile */
    display: flex;             /* Attiva il layout orizzontale */
    flex-direction: row;
    gap: 2rem;                 /* Spazio tra nav e main */
    padding: 1.5rem;
    align-items: flex-start;
}

/* NAV laterale */
nav {
    width: 30%;                /* Larghezza colonna sinistra */
    background-color: #ecf0f1;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

/* rimuove i pallini e sistema la lista */
nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* ogni voce è un blocco separato con margine sotto */
nav li {
    margin-bottom: 0.75rem;
}

/* titolo cliccabile: occupa tutta la larghezza per area di click ampia */
nav .titolo a {
    display: block;
    padding: 0.45rem 0.6rem;
    text-decoration: none;
    color: #1a3d6b;
    font-weight: bold;
    border-radius: 4px;
}

/* hover per la voce della lista */
nav .titolo a:hover {
    background-color: rgba(0,0,0,0.03);
}

/* autore sotto il titolo, stile più piccolo */
nav .autore {
    font-size: 0.9rem;
    color: #555;
    padding-left: 0.6rem;
}

/* Area MAIN */
main {
    flex: 1;                   /* Occupa tutto lo spazio rimanente */
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

/* FOOTER – sempre in basso */
footer {
    background-color: #2c3e50;
    color: #ffffff;
    padding: 2rem 2.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;          /* allineamento verticale */
    flex-wrap: wrap;
    gap: 2rem;                    /* spazio tra i due box su schermi stretti */
    border-top: 4px solid #1a2836; /* leggero contrasto elegante */
}

/* BOX nel footer (sinistra) */
.container {
    width: 45%;
    font-size: 1.2em;
}

.container-right {
    text-align: right;
    margin: 15px 0;
    display: inline-block;
    width: 35%;
    vertical-align: top;
    background-color: #f0f8ff;
    border-left: 2px solid #007bff;
    padding: 10px;
}

/* BOX nel footer (destra) */
.footer-box {
    width: 45%;
    background-color: #f0f8ff;
    border-left: 2px solid #007bff;
    padding: 1rem;
    text-align: right;
    display: flex;
    flex-direction: column;
    justify-content: center;    /* centra verticalmente */
    height: 100%;               /* assicura che occupi tutta l'altezza del footer */
}

p {
    margin-top: 0.5rem;
    margin-bottom: 1rem;      /* spazio sotto ogni paragrafo */
    line-height: 1.6;         /* migliora la leggibilità */
}

/* ---------- LAYOUT SPECIFICO PER inserisci.php ---------- */

/* Wrapper che allinea i container sulla stessa riga */
.admin-wrapper {
    display: flex;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 2rem;
    width: 100%;
}

/* I box interni (riusiamo .container senza toccare il comportamento in index.php) */
.admin-wrapper .container {
    background-color: #ffffff;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;    /* centra verticalmente */
}

/* L'ultimo box: allineamento specifico */
.admin-wrapper .container-right {
    max-width: 380px;              /* ← aumentato */
    width: 35%;                    /* ← ora prende più spazio proporzionale */
    text-align: right;
    background-color: #eef6ff;
    border-left: 3px solid #007bff;
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Titolo pagina “Area riservata” */
.admin-title {
    font-size: 2rem;
    margin: 2rem auto 1rem auto;
    text-align: center;
    color: #2c3e50;
}

/* Contenitore principale del form */
form.inserisci {
    display: flex;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 2rem;
    width: 100%;
}

/* ---------- LAYOUT GENERICO ---------- */

/* CLASSI DI LOG */
.log { color: darkblue; }
.warning { color: darkorange; }
.error { color: red; }

.form-container{
    background-color: #ffffff;
    padding: 0.8rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;    /* centra verticalmente */
}

.form-group {
    margin-bottom: 1.5rem;        /* spazio tra un campo e l'altro */
}

.form-group label {
    font-weight: bold;
    margin-bottom: 0.4rem;
    display: inline-block;        /* permette al margin-bottom di funzionare */
    color: #2c3e50;
}

/* Input */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="file"],
input[type="color"] {
    margin: 10px 0;
    padding: 8px;
    font-size: 16px;
}

/* Regole specifiche per il color picker */
input[type="color"] {
    width: 60px;
    height: 40px;
    cursor: pointer;
    border: 1px solid #ccc;
    border-radius: 4px;
}

input[type="submit"] {
    padding: 10px 20px;
    font-size: 16px;
    margin: 10px 0;
    cursor: pointer;
}

.btn-blue{
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
}

.btn-blue:hover {
    background-color: #2980b9;
}

.btn-red {
    background-color: #e74c3c;
    color: white;
    border: none;
    border-radius: 4px;
}

.btn-red:hover {
    background-color: #c0392b;
}

.btn-green {
    background-color: #27ae60;
    color: white;
    border: none;
    border-radius: 4px;
}

.btn-green:hover {
    background-color: #219a52;
}

a.generico{
    color: darkblue;
    text-decoration: none;
}

a.generico:hover{
    text-decoration: underline;
}
