/* Palette */
:root {
    --dark-goldenrod: #AF8F10;
    --taupe-gray: #9D9B9C;
    --field-drab: #815F16;
    --misty-rose: #F8E5E4;
    --vermilion: #DB3B32;
    --text-dark: #212529;
    --text-light: #f8f9fa;
    --eagle-white: #F4F4F4;
    --outer-red: #A6192E;
    --gold-ring: #FFD700;
    --shield-blue: #005BAC;
    --muted-gold: #B38B00;
    --soft-beige: #F5F3E7;
    --soft-red: #ffd5d5;
}

/*-------------------------------------------------------------
# Scrollbar
--------------------------------------------------------------*/
::-webkit-scrollbar {
    background-color: var(--text-light);
    width: 16px;
}

::-webkit-scrollbar-track {
    background-color: var(--text-light);
}

::-webkit-scrollbar-thumb {
    background-color: var(--taupe-gray);
    border-radius: 16px;
    border: 4px solid var(--text-light);
}

::-moz-scrollbar-button:decrement,
::-moz-scrollbar-button:increment,
::-webkit-scrollbar-button:decrement,
::-webkit-scrollbar-button:increment {
    width: 0px;
}



/* 1. --- BASE & RESET --- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    /* footer support */
    position: relative;
    min-height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    background-color: var(--soft-beige);
    color: var(--text-dark);
    /* footer support */
    /*margin-bottom: 200px;*/
    overflow: hidden;
}

main {
    padding: 1rem;
}

/* Colonna principale */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 2rem; /* spazio uniforme tra sezioni */
}

/* 2. --- LAYOUT & MEDIA QUERIES --- */

/* Mobile first (default) */
.container {
    width: 100%;
    max-width: 100%;
    padding: 1rem 0 120px 5px;
    box-sizing: border-box;
    height: calc(100vh - 4rem - 80px);
    overflow-y: auto;
    overflow-x: hidden;
    background-color: var(--text-light);
    margin-left: auto;
    margin-right: auto;
}

/* Tablet */
@media (min-width: 768px) {
    .container {
        padding: 2rem 2rem 120px 2rem;
    }

    .event-body {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }

    .footer-content {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
        padding: 0 2rem;
    }
}

/* Desktop */
@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
        background-color: var(--text-light);
        box-shadow: 0 0 10px rgba(33, 37, 41, 0.1);
        padding: 2rem 2rem 120px 2rem;
    }
}



/* 3. --- COMPONENTS --- */

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    user-select: none;
    border: 2px solid transparent;
    padding: 0.85rem 1.75rem;
    font-size: 1rem;
    border-radius: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    position: relative;
    overflow: hidden;
    gap: 0.5rem;
}

.btn:active {
    transform: scale(0.98);
}

.btn-positive {
    color: var(--text-light);
    background-color: var(--dark-goldenrod);
    border-color: var(--dark-goldenrod);
    box-shadow: 0 2px 4px rgba(175, 143, 16, 0.2);
}

.btn-positive:hover {
    background-color: var(--field-drab);
    border-color: var(--field-drab);
    box-shadow: 0 4px 8px rgba(175, 143, 16, 0.3);
    transform: translateY(-2px);
}

.btn-search {
    color: var(--text-light);
    background-color: var(--dark-goldenrod);
    border-color: var(--dark-goldenrod);
    box-shadow: 0 2px 4px rgba(175, 143, 16, 0.2);
}

.btn-search:hover {
    background-color: var(--muted-gold);
    border-color: var(--muted-gold);
    color: var(--text-light);
    box-shadow: 0 4px 6px rgba(175, 143, 16, 0.3);
}

.btn-search:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(175, 143, 16, 0.4);
}

.btn-reset {
    color: var(--text-dark);
    background-color: var(--taupe-gray);
    border-color: var(--taupe-gray);
    box-shadow: 0 2px 4px rgba(157, 155, 156, 0.2);
}

.btn-reset:hover {
    background-color: var(--vermilion);
    border-color: var(--vermilion);
    color: var(--text-light);
    box-shadow: 0 4px 6px rgba(219, 59, 50, 0.3);
}

.btn-reset:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(219, 59, 50, 0.4);
}



.btn-negative {
    color: var(--text-light);
    background-color: var(--vermilion);
    border-color: var(--vermilion);
    box-shadow: 0 2px 4px rgba(219, 59, 50, 0.2);
    padding: 0.65rem 1.3rem !important;
}

