/* TheGatherShelf - Stili personalizzati */

/* Loader Fullscreen */
#page-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background-color: rgba(255, 255, 255, 0.95);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease;
}

#page-loader .spinner {
  width: 60px;
  height: 60px;
  border: 6px solid transparent;
  border-top-color: #0d6efd;
  border-right-color: #0d6efd;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Dark mode per il loader */
[data-bs-theme="dark"] #page-loader {
  background-color: rgba(27, 32, 43, 0.95);
}

[data-bs-theme="dark"] #page-loader .spinner {
  border-top-color: #63b3ed;
  border-right-color: #63b3ed;
}

/* Nascondi il loader quando la pagina è caricata */
#page-loader.fade-out {
  opacity: 0;
  pointer-events: none;
}

body, html {
  height: auto !important;
  min-height: 100vh;
  overflow-x: hidden;
}

.main-wrapper {
  min-height: 100vh;
  padding-bottom: 0 !important;
}

/* Responsive: su schermi piccoli (< 1199px) */
@media only screen and (max-width: 1199px) {
  /* Nelle pagine admin, quando non toggled, margin-left: 0 */
  .main-wrapper {
    margin-left: 0 !important;
  }
  
}

/* (le regole delle sezioni sono state spostate in assets/css/sections.css) */

.page-footer {
    left: 0 !important;
    padding: 1.5rem 0;
    background-color: #f8f9fa;
    border-top: 1px solid #dee2e6;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    min-height: auto !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    position: relative;
    z-index: 1;
    display: block !important;
    flex: none !important;
    flex-shrink: 0 !important;
}

.page-footer .container {
    max-width: 1200px;
    width: 100%;
}

.page-footer p {
    line-height: 1.5;
    margin-bottom: 0.75rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    height: auto;
    min-height: auto;
}

.page-footer p:last-child {
    margin-bottom: 0;
}

.page-footer .container,
.page-footer .row,
.page-footer .col-12 {
    height: auto !important;
    min-height: auto !important;
    max-height: none !important;
}

.page-footer .row {
    margin: 0;
}

.page-footer .col-12 {
    padding: 0 15px;
}

/* Dark mode per il footer */
[data-bs-theme="dark"] .page-footer {
    background-color: #1b202b !important; /* #212529 */
    border-top-color: #2d3748 !important;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3) !important;
}

/* Footer si riduce quando la sidebar è aperta, come il main-wrapper */
@media (min-width: 769px) {
    .page-footer-admin {
        margin-left: 260px !important;
        transition: margin-left 0.3s ease;
    }
}

@media (min-width: 769px) {
  body.toggled .page-footer-admin {
    margin-left: 70px !important;
    transition: margin-left 0.3s ease;
  }
}


[data-bs-theme="dark"] .page-footer .text-muted {
    color: #a0aec0 !important;
}

/* Responsive footer */
@media (max-width: 768px) {
    .page-footer {
        padding: 1rem 0;
    }
    
    .page-footer p {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }
    
    .page-footer .col-12 {
        padding: 0 10px;
    }
    
}

@media (max-width: 576px) {
    .page-footer {
        padding: 0.75rem 0;
    }
    
    .page-footer p {
        font-size: 0.85rem;
        line-height: 1.4;
    }
    
}

/* Stili per il selettore lingua nel footer */
.language-selector-footer {
    flex-shrink: 0;
}

.language-selector-footer .dropdown-toggle {
    display: flex;
    align-items: center;
    white-space: nowrap;
}

.language-selector-footer .dropdown-menu {
    min-width: 180px;
}

.language-selector-footer .dropdown-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1rem;
}

.language-selector-footer .dropdown-item.active {
    background-color: var(--bs-primary);
    color: #fff;
}

.language-selector-footer .dropdown-item.active .material-icons-outlined {
    color: #fff;
}

/* Dark mode per il dropdown lingua */
[data-bs-theme="dark"] .language-selector-footer .dropdown-menu {
    background-color: #2d3748 !important;
    border-color: #4a5568 !important;
}

