/**
 * 🎨 Settings Button Styles
 * 
 * Stili per il bottone di accessibilità fisso
 * Convertito da Tailwind CSS della guida React
 * 
 * @version 1.0
 * @author Inmotio
 */


.settings-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  font-family: 'Arial', sans-serif;
}

.settings-button {
  background: #460101;
  background: var(--inmotio-red, #460101);
  color: white;
  border: none;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(45, 90, 160, 0.3);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.settings-button:hover {
  background: #EDE6D2;
  background: var(--inmotio-light-gold, #EDE6D2);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(45, 90, 160, 0.4);
}

.settings-button:focus {
  outline: 3px solid #D5C28F;
  outline: 3px solid var(--inmotio-gold, #D5C28F);
  outline-offset: 2px;
}

.settings-button svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.settings-dropdown {
  position: absolute;
  bottom: 100%;
  right: 0;
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  max-width: max-content;

  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s ease;
  margin-bottom: 10px;
  border: 1px solid #e5e7eb;
}

.settings-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.settings-dropdown::after {
  content: '';
  position: absolute;
  top: 100%;
  right: 20px;
  border: 8px solid transparent;
  border-top-color: white;
}

.dropdown-header {
  padding: 16px 20px;
  border-bottom: 1px solid #e5e7eb;
  font-weight: 600;
  color: #460101;
  color: var(--inmotio-red, #460101);
  font-size: 16px;
}

.dropdown-content {
  padding: 12px 0;
}

.dropdown-item {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  color: #460101;
  color: var(--inmotio-red, #460101);
  text-decoration: none;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-size: 14px;
}

.dropdown-item:hover {
  background-color: #f3f4f6;
}

.dropdown-item:focus {
  background-color: #e5e7eb;
  outline: none;
}

.dropdown-item svg {
  width: 18px;
  height: 18px;
  margin-right: 12px;
  fill: #460101;
  fill: var(--inmotio-red, #460101);
}

.dropdown-separator {
  height: 1px;
  background-color: #e5e7eb;
  margin: 8px 0;
}

/* Animazioni e stati responsivi */
@media (max-width: 768px) {
  .settings-container {
    bottom: 15px;
    right: 15px;
  }
  
  .settings-button {
    width: 50px;
    height: 50px;
  }
  
  .settings-button svg {
    width: 20px;
    height: 20px;
  }
  
  .settings-dropdown {
    min-width: 220px;
  }
}

/* Accessibilità */
@media (prefers-reduced-motion: reduce) {
  .settings-button,
  .settings-dropdown,
  .dropdown-item {
    transition: none;
  }
}

/* Supporto per modalità scura */
@media (prefers-color-scheme: dark) {
  .settings-dropdown {
    background: var(--inmotio-red);
  }
  
  .dropdown-header,
  .dropdown-item {
    color: #EDE6D2;
    color: var(--inmotio-light-gold, #EDE6D2);
  }
  
 
}

/* 🎯 BOTTONE PRINCIPALE ACCESSIBILITÀ */
.settings-button {
  /* Posizionamento fisso - SPOSTATO A SINISTRA */
  position: fixed;
  bottom: .8rem;
  left: .8rem;
  
  /* Dimensioni */
  width: 3.8rem;   /* w-14 = 3.5rem = 56px */
  height: 3.8rem;  /* h-14 = 3.5rem = 56px */
  
  /* Stili base */
  background-color: var(--inmotio-red); 
  color: var(--inmotio-light-gold);
  border: 1px solid var(--inmotio-red);
  border-radius: 50%; /* rounded-full */
  cursor: pointer;
  
  /* Shadow e z-index */
  box-shadow: 0 10px 25px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); /* shadow-lg */
  z-index: 500001; /* Z-INDEX AGGIORNATO */
  
  /* Flexbox per centrare icona */
  display: flex;
  align-items: center;
  justify-content: center;
  
  /* Transizioni smooth */
  transition: all 0.3s ease;
  
  /* Font e icone */
  font-size: 24px;
  line-height: 1;
}

/* 🎯 HOVER EFFECTS */
.settings-button:hover {
  background-color: var(--inmotio-light-gold); 
  border: 1px solid var(--inmotio-red);
  color: var(--inmotio-red);
  
  box-shadow: 0 15px 30px -3px rgba(0, 0, 0, 0.15), 0 6px 8px -2px rgba(0, 0, 0, 0.1);
}

/* 🎯 ACTIVE STATE */
.settings-button:active {
  transform: translateY(0);
  box-shadow: 0 5px 15px -3px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
}

/* 🎯 DISABLED STATE (durante loading) */
.settings-button:disabled {
  background-color: #9ca3af; /* gray-400 */
  cursor: not-allowed;
  transform: none;
  box-shadow: 0 5px 15px -3px rgba(0, 0, 0, 0.1);
}

/* 🎯 ICONA ACCESSIBILITÀ */
.settings-button .icon {
  width: 24px;
  height: 24px;
  fill: currentColor;
  transition: transform 0.3s ease;
}

.settings-button:hover .icon {
  transform: scale(1.1);
  animation: gear-spin 0.4s ease-out forwards;
}

/* 🔄 ANIMAZIONE INGRANAGGIO - UN TERZO DI GIRO */
@keyframes gear-spin {
  0% { transform: scale(1.1) rotate(0deg); }
  100% { transform: scale(1.1) rotate(120deg); }
}

/* 🎯 SUPPORTO SPECIFICO PER ID settingsButton */
#settingsButton:hover .icon,
#settingsButton:hover svg,
#settingsButton:hover i {
  animation: gear-spin 0.4s ease-out forwards;
  transform: scale(1.1);
}

/* 🎯 SPINNER LOADING */
.settings-button .spinner {
  width: 24px;
  height: 24px;
  border: 2px solid white;
  border-top: 2px solid transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 🎯 TOOLTIP */
.settings-button::before {
  content: attr(aria-label);
  position: absolute;
  bottom: 100%;
  left: 0;
  transform: translateY(-8px);
  
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 14px;
  white-space: nowrap;
  
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.settings-button:hover::before {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* 🎯 RESPONSIVE - Mobile */
@media (max-width: 768px) {
  .settings-button {
    bottom: .8rem;
    left: .8rem;   /* MOBILE ANCHE A SINISTRA */
    width: 3.5rem;
    height: 3.5rem;
    font-size: 20px;
  }
  
  .settings-button .icon,
  .settings-button .spinner {
    width: 20px;
    height: 20px;
  }
  
  /* Nasconde tooltip su mobile */
  .settings-button::before {
    display: none;
  }
}

/* 🎯 ACCESSIBILITÀ */
.settings-button:focus {
  outline: 2px solid #3b82f6; /* blue-500 */
  outline-offset: 2px;
}

/* Riduce movimento per utenti con vestibular motion disorders */
@media (prefers-reduced-motion: reduce) {
  .settings-button,
  .settings-button .icon,
  .settings-button::before {
    transition: none;
    animation: none;
  }
  
  .settings-button:hover {
    transform: none;
  }
  
  /* Disabilita animazione ingranaggio per utenti con motion sensitivity */
  .settings-button:hover .icon,
  #settingsButton:hover .icon,
  #settingsButton:hover svg,
  #settingsButton:hover i {
    animation: none;
    transform: scale(1.1);
  }
}

/* 🎯 HIGH CONTRAST MODE */
@media (prefers-contrast: high) {
  .settings-button {
    border: 2px solid white;
    background-color: #000;
  }
  
  .settings-button:hover {
    background-color: #333;
  }
}

/* 🎯 NUOVO DROPDOWN MENU - Rifattorizzato completamente */
.settings-container {
  position: relative;
  display: inline-block;
  z-index: 500001;
  width: 100%;
  height: auto;
  max-height: 5rem;
}

.settings-dropdown {
  /* Posizionamento fisso come il pulsante - SPOSTATO A SINISTRA */
  position: fixed;
  bottom: 80px; /* Sopra il pulsante settings (56px + 24px margin) */
  left: 20px;   /* Allineato al pulsante settings A SINISTRA */
  
  /* Layout */
  min-width: 240px;
  background: #ffffff;
  border-radius: 16px;
  
  /* Ombre moderne */
  box-shadow: 
    0 20px 25px -5px rgba(0, 0, 0, 0.1),
    0 10px 10px -5px rgba(0, 0, 0, 0.04),
    0 0 0 1px rgba(0, 0, 0, 0.05);
  
  /* Stato nascosto iniziale */
  opacity: 0;
  visibility: hidden;
  transform: translateY(15px) scale(0.95);
  
  /* Animazione fluida */
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  
  /* Z-index massimo AGGIORNATO */
  z-index: 500001;
  
  /* Prevent text selection */
  user-select: none;
}

/* Stato attivo del dropdown */
.settings-dropdown.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* Menu lista */
.settings-dropdown-menu {
  list-style: none;
  margin: 0;
  padding: 1rem 0;
}

/* Item del menu */
.settings-dropdown-item {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 1rem 1.25rem;
  margin: 0;
  border-radius: 2rem;
  
  /* Reset stili */
  background: transparent;
  border: none;
  text-decoration: none;
  cursor: pointer;
  
  /* Typography */
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 1.25rem;
  font-weight: 500;
  line-height: 1.4;
  color: #1f2937;
  text-align: left;
  
  /* Transizioni */
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Flex gap per icone */
  gap: 1rem;
}

/* Hover effect uguale per TUTTI gli item del dropdown */
.settings-dropdown-item:hover,
.settings-dropdown-menu li:hover,
.settings-dropdown-menu li:hover .settings-dropdown-item {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%) !important;
  color: var(--inmotio-red) !important;
}

.settings-dropdown-item:focus {
  outline: none;
  background: var(--inmotio-light-gold);
  color: var(--inmotio-red);
  box-shadow: none;
}

.settings-dropdown-item:active {
  background: #e2e8f0;
  transform: scale(0.98);
}

/* Icone */
.settings-dropdown-item .icon {
  width: 20px;
  height: 20px;
  opacity: 0.8;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.settings-dropdown-item:hover .icon {
  opacity: 1;
  transform: scale(1.1);
}

/* Separatori sottili - RIMOSSI */
.settings-dropdown-item:not(:last-child) {
  border-bottom: none;
}

/* Freccia puntatore - RIMOSSA */
.settings-dropdown::after {
  display: none;
}

/* Stati di caricamento */
.settings-dropdown-item.loading {
  opacity: 0.5;
  pointer-events: none;
  position: relative;
}

.settings-dropdown-item.loading::after {
  content: '';
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  border: 2px solid var(--inmotio-light-gold);
  border-top: 2px solid var(--inmotio-red);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.cky-btn-revisit-wrapper {
  visibility: hidden !important;
}
.cky-btn-revisit {
  visibility: hidden !important;
}

@keyframes spin {
  to { transform: translateY(-50%) rotate(360deg); }
}

/* 📱 RESPONSIVE - Mobile */
@media (max-width: 768px) {
  .settings-dropdown {
    min-width: 260px;
    bottom: 75px; /* Sopra il pulsante mobile (50px + 25px margin) */
    left: 15px;   /* Allineato al pulsante mobile A SINISTRA */
    border-radius: 20px;
  }
  
  .settings-dropdown-item {
    padding: 18px 24px;
    font-size: 16px;
    gap: 16px;
  }
  
  .settings-dropdown-item .icon {
    width: 22px;
    height: 22px;
  }
  
  .settings-dropdown::after {
    display: none;
  }
}

/* 🌙 DARK MODE SUPPORT */
@media (prefers-color-scheme: dark) {
  .settings-dropdown {
    background: var(--inmotio-red);
    box-shadow: 
      0 20px 25px -5px rgba(0, 0, 0, 0.4),
      0 10px 10px -5px rgba(0, 0, 0, 0.2),
      0 0 0 1px rgba(255, 255, 255, 0.05);
  }
  
  .settings-dropdown-item {
    color: var(--inmotio-light-gold);
  }
  
  .settings-dropdown-item:hover {
    background: var(--inmotio-light-gold);
    color: var(--inmotio-red);
  }
  
  .settings-dropdown-item:focus {
    background: var(--inmotio-red);
    color: var(--inmotio-light-gold);
  }
  
  .settings-dropdown::after {
    display: none;
  }
}

/* 🎭 REDUCED MOTION */
@media (prefers-reduced-motion: reduce) {
  .settings-dropdown {
    transition: opacity 0.2s ease;
    transform: none;
  }
  
  .settings-dropdown.open {
    transform: none;
  }
  
  .settings-dropdown-item {
    transition: background-color 0.15s ease;
  }
  
  .settings-dropdown-item:hover {
    transform: none;
  }
  
  .settings-dropdown-item:active {
    transform: none;
  }
}

/* 🎨 HIGH CONTRAST */
@media (prefers-contrast: high) {
  .settings-dropdown {
    border: 3px solid #000000;
    background: #ffffff;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
  }
  
  .settings-dropdown-item {
    color: #000000;
    border-bottom-color: #000000;
  }
  
  .settings-dropdown-item:hover,
  .settings-dropdown-item:focus {
    background: #000000;
    color: #ffffff;
  }
}
.cya11y-widget-icon{
  z-index: 1!important;
  visibility: hidden!important;
  opacity: 0!important;
}

/* 🙈 NASCONDE SOLO IL BOTTONE ORIGINALE ACCESSYES */
/* Nasconde il bottone nel Shadow DOM */
.cyally-menu-btn,
.cya11y-menu-btn{
  /* Nasconde completamente il bottone */
  opacity: 0 !important;
  visibility: hidden !important;
  z-index: -9999 !important;
  pointer-events: none !important;
  
  /* Rimuove dallo spazio */
  position: absolute !important;
  top: -9999px !important;
  left: -9999px !important;
  
  /* Dimensioni zero */
  width: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