.btn-negative:hover {
    background-color: #c93229;
    border-color: #c93229;
    box-shadow: 0 4px 8px rgba(219, 59, 50, 0.3);
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: var(--taupe-gray);
    color: var(--text-light);
    box-shadow: 0 2px 4px rgba(157, 155, 156, 0.2);
}

.btn-secondary:hover {
    background-color: #8a8889;
    box-shadow: 0 4px 8px rgba(157, 155, 156, 0.3);
    transform: translateY(-2px);
}

@media (max-width: 767px) {
    .btn {
        padding: 0.75rem 1.25rem;
        font-size: 0.95rem;
    }
}

.btn-block {
    width: 100%;
}

.btn-copy {
    margin-left: 0.5rem;
    padding: 0.3rem 0.6rem;
    cursor: pointer;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-label small {
    font-weight: 400;
    color: var(--taupe-gray);
}

.form-control {
    display: block;
    width: 100%;
    padding: 0.85rem 1.25rem;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--text-dark);
    background-color: var(--text-light);
    border: 2px solid var(--taupe-gray);
    border-radius: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.form-control:focus {
    outline: 0;
    border-color: var(--dark-goldenrod);
    box-shadow: 0 4px 8px rgba(175, 143, 16, 0.15);
    transform: translateY(-1px);
}

.form-control::placeholder {
    color: var(--taupe-gray);
    opacity: 0.8;
}

@media (max-width: 767px) {
    .form-control {
        padding: 0.75rem 1rem;
        font-size: 0.95rem;
    }
}

.form-check {
    display: flex;
    align-items: center;
}

.form-check-input {
    margin-right: 0.5rem;
}


/* =======================================
   FOOTER - versione aggiornata responsive
   ======================================= */
.footer-container {
    background: linear-gradient(135deg, #9b7900fc, #6b4705); /* giallo/marrone più spenti */
    color: var(--text-light);
    width: 100%;
    padding: 1rem;
    position: fixed;
    bottom: 0;
    text-align: center;
    box-shadow: 0 -2px 6px rgba(0, 0, 0, 0.1);
}



.footer {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    justify-self: center;
    width: 100%
}

@media (max-width: 500px) {
    .footer-utility-mobile {
        display: flex;
        flex-direction: row;
        gap: 1rem;
    }

    .footer-utility-desktop {
        display: none;
    }
}

.footer-content {
    max-width: 1140px;
    /*margin: auto;*/
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* --- LOGO --- */
.footer-logo img {
    max-height: 50px;
    transition: transform 0.3s ease;
}

.footer-logo img:hover {
    transform: scale(1.05);
}

/* --- INFO --- */
.footer-info-mobile {
    font-size: 0.9rem;
    line-height: 1.6;
    opacity: 0.9;

    details {
        user-select: none;
    }

    details>summary span.icon {
        width: 24px;
        height: 24px;
        transition: all 0.3s;
        margin-left: auto;
        font-size: 1rem;
    }

    details[open] summary span.icon {
        transform: rotate(180deg);
    }

    summary {
        display: flex;
        cursor: pointer;
    }
}

.footer-info {
    font-size: 0.9rem;
    line-height: 1.6;
    opacity: 0.9;
    display: none;
}

.footer-info p {
    margin: 0;
}

/* --- LINK --- */
.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}

.footer-links a {
    color: var(--text-light);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s, transform 0.2s;
}

.footer-links a:hover {
    color: var(--misty-rose);
    transform: translateY(-2px);
}

/* --- RESPONSIVE --- */
@media (min-width: 768px) {
    .footer {
        max-height: none;
    }

    .footer-content {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        text-align: left;
        gap: 2rem;
    }

    .footer-logo {
        /*flex: 1;*/
        text-align: left;
        margin-bottom: 0;
    }

    .footer-info {
        flex: 2;
        text-align: center;
        display: block;
    }

    .footer-info-mobile {
        display: none;
    }

    .footer-links {
        flex: 1;
        justify-content: flex-end;
    }

    .footer-utility-mobile {
        display: none;
    }

    .footer-utility-desktop {
        display: block;
    }
}

.sidebar-content {
    background: #ffffff;
    padding: 1.5rem;
    border-radius: 8px;
    height: fit-content;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

/* Page specific */
.status-page-container {
    display: flex;
    justify-content: center;
}


.status-box {
    background: var(--text-light);
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(33, 37, 41, 0.1);
    width: 100%;
    max-width: 750px;
    text-align: center;
    height: fit-content;
    min-height: 100%;
}

.status-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
}

.status-icon.error {
    color: var(--vermilion);
}

.status-icon.success {
    color: var(--dark-goldenrod);
}

.status-icon.info {
    color: var(--taupe-gray);
}

.status-box h2 {
    margin-bottom: 1rem;
    color: var(--field-drab);
}

.status-box p {
    font-size: 1.1rem;
}

.status-box hr {
    margin: 1rem 0;
    border: 0;
    border-top: 1px solid var(--text-light);
}

.event-details-container {
    background: var(--text-light);
    padding: 2rem;
    border-radius: 8px;
    margin-top: 2rem;
}

.event-header h1 {
    color: var(--field-drab);
}
.event-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 1rem;
    margin-bottom: 2rem;
    gap: 1rem;
}

.event-header h1,
.header-meta {
    width: 100%;
}


.event-header h1 {
    margin: 0;
    color: var(--field-drab);
    flex-grow: 1;
}

.header-meta {
    display: flex;
    justify-content: space-between;
    color: var(--taupe-gray);
    font-style: italic;
}

.event-duration.event-ongoing {
    color: var(--vermilion);
    font-weight: bold;
}

.event-body-grid {
    display: grid;
    grid-template-columns: 3fr 2fr; /* più armonico */
    gap: 2rem;
}
.ordersMap{
    grid-column: 1 / -1;
}

@media (max-width: 768px) {
    .event-body-grid {
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
    }
    .main-content {
        order: 1;
    }

    .sidebar-content {
        order: 3;
    }

    .ordersMap {
        order: 2; /* 🚀 mappa per prima su mobile */
    }
    .event-header h1{
        font-size: 2.5rem;
    }
    .event-details-container{
        margin-top: 0px;
        padding: 0px;
    }
}
@media (max-width: 500px) {
    .event-header h1{
        font-size: 1.5rem;
    }

}

.event-info-section,
.event-location-section {
    background: #ffffff;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.event-info-section h3,
.event-location-section h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--field-drab);
}

