/* Foglio di stile per la pagina ricerca.php */
.nav-tasti {
	margin: 1.5rem 0;
}
.tasti-wrapper {
	display: flex;
	gap: 1rem;
	justify-content: center;
	flex-wrap: wrap;
}
.tasto-nav {
	background-color: #3B506F;
	color: #D8E0FF;
	border: 2px solid transparent;
	border-radius: 8px;
	padding: .7rem 1.5rem;
	font-size: 1rem;
	cursor: pointer;
	transition: background-color .3s ease, border-color .3s ease;
	font-family: inherit;
}
.tasto-nav:hover {
	background-color: #0A1F3E;
}
.tasto-nav.attivo {
	border-color: #DBE0FF;
	background-color: #0A1F3E;
}
.tasto-nav.disabilitato {
	opacity: .4;
	cursor: not-allowed;
}
.panel {
	overflow: hidden;
	max-height: 3000px;
	transition: max-height 0.5s ease-in-out, opacity 0.4s ease;
	opacity: 1;
}
.panel.nascosto {
	max-height: 0;
	opacity: 0;
}
.sezione-titolo {
	color: #2E3F59;
	border-bottom: 2px solid #2E3F59;
	margin: 1.5rem 0 .8rem 0;
	padding-bottom: .3rem;
	font-size: 1rem;
	text-transform: uppercase;
	letter-spacing: .05em;
}
.autore-riga {
	display: flex;
	gap: .5rem;
	margin-bottom: .4rem;
	align-items: center;
}
.autore-riga input {
	width: auto;
	flex: 1;
	margin-bottom: 0;
}
.tasto-aggiungi {
	background-color: #2E3F59;
	color: #DBE0FF;
	border: none;
	border-radius: 50%;
	width: 2rem;
	height: 2rem;
	font-size: 1.2rem;
	cursor: pointer;
	line-height: 1;
	flex-shrink: 0;
}
.tasto-aggiungi:hover {
	background-color: #0A1F3E;
}
#pulsanti button:hover {
	background-color: #0A1F3E;
	cursor: pointer;
}
.errore-login {
	color: #c0392b;
	background-color: #fdecea;
	border-radius: 5px;
	padding: .5rem 1rem;
	margin-bottom: 1rem;
}

/*Allineamento campo autori*/
#autori-lista {
	display: inline-block;
	width: 70%;
	vertical-align: top;
}
.campi-form {
	display: flex;
	align-items: flex-start;
	margin-bottom: 6px;
}

/*Messaggi di successo/errore*/
.messaggio-successo {
	background-color: #d4edda;
	color: #155724;
	border-radius: 5px;
	padding: .7rem 1rem;
	margin-bottom: 1rem;
	font-weight: bold;
}
.nessun-risultato {
	color: #666;
	font-style: italic;
	padding: 1rem 0;
}

/*Scheda risorsa (spoglio.php)*/
.scheda-riga {
	display: flex;
	gap: 1rem;
	padding: .5rem 0;
	border-bottom: 1px solid #c8cfe8;
	align-items: baseline;
}
.scheda-riga:last-child {
	border-bottom: none;
}
.scheda-etichetta {
	min-width: 200px;
	font-weight: bold;
	color: #2E3F59;
	flex-shrink: 0;
}
.scheda-valore {
	flex: 1;
	color: #080808;
}
.scheda-pdf {
	display: flex;
	gap: 1rem;
}
.tasto-pdf {
	background-color: #2E3F59;
	color: #DBE0FF !important;
	padding: .4rem 1rem;
	border-radius: 5px;
	text-decoration: none !important;
	transition: background-color .3s ease;
	font-size: .9rem;
	border: none;
	cursor: pointer;
	font-family: inherit;
}
.tasto-pdf:hover {
	background-color: #0A1F3E !important;
	color: #DBE0FF !important;
}
.avviso-login {
	display: flex;
	flex-direction: column;
	gap: .8rem;
}
.avviso-login p {
	margin: 0;
	color: #2E3F59;
	font-style: italic;
}

/* ---- Tabella risultati (lista.php) ---- */
.tabella-risultati {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}
.tabella-risultati thead tr {
    background-color: #2E3F59;
    color: #DBE0FF;
}
.tabella-risultati th {
    padding: .6rem .8rem;
    text-align: left;
}
.tabella-risultati tbody tr:nth-child(even) {
    background-color: #BFC7EE;
}
.tabella-risultati tbody tr:hover {
    background-color: #0A1F3E;
    color: #DBE0FF;
}
.tabella-risultati tbody tr:hover a,
/*ho dovuto mettere important per sovrascrivere regole di css che avrebbero mostrato la tabella in maniera errata  */
.tabella-risultati tbody tr:hover button {
    background-color: transparent !important;
    color: #DBE0FF !important;
}
.tabella-risultati td {
    padding: .5rem .8rem;
    vertical-align: middle;
}
.tabella-risultati td * {
    background-color: transparent !important;
    color: inherit !important;
    transition: none !important;
}
.tabella-risultati a {
    color: #2E3F59;
    text-decoration: none;
}
.tabella-risultati a:hover {
    text-decoration: underline;
}
.col-tipo {
    width: 40px;
    text-align: center;
    font-weight: bold;
}
.col-seq {
    width: 30%;
}
.col-testata {
    width: 35%;
}