[data-bs-theme="dark"] .language-selector-footer .dropdown-item {
    color: #e2e8f0 !important;
}

[data-bs-theme="dark"] .language-selector-footer .dropdown-item:hover,
[data-bs-theme="dark"] .language-selector-footer .dropdown-item:focus {
    background-color: #4a5568 !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .language-selector-footer .dropdown-item.active {
    background-color: #0d6efd !important;
    color: #fff !important;
}

/* Responsive per il selettore lingua */
@media (max-width: 768px) {
    .language-selector-footer {
        width: 100%;
        margin-top: 1rem;
    }
    
    .language-selector-footer .dropdown {
        width: 100%;
    }
    
    .language-selector-footer .dropdown-toggle {
        width: 100%;
        justify-content: center;
    }
}

.search-content {
    height: auto !important;
}

.top-header .navbar {
    left: 0 !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Barra di ricerca centrata */
.search-bar-centered {
  position: relative;
  z-index: 10000;
}

/* Stili per il popup nella barra centrata */
.search-bar-centered .search-popup {
  position: absolute;
  width: 100%;
  top: 60px;
  left: 0;
  right: 0;
  background-color: #ffffff;
  border-radius: 1rem;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  z-index: 10001;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
}

/* Index: forza l'allineamento a sinistra del contenuto del popup */
.search-bar-centered .search-popup,
.search-bar-centered .search-popup .card,
.search-bar-centered .search-popup .card-header,
.search-bar-centered .search-popup .card-body,
.search-bar-centered .search-popup .card-footer {
  text-align: left !important;
}

/* Forza allineamento a sinistra di TUTTI gli elementi interni del popup */
.search-bar-centered .search-popup * {
  text-align: left !important;
}

/* Input del popup sempre allineato a sinistra */
.search-bar-centered .search-popup .popup-search-control {
  text-align: left !important;
}

/* Header del popup: contenitore dell'input */
.search-bar-centered .search-popup .card-header .position-relative {
  text-align: left !important;
}

[data-bs-theme=dark] body .top-header .navbar {
  background-color: #1b202b;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* Sidebar dark mode - stesso colore della topbar */
[data-bs-theme="dark"] body .sidebar-wrapper {
  background-color: #1b202b !important;
}

[data-bs-theme="dark"] body .sidebar-wrapper .sidebar-header {
  background-color: #1b202b !important;
}

[data-bs-theme="dark"] body .sidebar-wrapper .sidebar-nav {
  background-color: #1b202b !important;
}

/* Rimuovi il bordo destro della sidebar e aggiungi ombra */
.sidebar-wrapper {
  border-right: none !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15) !important;
}

.sidebar-wrapper .sidebar-header {
  border-right: none !important;
}

/* Ombra più pronunciata in dark mode */
[data-bs-theme="dark"] body .sidebar-wrapper {
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3) !important;
}

/* Dropdown della sidebar in dark mode - stesso colore della sidebar */
[data-bs-theme="dark"] body .sidebar-nav .metismenu ul {
  background-color: #1b202b !important;
}

[data-bs-theme="dark"] body .sidebar-wrapper .sidebar-bottom .dropdown-menu {
  background-color: #1b202b !important;
  border-color: #2d3748 !important;
}

[data-bs-theme="dark"] body .sidebar-wrapper .sidebar-bottom .dropdown-menu .dropdown-item {
  color: #e2e8f0 !important;
}

[data-bs-theme="dark"] body .sidebar-wrapper .sidebar-bottom .dropdown-menu .dropdown-item:hover,
[data-bs-theme="dark"] body .sidebar-wrapper .sidebar-bottom .dropdown-menu .dropdown-item:focus {
  background-color: #2d3748 !important;
  color: #ffffff !important;
}

/* Stili per modalità dark - popup nella barra centrata */
[data-bs-theme="dark"] .search-bar-centered .search-popup {
  background-color: #2d3748;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.3);
}

/* Stili per modalità dark - popup nella topbar */
[data-bs-theme="dark"] .top-header .search-popup {
  background-color: #2d3748 !important;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.3) !important;
}