.event-info-section h3,
.event-location-section h3,
.sidebar-content h3 {
    color: var(--dark-goldenrod);
}

.gps-coords {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.gps-coords-text {
    margin-left: 0.5rem;
}

/* Contenitore generale della mappa */
.map-container {
    position: relative;
    width: 100%;
    aspect-ratio: 24 / 9;
    border-radius: 10px;
    overflow: hidden;
    background: #fafafa;
    border: 1px solid #ddd;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.map-frame {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

.map-title {
    margin-bottom: 1rem;
    margin-top: 1rem;
    color: var(--field-drab);
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* Stato placeholder (opzionale: puoi mostrarlo prima del caricamento iframe) */
.map-container::before {
    content: "Caricamento mappa...";
    position: absolute;
    inset: 0;
    backdrop-filter: blur(2px);
    background: rgba(255, 255, 255, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 1rem;
    font-style: italic;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.3s ease;
}
/* Mostra placeholder solo se l’iframe non è caricato */
.map-container.loading::before {
    opacity: 1;
}

@media (max-width: 500px) {
    .map-container {
        aspect-ratio: 16 / 9;
    }
}


.participant-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.event-actions {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--text-light);
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.event-actions .btn {
    min-width: 150px;
}

.event-actions .btn.selected {
    transform: scale(1.05);
    box-shadow: 0 0 0 3px rgba(175, 143, 16, 0.4);
}

.page-header {
    /*
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--text-light);
    padding-bottom: 1rem;
    */
}

.page-header h1 {
    color: var(--field-drab);
    font-size: 1.75rem;
}

.event-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.error-message {
    background-color: var(--misty-rose);
    color: var(--vermilion);
    border: 1px solid var(--vermilion);
    padding: .75rem 1.25rem;
    border-radius: .25rem;
    margin-bottom: 1rem;
    text-align: center;
}

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding-top: 5vh;
}

.login-form {
    background: var(--text-light);
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(33, 37, 41, 0.12);
    width: 100%;
    max-width: 450px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    height: 100%;
}

@media (max-width: 767px) {
    .login-form {
        padding: 1.5rem;
        /*margin: 1rem;*/
        border-radius: 0;
    }

    .login-container {
        padding-top: 0;
        height: 100%;
    }

    .page-header h1 {
        font-size: 1.5rem;
    }
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h2 {
    margin-bottom: 0.5rem;
    color: var(--field-drab);
}

.login-links {
    margin-top: 1.5rem;
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
}

.login-links a {
    color: var(--dark-goldenrod);
    text-decoration: none;
}

.login-links a:hover {
    text-decoration: underline;
}

.event-group {
    font-style: italic;
    color: var(--taupe-gray);
}

.event-body {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.event-footer {
    margin-top: 2rem;
    text-align: center;
}

.event-footer a {
    color: var(--dark-goldenrod);
    text-decoration: none;
}

.event-footer a:hover {
    text-decoration: underline;
}

.status-buttons .btn {
    margin: 0 0.5rem;
}

.content-page {
    background: var(--text-light);
    padding: 2rem;
    border-radius: 8px;
    margin-top: 2rem;
}

.content-page h1 {
    color: var(--field-drab);
    margin-bottom: 0.5rem;
}

.content-page .last-updated {
    font-style: italic;
    color: var(--taupe-gray);
    margin-bottom: 1.5rem;
}

.privacy-text p {
    margin-bottom: 1rem;
    line-height: 1.8;
}

.privacy-text h2 {
    color: var(--dark-goldenrod);
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.privacy-text h3 {
    color: var(--dark-goldenrod);
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.privacy-text ul {
    list-style-type: disc;
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.privacy-text li {
    margin-bottom: 0.5rem;
}

.back-link {
    margin-top: 2rem;
    text-align: center;
}

.back-link a {
    color: var(--dark-goldenrod);
    text-decoration: none;
}

.back-link a:hover {
    text-decoration: underline;
}

.code-input {
    text-align: center;
    font-size: 1.5rem;
    letter-spacing: 0.5rem;
}

.common-issues h2 {
    color: var(--dark-goldenrod);
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.support-issue {
    border: 1px solid var(--taupe-gray);
    border-radius: 4px;
    margin-bottom: 1rem;
}

.support-issue summary {
    padding: 1rem;
    font-weight: bold;
    cursor: pointer;
    outline: none;
}

.support-issue[open] summary {
    border-bottom: 1px solid var(--taupe-gray);
}

.solution {
    padding: 1rem;
    border-top: 1px solid var(--text-light);
}

.solution-image {
    max-width: 100%;
    margin-top: 1rem;
}

.solution-image.hidden {
    display: none;
}

.btn-secondary.hidden {
    display: none;
}

.contact-info {
    margin-top: 2rem;
}

.contact-info p {
    margin-bottom: 0.5rem;
}

.settings-actions {
    background-color: var(--text-light);
    padding: 0;
    border-radius: 8px;
    margin-bottom: 0;
}

.settings-actions small {
    display: block;
    margin-bottom: 1rem;
}

.button-group {
    display: flex;
    justify-content: space-between;
    flex-direction: column;
    align-items: center;
}

.btn-settings.version-check {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: 1px solid #ccc;
    border-radius: 12px;
    background: linear-gradient(145deg, #f9f9f9, #eaeaea);
    color: #333;
    font-weight: 500;
    transition: all 0.2s ease-in-out;
    width: fit-content;
}

.btn-settings.version-check:hover {
    background: linear-gradient(145deg, #ffffff, #dedede);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-settings.version-check i {
    transition: transform 0.3s ease;
}

.btn-settings.version-check.loading i {
    animation: spin 0.8s linear infinite;
    color: #AF8F10;
    /* stesso colore del campanello attivo */
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}


.sync:hover {
    background-color: #029d39;
    color: var(--text-light);
}

@media screen and (max-width: 768px) {
    .btn-settings {
        width: 120%;
        margin: 5px;
    }
}

/* 4. --- NAVBAR --- */
.navbar {
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 1rem;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: auto;
    position: relative;
    height: 4rem;
}

.navbar-logo {
    height: 35px;
    transition: transform 0.3s ease;
}

.navbar-logo:hover {
    transform: scale(1.05);
}

.navbar-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    padding: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-radius: 0 0 8px 8px;
}

@media (min-width: 768px) {
    .navbar {
        padding: 0.75rem 2rem;
    }

    .navbar-menu {
        position: static;
        display: flex;
        gap: 1.5rem;
        box-shadow: none;
        padding: 0;
        background: transparent;
    }

    .mobile-menu-toggle {
        display: none;
    }

    .user-name {
        display: inline;
    }
}


.navbar-item {
    color: var(--text-dark);
    text-decoration: none;
    padding: 0.5rem 1rem;
    transition: background-color 0.2s;
    display: flex;
    flex-direction: row;
    align-items: center;
    text-decoration: none;
    cursor: pointer;

    p {
        margin-left: 1rem;
    }
}

.navbar-item:hover {
    background-color: var(--soft-red);
}

.notification-toggle button,
.mobile-menu-toggle button {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--taupe-gray);
    transition: color 0.2s;
}

.notification-toggle button:hover,
.mobile-menu-toggle button:hover {
    color: var(--dark-goldenrod);
}

.user-profile {
    display: flex;
    align-items: center;
}

.user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
}

.user-name {
    display: none;
}

.mobile-menu {
    display: none;
    flex-direction: column;
    background-color: #fff;
    border-top: 1px solid #eee;
}

.mobile-menu.is-active {
    display: flex;
}

.notification-btn {
    position: relative;
}

.notification-btn[data-notifications-enabled="false"] i {
    color: #ccc;
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: var(--vermilion);
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 1s infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

/* --- MODERN & COMPACT SEARCH BAR (PALETTE CUSTOM) --- */

.search-bar-form .form-group {
    display: flex;
    align-items: stretch;
    width: 100%;
    margin-bottom: 2rem;
}

/* Input */
.search-bar-form .form-control {
    flex: 1;
    min-width: 200px;
    padding-right: 0.75rem;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border: 1px solid var(--taupe-gray);
}

/* Bottoni compatti */
.search-bar-form .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0 0.95rem;
    border: none;
    border-left: 1px solid var(--dark-goldenrod);
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

/* Icone più visibili */
.search-bar-form .btn i {
    font-size: 1.15rem;
}

/* --- Pulsante Cerca --- */
.search-bar-form .btn-search {
    background: var(--dark-goldenrod);
    color: var(--text-light);
    border-radius: 0px;
}

.search-bar-form .btn-search:hover {
    background: rgba(0, 91, 172, 0.85); /* shield-blue leggermente scurito */
}

/* --- Pulsante Reset --- */
.search-bar-form .btn-reset {
    background: var(--taupe-gray);
    color: var(--text-light);
    border-top-right-radius: 6px;
    border-bottom-right-radius: 6px;
    border-top-left-radius: 0px;
    border-bottom-left-radius: 0px;
}

.search-bar-form .btn-reset:hover {
    background: var(--text-dark);
    color: var(--text-light);
}

/* Testo nascosto su mobile */
.search-bar-form .btn-text {
    display: none;
}

@media (min-width: 768px) {
    .search-bar-form .btn-text {
        display: inline;
    }
}



/* 6. --- EVENT ITEM --- */
.event-item-link {
    text-decoration: none;
    color: inherit;
}

.event-item {
    background: #fff;
    border-radius: 16px;
    padding: 1.25rem 1.4rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: all 0.25s ease;
    border: 1px solid #f1f1f1;
    position: relative;
    /* soft, moderno */
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
}

.event-item-description {
    padding-right: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-top: 0.3rem;
    color: #555;
    font-size: 0.9rem;
}


.event-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.10);
}

.event-item::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 6px;
    border-radius: 16px 0 0 16px;
    background: var(--taupe-gray);
    opacity: 0.6;
}

.event-item.event-ongoing {
    border-left-color: var(--vermilion);
    background-color: rgba(219, 59, 50, 0.03);
}

.event-item.event-ongoing::before {
    background: var(--vermilion);
    opacity: 1;
}

.event-item.event-concluded {
    opacity: 0.8;
}

.event-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.event-item.completed::before {
    background-color: #ff0000;
}

.event-item.active::before {
    background-color: #329932;
}

.event-item.pending::before {
    background-color: #FFFF19;
}

@media (max-width: 500px) {
    .event-item-description {
        display: none;
    }

    .event-item {
        padding: 1.1rem 1.2rem;
        gap: 0.9rem;
    }

    .event-item-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .event-item-date {
        align-self: flex-start;
    }

    .event-item-meta {
        width: 100%;
        border-top: 1px solid #eee;
        padding-top: 0.65rem;
    }
}

/* ---- COMPATTAZIONE DESKTOP ---- */
@media (min-width: 768px) {
    .event-item {
        padding: 0.9rem 1.1rem;
        /* invece di 1.25rem 1.4rem */
        gap: 0.6rem;
        /* invece di 1rem */
    }

    .event-item-header {
        margin-bottom: 0.25rem;
    }

    .event-item-title {
        font-size: 1.05rem;
        /* ridotto leggermente */
    }

    .event-item-date {
        padding: 0.15rem 0.45rem;
        /* badge più compatto */
        font-size: 0.7rem;
    }

    .event-item-meta {
        padding-top: 0.45rem;
        /* meno spazio sopra la linea */
        font-size: 0.8rem;
    }
}


.event-item.event-ongoing::before,
.event-item.event-concluded::before {
    content: "";
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 8px;
}

.event-item.event-ongoing::before {
    background-color: var(--vermilion);
}

.event-item.event-concluded::before {
    background-color: var(--taupe-gray);
}

.event-item-status-icon {
    font-size: 1.5rem;
    color: var(--taupe-gray);
    float: right;
}

.event-item.event-ongoing .event-item-status-icon {
    color: var(--vermilion);
}

.event-item-details {
    flex-grow: 1;
}

.event-item-title {
    font-size: 1.15rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.25;
}

.event-item-group {
    font-size: 0.85rem;
    color: #7a7a7a;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 0.25rem;
}

.icon-group {
    width: 10px;
    height: 10px;
    background: #bbb;
    border-radius: 50%;
    display: inline-block;
}

.event-item-date {
    padding: 0.25rem 0.55rem;
    background: #f5f5f5;
    border-radius: 8px;
    font-size: 0.75rem;
    color: #444;
    font-weight: 500;
    white-space: nowrap;
}


.event-item-meta {
    border-top: 1px solid #eee;
    padding-top: 0.75rem;
    font-size: 0.85rem;
    color: #6c757d;
    display: flex;
    justify-content: flex-start;
    gap: 1rem;
}


.event-item-duration {
    font-weight: bold;
    color: var(--vermilion);
}


/* 7. --- PAGINATION --- */
#pagination {
    display: flex;
    justify-content: center;
    list-style: none;
    padding: 0;
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.page-item {
    margin: 0 0.25rem;
}

.page-button {
    display: inline-block;
    padding: 0.5rem 0.75rem;
    color: var(--dark-goldenrod);
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    /* opzionale: bordi arrotondati */
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

/* Effetto hover */
.page-button:hover {
    background-color: var(--dark-goldenrod);
    color: #fff;
    border-color: var(--dark-goldenrod);
}

/* Effetto focus per accessibilità */
.page-button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(218, 165, 32, 0.4);
}

/* Stato disabilitato */
.page-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* === Notification Test Form (isolato) === */
@media (max-width: 768px) {
    .ntf-container {
        padding: 0;
    }
}

.ntf-card {
    border: none;
    border-radius: 10px;
    background: var(--text-light);
    box-shadow: 0 4px 15px rgba(33, 37, 41, 0.1);
    padding: 2rem;
}

.ntf-header {
    border-bottom: 1px solid var(--taupe-gray);
    margin-bottom: 1.5rem;
}

.ntf-subtitle {
    color: var(--taupe-gray);
    font-size: 0.95rem;
    margin-top: 0.25rem;
}

/* Layout */
.ntf-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.ntf-field {
    display: flex;
    flex-direction: column;
}

.ntf-full {
    grid-column: 1 / -1;
}

@media (min-width: 768px) {
    .ntf-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* Label e input */
.ntf-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--field-drab);
}

.ntf-input {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    color: var(--text-dark);
    background: var(--text-light);
    border: 1px solid var(--taupe-gray);
    border-radius: 0.25rem;
    transition: all 0.2s ease;
}

.ntf-input:focus {
    border-color: var(--dark-goldenrod);
    box-shadow: 0 0 0 3px rgba(175, 143, 16, 0.2);
    outline: none;
}

.ntf-check {
    display: flex;
    align-items: center;
}

.ntf-check-input {
    margin-right: 0.5rem;
}

.ntf-check-label {
    color: var(--text-dark);
}

/* Action */
.ntf-actions {
    margin-bottom: 1rem;
}

/* Pulsante */
.ntf-btn {
    background-color: var(--dark-goldenrod);
    color: var(--text-light);
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ntf-btn:hover {
    background-color: var(--field-drab);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(175, 143, 16, 0.3);
}

.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}


/* Mobile */
@media (max-width: 767px) {
    .ntf-card {
        padding: 1.5rem;
    }

    .ntf-input {
        font-size: 1rem;
    }

    .ntf-btn {
        width: 100%;
    }
}

/*-------------------------------------------------------
                        NAVBAR
-------------------------------------------------------*/
.nav-icon-title {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1rem;
}

.nav-icon {
    width: 1.5rem;
    height: 1.5rem;
    font-size: 1.5rem;
    color: #212529;

    &::before {
        width: 1.5rem;
    }
}

.button-description {
    margin-left: 1rem;
    text-decoration: none;
    font-size: 1rem;
    color: #212529;
}

.navbar-user-section {
    overflow: hidden;
}

.nav-option {
    display: flex;
    flex-direction: row;
    align-items: center;
    text-decoration: none;
}

.navbar-user-section .nav-menu {
    list-style-type: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
}

.navbar-user-section .nav-menu li {
    display: inline-block;
}

.navbar-user-section .nav-menu li a {
    display: flex;
    flex-direction: row;
    align-items: center;
    text-decoration: none;
    color: #212529;
}

.hamburger {
    display: none;
    font-size: 30px;
    padding: 14px 20px;
    cursor: pointer;
}

#menu-toggle {
    display: none;
}
/* 🔙 Pulsante "Indietro" accanto al logo */
.navbar-item.go-back {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0.3rem 0.6rem;
    border-radius: 0.5rem;
    transition: background-color 0.2s ease, color 0.2s ease;
}

@media (max-width: 767px) {
    .navbar-item.go-back {
        display: none;
    }
}

.navbar-item.go-back:hover {
    background-color: #f3f3f3;
}

.navbar-item.go-back .nav-icon {
    color: #212529;
    font-size: 1.4rem;
    transition: color 0.2s ease;
}

.navbar-item.go-back:hover .nav-icon {
    color: #AF8F10;
}


@media screen and (max-width: 952px) {
    .navbar-user-section .nav-menu {
        display: none;
        position: absolute;
        right: 0;
        width: 100%;
        background-color: white;
        border-radius: 1rem;
        box-shadow: 3px 3px 5px 4px #ccc;
        padding: 2rem;
    }

    .navbar-user-section .nav-menu li {
        display: block;
        text-align: left;
    }

    #menu-toggle:checked+.hamburger+.nav-menu {
        display: block;
    }

    .hamburger {
        display: block;
    }
}

/* switch toggle */

.switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    font-size: 1rem;
    gap: 0.5rem;
    margin: 5px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: relative;
    width: 40px;
    height: 22px;
    background-color: #ccc;
    border-radius: 34px;
    transition: background-color 0.2s;
}

.slider::before {
    content: "";
    position: absolute;
    height: 16px;
    width: 16px;
    left: 3px;
    top: 3px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.2s;
}


input:checked+.slider {
    background-color: #4CAF50;
}

input:checked+.slider::before {
    transform: translateX(18px);
}

.loader {
    width: 60px;
    aspect-ratio: 2;
    --_g: no-repeat radial-gradient(circle closest-side, #000 90%, #0000);
    background:
        var(--_g) 0% 50%,
        var(--_g) 50% 50%,
        var(--_g) 100% 50%;
    background-size: calc(100%/3) 50%;
    animation: l3 1s infinite linear;
}

@keyframes l3 {
    20% {
        background-position: 0% 0%, 50% 50%, 100% 50%
    }

    40% {
        background-position: 0% 100%, 50% 0%, 100% 50%
    }

    60% {
        background-position: 0% 50%, 50% 100%, 100% 0%
    }

    80% {
        background-position: 0% 50%, 50% 50%, 100% 100%
    }
}

.notifications-table {
    display: flex;
    flex-direction: column;
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 10px;
    overflow: hidden;
    font-family: "Segoe UI", Arial, sans-serif;
    background: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    font-size: 14px;
}

.notifications-header,
.notification-row {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1.5fr 0.8fr;
    /* proporzioni delle colonne */
    align-items: center;
    border-bottom: 1px solid #eee;
    text-align: left;
}

.notifications-header {
    background: #f5f5f5;
    font-weight: 600;
    border-bottom: 2px solid #ddd;
    color: #333;
}

.notification-row {
    transition: background 0.2s ease;
}

.notification-row:hover {
    background: #fafafa;
}

.col {
    padding: 10px 12px;
    overflow-wrap: break-word;
}

.col-icon {
    text-align: center;
    font-size: 1.3em;
}

.col-repeat {
    text-align: center;
}

.col-opened b {
    font-weight: 600;
    color: #222;
}

@media (max-width: 768px) {
    .notifications-header {
        display: none;
    }

    .notification-row {
        grid-template-columns: 1fr;
        border-bottom: 1px solid #eee;
        padding: 10px 0;
    }

    .col {
        display: flex;
        justify-content: space-between;
        padding: 6px 12px;
    }

    .col::before {
        content: attr(data-label);
        font-weight: 600;
        color: #555;
    }
}

.loader-container {
    display: flex;
    justify-content: center;
}

/* --- LOGO AVATAR--- */
.avatar-logo img {
    max-height: 100px;
    transition: transform 0.3s ease;
}

.avatar-logo {
    margin-bottom: 1rem;
}

.avatar-logo img:hover {
    transform: scale(1.05);
}

.participant-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background-color: #f8f9fa;
    padding: 0.5rem;
    border-radius: 4px;
}

.participant-status-icon {
    font-size: 1.2rem;
}

.participant-status-icon.confirmed {
    color: var(--dark-goldenrod);
}

.participant-status-icon.declined {
    color: var(--vermilion);
}

/* Pulsanti partecipazione */
.event_participation_block {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    /* evita overflow su mobile */
}

.event_datetime {
    float: right;
    color: #8a8889;
    font-size: 13px;
}

.participant-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.8rem 1rem;
    background: #f9f9f9;
    border-radius: 8px;
}

.participant-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}
@media (max-width: 500px) {

    .participant-status-text{
        display: none;
    }
    .participant-list {
        margin: 1rem;
    }
}