/*Modale PDF e popup login*/
.modale-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(0, 0, 0, .7);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 1000;
}
.modale-contenuto {
	position: relative;
	width: 90%;
	height: 90%;
	background: #fff;
	border-radius: 8px;
	overflow: hidden;
}
.modale-login {
    position: relative;
    width: 400px;
    background-color: #DBE0FF;
    border-radius: 12px;
    padding: 2rem;
    color: #2E3F59;
}
.modale-chiudi {
	position: absolute;
	top: .5rem;
	right: .5rem;
	background: #2E3F59;
	color: #DBE0FF;
	border: none;
	border-radius: 50%;
	width: 2rem;
	height: 2rem;
	font-size: 1rem;
	cursor: pointer;
	line-height: 1;
	z-index: 10;
}
.modale-chiudi:hover {
	background: #0A1F3E;
}
/* ---- Elimina risorsa ---- */
.sezione-pericolo {
    color: #c0392b;
    border-bottom-color: #c0392b;
}
.tasto-elimina {
    background-color: #c0392b;
    color: #fff;
    border: none;
    border-radius: 5px;
    padding: .4rem 2rem;
    cursor: pointer;
    font-family: inherit;
    font-size: 1rem;
    transition: background-color .3s ease;
}
.tasto-elimina:hover {
    background-color: #922b21;
}
/*Schede di login/registrazione*/
.auth-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #2E3F59;
}
.auth-tab {
    flex: 1;
    background: none;
    border: none;
    padding: .6rem 1rem;
    cursor: pointer;
    font-family: inherit;
    font-size: 1rem;
    color: #2E3F59;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: border-color .2s ease;
}
.auth-tab.attivo {
    border-bottom-color: #2E3F59;
    font-weight: bold;
}
.auth-tab:hover {
    background-color: rgba(46, 63, 89, .1);
}
.auth-panel {
    display: block;
}
.auth-panel.nascosto {
    display: none;
}
.modale-overlay {
    z-index: 9999;
}
/* Modale admin */
.modale-admin {
    position: relative;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    background-color: #DBE0FF;
    border-radius: 12px;
    padding: 2rem;
    overflow-y: auto;
}
.modale-admin h2 {
    text-align: center;
    color: #2E3F59;
    margin-bottom: 1.5rem;
}
.admin-cerca {
    display: flex;
    gap: .5rem;
    margin-bottom: 1rem;
}
.admin-cerca input {
    flex: 1;
    width: auto;
}
.tabella-admin {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}
.tabella-admin thead tr {
    background-color: #2E3F59;
    color: #DBE0FF;
}
.tabella-admin th {
    padding: .6rem .8rem;
    text-align: left;
}
.tabella-admin tbody tr:nth-child(even) {
    background-color: #BFC7EE;
}
.tabella-admin td {
    padding: .5rem .8rem;
    vertical-align: middle;
}
.td-toggle {
    text-align: center;
    width: 80px;
}
.riga-mia {
    opacity: .6;
    font-style: italic;
}
.tasto-elimina-small {
    padding: .2rem .6rem;
    font-size: .85rem;
}
.admin-paginazione {
    display: flex;
    gap: .5rem;
    justify-content: center;
    margin-top: 1rem;
    flex-wrap: wrap;
}
.admin-paginazione a {
    background-color: #3B506F;
    color: #DBE0FF;
    padding: .3rem .8rem;
    border-radius: 4px;
    text-decoration: none;
    transition: background-color .3s ease;
}
.admin-paginazione a:hover {
    background-color: #0A1F3E;
}
.admin-paginazione a.pagina-attiva {
    background-color: #0A1F3E;
    font-weight: bold;
}
.tabella-admin td {
    color: #2E3F59;
}
/* ---- Sfondo homepage ---- */
.sfondo-collage {
    text-align: center;
    overflow: hidden;
    transition: opacity 0.5s ease, max-height 0.5s ease;
    max-height: 1500px;
    opacity: 0.6;
}
.sfondo-collage.nascosto {
    max-height: 0;
    opacity: 0;
}
/* Gestione per schermi più piccoli */
@media only screen and (max-width: 767px) {

    .campi-form {
        flex-direction: column;
    }
    .campi-form label {
        width: 100%;
        text-align: left;
        margin-right: 0;
        margin-bottom: .3rem;
    }
    .campi-form input,
    .campi-form select {
        width: 100% !important;
    }
    #autori-lista {
        width: 100%;
    }
    .sfondo-collage {
        min-height: 200px;
        max-height: 300px;
        background-position: center top;
    }
    .col-seq {
        display: none;
    }
    .col-testata {
        display: none;
    }
    .tabella-risultati thead th.col-seq,
    .tabella-risultati thead th.col-testata {
        display: none;
    }

    .scheda-riga {
        flex-direction: column;
        gap: .3rem;
    }
    .scheda-etichetta {
        min-width: unset;
        width: 100%;
    }
    .scheda-valore {
        width: 100%;
        word-break: break-word;
        overflow-wrap: break-word;
    }

    .modale-login {
        width: 90%;
        max-width: 90vw;
        max-height: 90vh;
        overflow-y: auto;
    }

    .modale-contenuto {
        width: 100%;
        height: 100%;
        border-radius: 0;
    }

    .modale-admin {
        width: 95%;
        padding: 1rem;
    }
    .tabella-admin th,
    .tabella-admin td {
        padding: .3rem .4rem;
        font-size: .85rem;
    }

    .tasto-nav {
        width: 100%;
        text-align: center;
    }
}