/* Quando il popup è aperto, mantieni il contenuto in posizione fissa */
body.popup-open .main-content {
  transform: translateY(-15vh) !important;
  transition: transform 0.3s ease !important;
}

/* Nascondi la barra di ricerca originale quando il popup è aperto, ma mantieni lo spazio */
body.popup-open .search-control-centered,
body.popup-open .search-arrow-centered,
body.popup-open .search-bar-centered .position-relative span:first {
  opacity: 0 !important;
  visibility: hidden !important;
  transition: opacity 0.3s ease, visibility 0.3s ease !important;
}

.search-bar-centered .search-popup.fade-in {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  z-index: 10001 !important;
}

/* Stili per il contenuto del popup */
.search-popup .card {
  border: 1px solid #dee2e6;
  box-shadow: none;
  margin-bottom: 0;
}

/* Stili per modalità dark - contenuto del popup */
[data-bs-theme="dark"] .search-popup .card {
  background-color: #2d3748;
  border-color: #4a5568;
  color: #e2e8f0;
}

/* Stili per modalità dark - contenuto del popup nella topbar */
[data-bs-theme="dark"] .top-header .search-popup .card {
  background-color: #2d3748 !important;
  border-color: #4a5568 !important;
  color: #e2e8f0 !important;
}

.search-popup .search-content {
  position: relative;
  height: auto;
  max-height: 24.3rem;
  overflow-y: auto;
}

/* Forza allineamenti a sinistra nel corpo */
.search-bar-centered .search-popup .search-content,
.search-bar-centered .search-popup .search-content * {
  text-align: left !important;
}

/* Corregge l'allineamento degli elementi della lista nel popup (index) */
.search-bar-centered .search-popup .search-list {
  align-items: flex-start !important; /* non centrare la colonna */
}

.search-bar-centered .search-popup .search-list-item {
  width: 100% !important;              /* occupa tutta la larghezza */
  justify-content: flex-start !important; /* icona + testo allineati a sinistra */
  align-items: center !important;
  margin-left: 0 !important;
}

.search-popup .search-title {
  font-size: 13px;
  font-weight: 500;
  color: #6c757d;
  margin-bottom: 1rem;
}

/* Stili per modalità dark - titoli del popup */
[data-bs-theme="dark"] .search-popup .search-title {
  color: #a0aec0;
}

/* Stili per modalità dark - titoli del popup nella topbar */
[data-bs-theme="dark"] .top-header .search-popup .search-title {
  color: #a0aec0 !important;
}

.search-popup .kewords {
  font-size: 12.5px;
  font-weight: 500;
  color: #495057;
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 2rem !important;
  padding: 0.4rem 0.7rem !important;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

/* Forza border-radius rotondo anche nella search-bar-centered (index) */
.search-bar-centered .search-popup .kewords {
  border-radius: 2rem !important;
  padding: 0.4rem 0.7rem !important;
}

.search-popup .kewords:hover {
  color: #efefef;
  background-color: #28292d;
}

/* Stili per modalità dark - keywords */
[data-bs-theme="dark"] .search-popup .kewords {
  color: #e2e8f0;
  background-color: #4a5568;
  border-color: #718096;
}

[data-bs-theme="dark"] .search-popup .kewords:hover {
  color: #ffffff;
  background-color: #2d3748;
}

/* Stili per modalità dark - keywords nella topbar */
[data-bs-theme="dark"] .top-header .search-popup .kewords {
  color: #e2e8f0 !important;
  background-color: #4a5568 !important;
  border-color: #718096 !important;
}

[data-bs-theme="dark"] .top-header .search-popup .kewords:hover {
  color: #ffffff !important;
  background-color: #2d3748 !important;
}

.search-popup .search-list-item {
  padding: 0.4rem 0.7rem;
  border-radius: 0.25rem;
  transition: 0.2s cubic-bezier(0.075, 0.82, 0.165, 1);
}

.search-popup .search-list-item:hover {
  color: #3a3a3a;
  background-color: #f8f8f8;
}

.search-popup .search-list-item .list-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background-color: #edecec;
}

