body {
    background-image: url('/static/images/background-homepage.jpg');
    background-size: auto;
    background-repeat: repeat;
    background-position: center;
    background-attachment: fixed;
    color: #fff;
    min-height: 50vh;
    display: flex;
    flex-direction: column;
    font-family: "Oswald", Helvetica, sans-serif;
}

.py-4{
    min-height: 700px;
}

a {
    color: #fff; /* Rosso principale */
    font-family: "Oswald", Helvetica, sans-serif;
    text-decoration: none;
    font-weight: 400;
    transition: color 0.3s ease;
}

/* Elimina margini verticali */
body, html {
    margin: 0;
    padding: 0;
    overflow-x: hidden; /* Evita scroll orizzontali */
}

section {
    margin: 0;
    padding: 0;
    box-shadow: none; /* Se ci fossero effetti indesiderati */
}

/****************************************************************************
 *                               NAVBAR & FOOTER
 ****************************************************************************/
.navbar,
.footer {
  margin: 0;
  border: none;
  box-shadow: none;
}

.navbar {
  background-color: #4A2C2A; /* Marrone principale */
  background-image: url('/static/images/bg-bottom-pattern.png'); /* Separatore in alto */
  background-repeat: repeat-x;
  background-position: bottom;
  background-size: fixed;
  text-align: left;  /* Allinea a sinistra (nel caso la navbar sia flex, regola i justify-content) */
  align-items: center;
  height: 140px;     /* Altezza fissa */
  padding: 0 0 20px 0;
}

/* Logo all’interno della .navbar */
.navbar-brand img {
  height: 80px;       /* Mantiene dimensioni coerenti */
  object-fit: contain;
  background: transparent;
}

@media (max-width: 992px){
    /* Cambia il colore dell'icona (hamburger) */
    .navbar-toggler-icon {
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3E%3Cpath stroke='white' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E") !important;
    }

    /* Cambia la cornice del pulsante */
    .navbar-toggler {
        border: 2px solid white !important; /* Bianco invece di nero */
    }

    .dropdown-toggle::after {
        display: none !important;
    }

    .dropdown-item {
        padding: 0!important;
    }

    .menu-item.clickable {
        cursor: pointer;
    }

    .navbar-nav .nav-item {
        margin: 0 !important;
        padding: 0 !important;
    }

    .navbar-collapse{
        background: #4A2C2A;
        z-index: 9999 !important; /* Estremamente alto per evitare problemi */
        padding-top: 0 !important;
        padding-bottom: 0 !important;
    }

    .navbar-nav {
        padding: 0 !important;
        margin: 0 !important;
    }

    /* LINK abilitati (stile generico) */
    .navbar-nav .nav-link-enabled {
        color: #fff;
        margin: 0 !important;
        text-transform: uppercase;
        font-family: "Oswald", Helvetica, sans-serif;
        font-weight: 400;
        letter-spacing: 0.8px;
        padding: 10px 20px;
        /*padding-top: 0px !important;*/
        padding-bottom: 0px !important;
        line-height: normal !important;
        position: relative !important;
        text-decoration: none; /* se vuoi rimuovere sottolineature */
    }

    /* LINK disabilitati */
    .navbar-nav .nav-link-disabled {
        color: #805f5d; /* Una variante “spenta” */
        margin-left: 15px;
        text-transform: uppercase;
        font-family: "Oswald", Helvetica, sans-serif;
        font-weight: 400;
        letter-spacing: 0.8px;
        padding: 0 20px;
        position: relative !important;
        cursor: not-allowed; /* Per comunicare disabilitazione */
    }

    .dropdown-menu {
        margin-top:-2px !important;
        padding: 10px 10px !important;
        margin-left: 15px;
        top: 100%;
        position: relative !important;
        z-index: 9999 !important; /* Estremamente alto per evitare problemi */
        background-color: white; /* Assicura visibilità */
        color: #b18b77;
        box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1); /* Aggiunge un leggero effetto sopra gli input */
    }

    .dropdown-item {
        color: #b18b77;
    }

    .dropdown-menu .dropdown-item:hover {
        background: #b18b77;
        color: #4A2C2A;
    }

    .dropdown-menu: hover {
        background: #b18b77;
        color: #4A2C2A;
    }

    .dropdown {
        position: relative !important;
    }

    /* Al passaggio del mouse sul .dropdown, mostra il .dropdown-menu
    .dropdown:click > .dropdown-menu {
      display: block;
    }*/

    .dropdown-menu .dropdown-menu {
        /*margin-left: 15px;*/
        top: 100%;
        color: #b18b77;
        /*color: #fff;*/
        background: #fff;
        /*background: #b18b77;*/
    }

}

.navbar-toggler-icon {
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba(255,255,255,1)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E") !important;
  color: #fff;
}