/* Avatar */
.participant-avatar {
    width: 40px;
    height: 40px;
    background-color: #ddd;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    margin-right: 1rem;
    flex-shrink: 0;
}

.participant-avatar img {
    width: 38px;
    height: 38px;
    border-radius: 50%;
}

.participant-info {
    flex-grow: 1;
    margin-left: 0.75rem;
}

.participant-name {
    font-weight: 600;
    display: block;
}

.participant-status-text {
    font-size: 0.85rem;
    color: var(--taupe-gray);
}

.participants-section {
    display: flex;
    flex-direction: column;
    /* sempre in colonna */
    gap: 1.5rem;
}

.participant-group h3 {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    color: #333;
    border-bottom: 1px solid #ddd;
    padding-bottom: 0.25rem;
}

.event-participation-form button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    /* spazio tra icona e testo */
    padding: 0.6rem 1.2rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.btn-positive-events {
    background-color: #28a745;
    color: #fff;
    padding: 0.65rem 1.3rem !important;
}

.btn-positive-events:hover {
    background-color: #218838;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* GROUP NOTIFICATION STYLE */
.notification-groups {
    display: grid;
    padding-bottom: 20px;
}

.info-item i,
.timer-row i {
    color: var(--field-drab);
    margin-right: 0.3rem;
}

.info-separator {
    color: var(--taupe-gray);
}

.timer-row {
    margin-top: 0.4rem;
    font-weight: 500;
}

.status i {
    font-size: 0.7rem;
    color: var(--vermilion); /* simbolo stato rosso */
}

.event-datetime-info {
    background: #f9f9f9;
    padding: 0.8rem 1rem;
    padding-right: 0;
    padding-left: 0;
    border-radius: 8px;
    font-size: 0.85rem;
    color: var(--text-dark);
    max-width: 280px;
    flex-shrink: 0;
}


/* righe compatte */
.info-row,
.timer-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem;
}

#event-timer {
    display: inline-block;
    font-family: monospace;
    min-width: 90px;
}

.info-separator {
    color: var(--taupe-gray);
}

.status i {
    font-size: 0.7rem;
    color: var(--vermilion);
}

/* Iconcine */
.event-datetime-info i {
    color: var(--field-drab);
    margin-right: 0.25rem;
}

/* Mobile: il blocco va sotto al titolo */
@media (max-width: 768px) {
    .event-header {
        flex-direction: column;
        align-items: center; /* <-- da left → center */
        text-align: center;  /* <-- centra anche il testo */
    }

    .event-datetime-info {
        width: 100%;
        max-width: none;
        text-align: center; 
    }

    .info-row,
    .timer-row {
        justify-content: center; /* <-- centra le icone e testi */
    }
    .header-meta {
        justify-content: center;
    }
}