.search-popup .search-list-item .search-list-title {
  font-size: 14px;
}

/* Stili per modalità dark - elementi della lista */
[data-bs-theme="dark"] .search-popup .search-list-item {
  color: #e2e8f0;
}

[data-bs-theme="dark"] .search-popup .search-list-item:hover {
  color: #ffffff;
  background-color: #4a5568;
}

[data-bs-theme="dark"] .search-popup .search-list-item .list-icon {
  background-color: #4a5568;
  color: #e2e8f0;
}

[data-bs-theme="dark"] .search-popup .search-list-item .search-list-title {
  color: #e2e8f0;
}

/* Stili per modalità dark - elementi della lista nella topbar */
[data-bs-theme="dark"] .top-header .search-popup .search-list-item {
  color: #e2e8f0 !important;
}

[data-bs-theme="dark"] .top-header .search-popup .search-list-item:hover {
  color: #ffffff !important;
  background-color: #4a5568 !important;
}

[data-bs-theme="dark"] .top-header .search-popup .search-list-item .list-icon {
  background-color: #4a5568 !important;
  color: #e2e8f0 !important;
}

[data-bs-theme="dark"] .top-header .search-popup .search-list-item .search-list-title {
  color: #e2e8f0 !important;
}

/* Stili per modalità dark - campo di input nel popup */
[data-bs-theme="dark"] .search-popup .form-control {
  background-color: #4a5568;
  border-color: #718096;
  color: #e2e8f0;
}

[data-bs-theme="dark"] .search-popup .form-control:focus {
  background-color: #4a5568;
  border-color: #63b3ed;
  color: #e2e8f0;
  box-shadow: 0 0 0 0.2rem rgba(99, 179, 237, 0.25);
}

[data-bs-theme="dark"] .search-popup .form-control::placeholder {
  color: #a0aec0;
}

/* Stili per modalità dark - icone nel popup */
[data-bs-theme="dark"] .search-popup .material-icons-outlined {
  color: #a0aec0;
}

/* Stili per modalità dark - campo di input nel popup della topbar */
[data-bs-theme="dark"] .top-header .search-popup .form-control {
  background-color: #4a5568 !important;
  border-color: #718096 !important;
  color: #e2e8f0 !important;
}

[data-bs-theme="dark"] .top-header .search-popup .form-control:focus {
  background-color: #4a5568 !important;
  border-color: #63b3ed !important;
  color: #e2e8f0 !important;
  box-shadow: 0 0 0 0.2rem rgba(99, 179, 237, 0.25) !important;
}

[data-bs-theme="dark"] .top-header .search-popup .form-control::placeholder {
  color: #a0aec0 !important;
}

/* Stili per modalità dark - icone nel popup della topbar */
[data-bs-theme="dark"] .top-header .search-popup .material-icons-outlined {
  color: #a0aec0 !important;
}

/* Nascondi il tasto Cerca nella pagina index */
.search-bar-centered .search-popup .card-footer {
  display: none !important;
}

.search-control-centered:focus {
  box-shadow: none;
  border: 1px solid var(--bs-border-color);
}

/* Layout centrato con posizionamento leggermente più in alto */
.min-vh-100 {
  min-height: 100vh;
}

/* Sposta il contenuto principale leggermente più in alto solo nella pagina index */
body:has(.search-bar-centered) .main-content {
  justify-content: center !important;
  align-items: center !important;
  transform: translateY(-15vh) !important;
  transition: transform 0.3s ease !important;
}

/* Nascondi la X inizialmente */
.search-close-centered {
  display: none !important;
}

.search-close-centered.d-block {
  display: block !important;
}

/* Nascondi la X della barra centrata nella topbar */
.top-header .search-close-centered {
  display: none !important;
}

/* Stili per la freccia nella barra centrata */
.search-arrow-centered {
  display: block;
  cursor: pointer !important;
  color: #6c757d;
  transition: color 0.2s ease;
}

/* Stili per la freccia nel popup */
.popup-search-arrow {
  cursor: pointer !important;
}

.search-arrow-centered:hover {
  color: #007bff;
}