@media (min-width: 993px){
    /****************************************************************************
     *                                 DROPDOWN
     *      Apertura SOLO on hover: .dropdown:hover > .dropdown-menu { ... }
     ****************************************************************************/
    .dropdown {
        background: #4A2C2A;
        position: relative; /* Importante per posizionare il .dropdown-menu */
        text-align: left;
    }

    /* Stile generale del menu */
    .dropdown-menu {
      background: #4A2C2A;
      border-radius: 5px;  /* Angoli arrotondati */
      min-width: 200px;
      display: none;       /* Di base è nascosto */
      position: absolute;
      top: 100%;
      left: 0;
      text-align: left;
    }

    /* Elementi di lista/link nel menu */
    .dropdown-item {
      background: #4A2C2A;
      font-family: "Oswald", Helvetica, sans-serif;
      color: #fff;
      padding: 10px 15px;
    }

    /* Al passaggio del mouse sul .dropdown, mostra il .dropdown-menu */
    .dropdown:hover > .dropdown-menu {
      display: block;
    }

    /* Submenu di secondo livello: .dropdown-menu annidato dentro un altro .dropdown-menu */
    .dropdown-menu .dropdown-menu {
      top: 0%;
      left: 100%;
      padding: 0;
      display: none; /* Rimane nascosto finché non si hovera il suo .dropdown-genitore */
    }

    /* Effetto hover su item */
    .dropdown-menu .dropdown-item:hover {
      background-color: #b18b77;
      color: #4A2C2A;
    }

    /* Rimuove la freccetta/caret di Bootstrap (se presente) */
    .dropdown-toggle::after {
      display: none;
    }



    /****************************************************************************
     *                             NAVBAR-NAV & LINKS
     ****************************************************************************/
    /* Allinea i <li> e i loro <a> nella navbar */
    .navbar-nav > li {
      display: flex;
      align-items: center;
      text-align: left;
    }

    .navbar-collapse {
        background: #4A2C2A;
    }

    /* LINK abilitati (stile generico) */
    .navbar-nav .nav-link-enabled {
      color: #fff;
      text-transform: uppercase;
      font-family: "Oswald", Helvetica, sans-serif;
      font-weight: 400;
      letter-spacing: 0.8px;
      padding: 10px 20px;
      position: relative;
      text-decoration: none; /* se vuoi rimuovere sottolineature */
    }

    /* LINK disabilitati */
    .navbar-nav .nav-link-disabled {
      color: #805f5d; /* Una variante “spenta” */
      text-transform: uppercase;
      font-family: "Oswald", Helvetica, sans-serif;
      font-weight: 400;
      letter-spacing: 0.8px;
      padding: 10px 20px;
      position: relative;
      cursor: not-allowed; /* Per comunicare disabilitazione */
    }

    .navbar-nav .nav-link-enabled::before,
    .navbar-nav .nav-link-enabled::after {
      content: '';
      position: absolute;
      height: 2px;
      width: 0;
      background-color: #CD1520;
      transition: width 0.5s ease;
    }

    /* Bordo superiore */
    .navbar-nav .nav-link-enabled::before {
      top: 0;
      left: 0;
    }

    /* Bordo inferiore */
    .navbar-nav .nav-link-enabled::after {
      bottom: 0;
      left: 0;
    }

    /* In hover: i bordi si espandono */
    .navbar-nav .nav-link-enabled:hover::before,
    .navbar-nav .nav-link-enabled:hover::after {
        width: 100%;
    }

    .menu-item.clickable {
        cursor: pointer;
    }
}

/* Forza la visibilità del menu profilo */
.dropdown-menu[aria-labelledby="profileDropdown"] {
    position: absolute !important;
    right: 0;
    left: auto;
    top: 100%;
    display: none;
    background-color: white/*#4A2C2A; /* Stesso colore della navbar */
    color: white;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 1050; /* Assicura che sia sopra altri elementi */
}

/* Mostra il menu profilo quando è attivo */
.dropdown-menu.show[aria-labelledby="profileDropdown"] {
    display: block !important;
}

.dropdown-menu[aria-labelledby="profileDropdown"] .dropdown-item:hover {
      background-color: #b18b77;
      color: #4A2C2A;
    }

.welcome-section {
    text-align: center;
    padding: 50px 30px;
    background-color: rgba(74, 44, 42, 0.8);
    color: #fff;
    border-radius: 10px;
    margin: 20px auto;
    max-width: 90%;
    max-height: 80%;
    box-shadow: -3px 5px 15px 5px rgba(88,64,31,0.45);
}

.form-section table {
    margin: 0 auto; /* Centra la tabella orizzontalmente */
    box-shadow: -3px 5px 15px 5px rgba(88,64,31,0.45);
}

.form-section {
    display: none;
}

table {
    border-collapse: collapse;
    width: 60%;
    margin: 20px auto;
}

th, td {
    border: 1px solid #ddd;
    padding: 8px;
}

th {
    background-color: #f4f4f4;
    color: #4A2C2A;
    font-weight: bold;
}

.central-section {
    text-align: left;
    padding: 50px 30px;
    background-color: rgba(74, 44, 42, 0.8);
    color: #fff;
    border-radius: 10px;
    margin: 50px auto;
    max-width: 90%;
    max-height: 80%;
    box-shadow: -3px 5px 15px 5px rgba(88,64,31,0.45);
}