/* Stili per la freccia nella topbar (solo desktop) */
.search-arrow {
  display: block !important;
  cursor: pointer;
  color: #6c757d;
  transition: color 0.2s ease;
}

.search-arrow:hover {
  color: #007bff;
}

/* Stili per la freccia mobile nella topbar */
.mobile-search-arrow {
  display: block !important;
  cursor: pointer;
  color: #6c757d;
  transition: color 0.2s ease;
}

.mobile-search-arrow:hover {
  color: #007bff;
}

/* Popup nella topbar - compatibilità con sistema esistente */
.top-header .search-popup {
  display: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
  background-color: #ffffff !important;
  border-radius: 1rem !important;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

.top-header .search-popup.d-block {
  display: block !important;
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.top-header .search-popup.fade-in {
  display: block !important;
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Assicurati che la freccia desktop sia nascosta su mobile */
@media (max-width: 991px) {
  .search-arrow {
    display: none !important;
  }
}

/* Posizionamento corretto del popup per mobile nella barra centrata */
@media (max-width: 768px) {
  .search-bar-centered .search-popup {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-height: 70vh !important;
    z-index: 10001 !important;
  }
}

/* Posizionamento corretto del popup per desktop nella barra centrata (solo index) */
@media (min-width: 769px) {
  .search-bar-centered .search-popup {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-height: 60vh !important;
    z-index: 10001 !important;
  }
}

/* Abbassa leggermente il popup della topbar */
.top-header .search-popup {
  top: 70px !important;
}

/* Assicurati che la barra di ricerca desktop sia visibile */
@media (min-width: 992px) {
  .search-control {
    display: block !important;
  }
  
  .search-control + span {
    display: block !important;
  }
}

/* Animazioni fade per i popup di ricerca - regole generiche */
.search-popup.fade-out {
  opacity: 0 !important;
  visibility: hidden !important;
  transform: translateY(-10px) !important;
}

/* Responsive fixes per la topbar su mobile - modifiche minime */
@media (max-width: 576px) {
  /* Riduci solo il gap tra le icone della navbar su mobile */
  .top-header .navbar {
    gap: 0.125rem !important;
  }
  
  /* Sposta il logo più a sinistra su mobile */
  .top-header .navbar-brand {
    margin-right: 0rem !important;
    padding: 0 !important;
  }
  
  /* Riduce altezza logo su mobile */
  .top-header .navbar-brand .logo-img {
    height: 30px !important;
  }
  
  /* Sposta btn-toggle più a sinistra su mobile */
  .top-header .btn-toggle {
    margin-left: -1.0rem !important;
    padding-left: 0.25rem !important;
    padding-right: 0.25rem !important;
  }
}

/* Contorno dorato scintillante per card */
@keyframes golden-border-glow {
  0% {
    border-color: #ffd700;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
  }
  50% {
    border-color: #ffed4e;
    box-shadow: 0 0 25px rgba(255, 237, 78, 0.7);
  }
  100% {
    border-color: #ffd700;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
  }
}

.card-golden-border {
  border: 3px solid #ffd700;
  border-radius: 1rem;
  animation: golden-border-glow 2s ease-in-out infinite;
}

/* Effetto luccicante per pulsante al hover */
@keyframes shimmer-effect {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.btn-hover-glow {
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  border: 1px solid #6c757d;
}

.btn-hover-glow * {
  position: relative;
  z-index: 2;
}

.btn-hover-glow::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
  background-size: 200% 100%;
  animation: shimmer-effect 6s ease-in-out infinite;
  pointer-events: none;
  z-index: 1;
}

.btn-hover-glow:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 123, 255, 0.3);
  background: linear-gradient(45deg, #007bff, #0056b3, #007bff);
  background-size: 200% 200%;
  color: white;
  animation-duration: 1s;
}

.btn-hover-glow:hover::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  background-size: 200% 100%;
  animation: shimmer-effect 1.5s ease-in-out infinite;
  pointer-events: none;
}

.btn-hover-glow:active {
  transform: translateY(0);
}

/* Dark mode */
[data-bs-theme="dark"] .card-golden-border {
  border-color: #ffd700;
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
}

[data-bs-theme="dark"] .btn-hover-glow:hover {
  background: linear-gradient(45deg, #0d6efd, #0a58ca, #0d6efd);
  background-size: 200% 200%;
}


.gradient-border {
  position: relative;
  border: 3px solid transparent;
  border-radius: 10px;
  background: linear-gradient(var(--bs-body-bg), var(--bs-body-bg)) padding-box,
              linear-gradient(
                60deg,
                hsl(224, 85%, 66%),
                hsl(269, 85%, 66%),
                hsl(314, 85%, 66%),
                hsl(359, 85%, 66%),
                hsl(44, 85%, 66%),
                hsl(89, 85%, 66%),
                hsl(134, 85%, 66%),
                hsl(179, 85%, 66%)
              ) border-box;
  background-size: 300% 300%;
  background-position: 0 50%;
  animation: moveGradient 4s alternate infinite;
}

@keyframes moveGradient {
  50% {
    background-position: 100% 50%;
  }
}

.page-content {
  margin-top: 85px !important;
}

/* Riduci il padding left e right di main-content-admin nelle pagine admin */
.main-content-admin {
  padding-left: 0.5rem !important;
  padding-right: 0.5rem !important;
}

.main-wrapper-frontpage {
  margin-left: 0 !important;
  margin-right: 0 !important;
}

/* Animazione icona burger menu */
.btn-toggle a {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
}

/* BURGER ICON */
.burger-icon {
  width: 24px;
  height: 18px;
  position: absolute;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.burger-line {
  width: 100%;
  height: 3px;
  background-color: currentColor;
  border-radius: 3px;
  transition: all 0.3s ease;
}

/* X ICON */
.burger-arrow {
  position: absolute;
  font-size: 24px;
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
  transform: scale(0.8);
}

/* DEFAULT: Menu APERTO (senza toggled) - mostra X per chiudere */
.btn-toggle .burger-icon {
  opacity: 0 !important;
  visibility: hidden !important;
}

.btn-toggle .burger-arrow {
  opacity: 1 !important;
  visibility: visible !important;
  transform: scale(1) !important;
}

/* Menu CHIUSO (body.toggled) - mostra BURGER per aprire */
body.toggled .btn-toggle .burger-icon {
  opacity: 1 !important;
  visibility: visible !important;
}

body.toggled .btn-toggle .burger-arrow {
  opacity: 0 !important;
  visibility: hidden !important;
  transform: scale(0.8) !important;
}

/* Hover effect */
.btn-toggle a:hover .burger-icon .burger-line {
  background-color: #007bff;
}

.btn-toggle a:hover .burger-arrow {
  color: #007bff;
}

[data-bs-theme="dark"] .btn-toggle a:hover .burger-icon .burger-line {
  background-color: #63b3ed;
}

[data-bs-theme="dark"] .btn-toggle a:hover .burger-arrow {
  color: #63b3ed;
}

/* MOBILE: Menu CHIUSO di default (senza toggled) - mostra BURGER per aprire */
@media only screen and (max-width: 1199px) {
  /* DEFAULT: Menu CHIUSO su mobile - mostra BURGER per aprire */
  .btn-toggle .burger-icon {
    opacity: 1 !important;
    visibility: visible !important;
  }

  .btn-toggle .burger-arrow {
    opacity: 0 !important;
    visibility: hidden !important;
    transform: scale(0.8) !important;
  }

  /* Menu APERTO su mobile (body.toggled) - mostra X per chiudere */
  body.toggled .btn-toggle .burger-icon {
    opacity: 0 !important;
    visibility: hidden !important;
  }

  body.toggled .btn-toggle .burger-arrow {
    opacity: 1 !important;
    visibility: visible !important;
    transform: scale(1) !important;
  }
}

/* Freccia back-to-top */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background-color: rgba(15, 23, 42, 0.9);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.3s ease;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.3);
  backdrop-filter: blur(10px);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background-color: rgba(15, 23, 42, 1);
  transform: translateY(-5px);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.4);
}

.back-to-top i {
  font-size: 24px;
}

/* Dark mode per back-to-top */
[data-bs-theme="dark"] .back-to-top {
  background-color: rgba(15, 23, 42, 0.9);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.3);
}

[data-bs-theme="dark"] .back-to-top:hover {
  background-color: rgba(15, 23, 42, 1);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.4);
}

.explore-more-container {
  z-index: -1 !important;
}

.search-list-item{
  cursor: pointer;
}

/* Stili per card-footer */
.card-footer {
  margin: -16px;
  padding-bottom: 23px;
}

/* Stili per card-header */
.card-header {
  padding-top: 15px;
  padding-bottom: 15px;
  background-color: var(--bs-card-cap-bg, rgba(0, 0, 0, 0.03));
}

.card-header h5 {
  margin-bottom: 0;
}

/* Stili per card-header in tema scuro */
[data-bs-theme="dark"] .card-header {
  background-color: var(--bs-card-cap-bg, var(--bs-body-bg-2)) !important;
}

/* Stili per card-footer - gestione background */
.card-footer {
  margin: -16px;
  padding-bottom: 23px;
  background-color: var(--bs-card-cap-bg, rgba(0, 0, 0, 0.03));
}

/* Stili per card-footer in tema scuro */
[data-bs-theme="dark"] .card-footer {
  background-color: var(--bs-card-cap-bg, var(--bs-body-bg-2)) !important;
}