.side-section {
    text-align: left;
    padding: 50px 30px;
    background-color: rgba(74, 44, 42, 0.8);
    color: #fff;
    border-radius: 10px;
    margin: 50px auto;
    box-shadow: -3px 5px 15px 5px rgba(88,64,31,0.45);
}

h1,h2,h3,h4{
    text-align: center;
}

.welcome-section h1 {
    font-family: "Oswald", Helvetica, sans-serif;
    font-weight: 400;
    letter-spacing: 0.8px;
    margin-bottom: 20px;
    color: #fff;
}

.btn-enabled-custom {
    border: 2px solid #fff; /* Rosso per bordi */
    color: #fff;
    background-color: transparent;
    margin: 10px;
    width: 150px;
    transition: all 0.3s ease;
}

.btn-disabled-custom {
    border: 2px solid #a1a1a1; /* Rosso per bordi */
    color: #a1a1a1;
    background-color: transparent;
    margin: 10px;
    width: 150px;
    transition: all 0.3s ease;
}

.btn-enabled-custom:hover {
    background-color: #B91C1C;
    color: #fff;
}

.btn-disabled-custom:hover {
    border: 2px solid #a1a1a1; /* Rosso per bordi */
    background-color: transparent;
    color: #a1a1a1;
}

    #status-bar {
        position: fixed;
        bottom: 0;
        width: 100%;
        background-color: #f8f9fa;
        border-top: 1px solid #dee2e6;
        padding: 5px;
        display: flex;
        justify-content: flex-end;
        align-items: center;
    }

    #progress-container {
        position: relative;
        display: flex;
        align-items: center;
        gap: 10px;
    }

    #progress-bar {
        width: 200px;
        height: 10px;
    }

    #progress-label {
        font-size: 0.9em;
        color: #495057;
    }

.footer {
    text-align: center;
    background-color: #4A2C2A; /* Marrone simile a quello del sito */
    background-image: url('/static/images/bg-top-pattern.png'); /* Separatore in alto */
    background-repeat: repeat-x;
    background-position: top; /* Posiziona l'immagine in alto */
    background-size: contain;
    color: #ddd;
    padding: 60px 0 10px 0;
    bottom: 0;
    left: 0;
    width: 100%;
}

/* Modale selezione annata */
#annate-modal .modal-content {
    border: 2px solid #8B0000; /* rosso rubino */
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

#annate-modal .modal-header {
    background-color: #8B0000;
    color: white;
    border-bottom: 1px solid #ccc;
}

#annate-modal .modal-title {
    font-weight: bold;
    letter-spacing: 0.5px;
}

#annate-modal .list-group-item {
    transition: background-color 0.2s, transform 0.1s;
    font-weight: 500;
    border: none;
    padding: 12px 16px;
}

#annate-modal .list-group-item:hover {
    background-color: #f8d7da;
    transform: scale(1.01);
    color: #8B0000;
    font-weight: bold;
}

#annate-modal .list-group-item:active {
    background-color: #f5c6cb;
}

.carousel-wrapper {
    position: relative;
    overflow: hidden;
    width: 100%;
    height: auto;
    border-radius: 8px;
}

.carousel-track {
    display: flex;
    transition: transform 0.4s ease-in-out;
}

.carousel-image {
    flex: 0 0 100%;
    max-width: 100%;
    height: auto;
    object-fit: contain;
    cursor: pointer;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background: rgba(255, 255, 255, 0.8);
    border: none;
    font-size: 1.5em;
    padding: 0.2em 0.6em;
    cursor: pointer;
}

.carousel-btn.prev { left: 10px; }
.carousel-btn.next { right: 10px; }

.carousel-dots {
    text-align: center;
    margin-top: 0.5em;
}

.dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    margin: 4px;
    background-color: #bbb;
    border-radius: 50%;
    cursor: pointer;
}

.dot.active {
    background-color: #333;
}

/* Fullscreen */
.fullscreen-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.fullscreen-track {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.4s ease;
}

.fullscreen-image {
    flex: 0 0 100%;
    object-fit: contain;
    max-height: 100vh;
    max-width: 100vw;
    margin: auto;
}

.btn-close-fullscreen {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 1.8rem;
    color: white;
    background: none;
    border: none;
    cursor: pointer;
}

.fade-out {
    opacity: 0;
    transition: opacity 1s ease-out;
}

#flash-message {
    position: fixed;
    top: 70px;               /* distanza dal bordo superiore */
    left: 50%;               /* centrato orizzontalmente */
    transform: translateX(-50%);
    z-index: 5000;           /* sopra navbar o altri elementi */
    width: 90%;              /* un po’ di margine ai lati */
    max-width: 600px;
    text-align: center;
    pointer-events: none;    /* evita interazioni */
  }

  /* Optional: ombra e transizione per un tocco più elegante */
  #flash-message .alert {
    display: inline-block;
    pointer-events: auto; /* permette di chiudere il singolo alert */
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    animation: slideDown 0.4s ease;
    margin-bottom: 6px;
  }

  @keyframes slideDown {
    from { opacity: 0; transform: translate(-50%, -20px); }
    to { opacity: 1; transform: translate(-50%, 0); }
  }