/* Stili per breadcrumb */
.main-wrapper .main-content .page-breadcrumb .breadcrumb-item + .breadcrumb-item::before {
  display: inline-block;
  padding-right: 0.5rem;
  font-family: 'Noto Sans' !important;
  content: '›' !important;
}

/* Stili per Bootstrap File Input - File Preview in dark mode */
[data-bs-theme="dark"] .file-preview-frame {
  border-color: #495057 !important;
  background-color: var(--bs-body-bg) !important;
}

[data-bs-theme="dark"] .file-preview-frame:hover {
  border-color: #6c757d !important;
}

[data-bs-theme="dark"] .krajee-default.file-preview-frame {
  border-color: #495057 !important;
  background-color: var(--bs-body-bg) !important;
}

[data-bs-theme="dark"] .krajee-default.file-preview-frame:hover {
  border-color: #6c757d !important;
}

[data-bs-theme="dark"] .file-preview-image {
  border-color: #495057 !important;
}

[data-bs-theme="dark"] .file-preview {
  border-color: #495057 !important;
  background-color: var(--bs-body-bg) !important;
}

/* Stili per Bootstrap File Input - File Drop Zone in dark mode */
[data-bs-theme="dark"] .file-drop-zone {
  border-color: #495057 !important;
  background-color: var(--bs-body-bg) !important;
}

[data-bs-theme="dark"] .file-drop-zone:hover,
[data-bs-theme="dark"] .file-drop-zone.file-highlighted {
  border-color: #6c757d !important;
  background-color: var(--bs-body-bg) !important;
}

/* Stili per tutti gli input in dark mode - background #2c3236 */
[data-bs-theme="dark"] input[type="text"],
[data-bs-theme="dark"] input[type="email"],
[data-bs-theme="dark"] input[type="password"],
[data-bs-theme="dark"] input[type="number"],
[data-bs-theme="dark"] input[type="date"],
[data-bs-theme="dark"] input[type="time"],
[data-bs-theme="dark"] input[type="datetime-local"],
[data-bs-theme="dark"] input[type="search"],
[data-bs-theme="dark"] input[type="url"],
[data-bs-theme="dark"] input[type="tel"],
[data-bs-theme="dark"] textarea,
[data-bs-theme="dark"] select,
[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
  background-color: #2c3236 !important;
  color: #e2e8f0 !important;
  border-color: #495057 !important;
}

[data-bs-theme="dark"] input[type="text"]:focus,
[data-bs-theme="dark"] input[type="email"]:focus,
[data-bs-theme="dark"] input[type="password"]:focus,
[data-bs-theme="dark"] input[type="number"]:focus,
[data-bs-theme="dark"] input[type="date"]:focus,
[data-bs-theme="dark"] input[type="time"]:focus,
[data-bs-theme="dark"] input[type="datetime-local"]:focus,
[data-bs-theme="dark"] input[type="search"]:focus,
[data-bs-theme="dark"] input[type="url"]:focus,
[data-bs-theme="dark"] input[type="tel"]:focus,
[data-bs-theme="dark"] textarea:focus,
[data-bs-theme="dark"] select:focus,
[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
  background-color: #2c3236 !important;
  color: #e2e8f0 !important;
  border-color: #63b3ed !important;
  box-shadow: 0 0 0 0.2rem rgba(99, 179, 237, 0.25) !important;
}

/* Stili per Summernote editor - background bianco sempre */
.note-editor .note-editing-area .note-editable {
  background-color: #ffffff !important;
  color: #000000 !important;
}

.note-editor .note-editing-area .note-editable:focus {
  background-color: #ffffff !important;
  color: #000000 !important;
}

/* Stili per Bootstrap File Input in dark mode */
[data-bs-theme="dark"] .file-input input[type="file"],
[data-bs-theme="dark"] .file-caption input,
[data-bs-theme="dark"] .file-caption-name,
[data-bs-theme="dark"] .file-input-ajax-new .file-caption input,
[data-bs-theme="dark"] .file-input-ajax-new .file-caption-name,
[data-bs-theme="dark"] .kv-fileinput-caption input[type="text"] {
  background-color: #2c3236 !important;
  color: #e2e8f0 !important;
  border-color: #495057 !important;
}

[data-bs-theme="dark"] .file-caption input:focus,
[data-bs-theme="dark"] .file-input-ajax-new .file-caption input:focus,
[data-bs-theme="dark"] .kv-fileinput-caption input[type="text"]:focus {
  background-color: #2c3236 !important;
  color: #e2e8f0 !important;
  border-color: #63b3ed !important;
  box-shadow: 0 0 0 0.2rem rgba(99, 179, 237, 0.25) !important;
}

/* Effetto striped per tabelle - assicura che funzioni anche con DataTables */
.table-striped > tbody > tr:nth-of-type(odd) > * {
  background-color: rgba(0, 0, 0, 0.05) !important;
}

.table-striped > tbody > tr:nth-of-type(even) > * {
  background-color: transparent !important;
}

/* Dark mode per striped */
[data-bs-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd) > * {
  background-color: rgba(255, 255, 255, 0.05) !important;
}

[data-bs-theme="dark"] .table-striped > tbody > tr:nth-of-type(even) > * {
  background-color: transparent !important;
}

/* Effetto hover per datatable - classe riutilizzabile */
.table-hover-rows tbody tr {
  transition: background-color 0.2s ease;
  cursor: pointer;
}

.table-hover-rows tbody tr:hover > * {
  background-color: #f8f9fa !important;
}

/* Dark mode per hover datatable */
[data-bs-theme="dark"] .table-hover-rows tbody tr:hover > * {
  background-color: #2d3748 !important;
}

/* Classe per ombra enhanced delle card - riutilizzabile */
.card-shadow-enhanced {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15) !important;
}

/* Dark mode per card-shadow-enhanced - usa ombra più chiara per essere visibile */
[data-bs-theme="dark"] .card-shadow-enhanced {
  box-shadow: 0 10px 30px rgba(255, 255, 255, 0.05) !important;
}

/* Stili per le statistiche delle espansioni */
.expansion-stats {
  padding: 0.75rem 0;
}

.expansion-stats .progress {
  background-color: #e9ecef;
  overflow: visible;
}

[data-bs-theme="dark"] .expansion-stats .progress {
  background-color: #2d3748;
}

.expansion-stats .progress-bar {
  transition: width 0.6s ease;
  position: relative;
}

.expansion-stats .progress-bar.bg-primary {
  background-color: #0d6efd !important;
}

.expansion-stats .progress-bar.bg-info {
  background-color: #0dcaf0 !important;
}