* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --secondary: #06b6d4;
  --dark: #0f172a;
  --dark-light: #1e293b;
  --gray: #64748b;
  --light: #f1f5f9;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, sans-serif;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #fff;
  min-height: 100vh;
  font-size: 16px; /* Imposta una base per il responsive type */
  -webkit-text-size-adjust: 100%; /* Previene zoom su iOS */
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem; /* Padding ridotto per mobile */
}

/* Navigation */
nav {
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(10px);
  padding: 1rem 0; /* Padding ridotto per mobile */
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid rgba(99, 102, 241, 0.2);
}

nav .container {
  padding: 0 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap; /* Permette al logo e al menu di andare a capo se necessario */
}

.logo {
  font-size: 1.25rem; /* Dimensione ridotta per mobile */
  font-weight: 800;
  background: linear-gradient(135deg, #6366f1, #06b6d4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

nav ul {
  display: flex;
  list-style: none;
  gap: 1rem; /* Spaziatura ridotta */
  width: 100%; /* Occupa tutta la larghezza su mobile */
  justify-content: space-around; /* Distribuisce i link */
  margin-top: 0.5rem; /* Spazio dal logo */
  overflow-x: auto; /* Permette lo scorrimento orizzontale se non ci stanno */
  padding-bottom: 5px; /* Spazio per lo scrollbar */
}

nav a {
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s;
  position: relative;
  font-size: 0.9rem; /* Testo più piccolo */
  white-space: nowrap; /* Evita che i link vadano a capo */
  padding: 0.5rem 0.25rem;
}

nav a:hover {
  color: var(--secondary);
}

nav a.active::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary);
}

/* Page Content */
.page {
  padding: 6rem 0 3rem; /* Padding top ridotto per nav più piccola */
  min-height: 100vh;
}

/* Home Page */
.hero {
  text-align: center;
  padding: 2rem 0; /* Padding ridotto */
}

.hero h1 {
  font-size: 2.25rem; /* Dimensione ridotta per mobile */
  margin-bottom: 1rem;
  background: linear-gradient(135deg, #6366f1, #06b6d4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 900;
  line-height: 1.2;
}

.hero p {
  font-size: 1rem; /* Dimensione ridotta */
  color: var(--gray);
  margin-bottom: 2rem;
}

.features {
  display: grid;
  grid-template-columns: 1fr; /* Una colonna di default */
  gap: 1.5rem;
  margin-top: 2rem;
}

.featuresB {
  display: grid;
  grid-template-columns: 1fr; /* Una colonna di default */
  gap: 1.5rem;
  margin-top: 2rem;
}

.feature-card {
  background: linear-gradient(
    135deg,
    rgba(99, 102, 241, 0.1),
    rgba(6, 182, 212, 0.1)
  );
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 1rem;
  padding: 1.5rem; /* Padding ridotto */
  transition: transform 0.3s, box-shadow 0.3s;
}

.feature-card:hover {
  transform: none; /* Rimuovi hover su mobile */
  box-shadow: none;
}

.feature-icon {
  width: 50px; /* Icona più piccola */
  height: 50px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  margin-bottom: 1rem;
}

.feature-card h3 {
  font-size: 1.25rem; /* Testo più piccolo */
  margin-bottom: 0.75rem;
  color: #fff;
}

.feature-card p {
  color: var(--gray);
  line-height: 1.6;
  font-size: 0.9rem;
}

/* Stats Pages */
.stats-header {
  margin-bottom: 2rem;
}

.stats-header h2 {
  font-size: 1.75rem; /* Testo più piccolo */
  margin-bottom: 0.5rem;
  line-height: 1.2;
}

.stats-header p {
  color: var(--gray);
  font-size: 0.9rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr; /* Una colonna di default */
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 1rem;
  padding: 1rem; /* Padding ridotto */
}

.stat-card h4 {
  color: var(--gray);
  font-size: 0.75rem; /* Testo più piccolo */
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.stat-card .value {
  font-size: 1.75rem; /* Testo più piccolo */
  font-weight: 700;
  color: var(--secondary);
}

.stat-card .change {
  font-size: 0.8rem;
  margin-top: 0.25rem;
}

.change.positive {
  color: #10b981;
}

.change.negative {
  color: #ef4444;
}

.chart-container {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 1rem;
  padding: 1.5rem 1rem; /* Padding ridotto */
  margin-bottom: 1.5rem;
}

.chart-container h3 {
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.chart-placeholder {
  width: 100%;
  height: 250px; /* Altezza ridotta */
  background: linear-gradient(
    135deg,
    rgba(99, 102, 241, 0.05),
    rgba(6, 182, 212, 0.05)
  );
  border: 2px dashed rgba(99, 102, 241, 0.3);
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray);
  font-size: 1rem;
}

/* Forms */
.input-form {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 1rem;
  padding: 1.5rem 1rem; /* Padding ridotto */
  margin-bottom: 1.5rem;
}

.input-form h3 {
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr; /* Una colonna di default */
  gap: 1rem;
  margin-bottom: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  margin-bottom: 0.5rem;
  color: var(--gray);
  font-size: 0.8rem;
  font-weight: 600;
}

.form-group input,
.form-group select {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 0.5rem;
  padding: 0.75rem;
  color: #fff;
  font-size: 1rem;
  transition: border-color 0.3s;
  width: 100%; /* Assicura larghezza piena */
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
}

.btn {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border: none;
  border-radius: 0.5rem;
  padding: 0.875rem 1.5rem; /* Padding aggiornato */
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.3s, box-shadow 0.3s;
  width: 100%; /* Bottone a larghezza piena */
  font-size: 1rem;
}

.btn:hover {
  transform: none;
  box-shadow: none;
}

.btn:active {
  transform: translateY(1px); /* Effetto pressione su mobile */
}

/* Auth Pages (Login/Register) */
.auth-container {
  padding: 1rem; /* Padding per mobile */
}

.auth-card {
  padding: 2rem 1.5rem; /* Padding ridotto */
  width: 100%;
}

.auth-header h2 {
  font-size: 1.75rem;
}

/* Specifici Eco.php */
.movimento-item {
  flex-wrap: wrap; /* Permette di andare a capo */
  gap: 0.5rem;
  padding: 1rem 0;
}
.movimento-details {
  flex-grow: 1; /* Occupa lo spazio disponibile */
}
.movimento-importo {
  width: 100%;
  text-align: right;
  font-size: 1.1rem;
  margin-top: 0.5rem; /* Spazio se va a capo */
}

/* Specifici Bet.php */
#bet-slip-form .form-grid {
  grid-template-columns: 1fr; /* Stack per mobile */
}
.bet-event-header {
  flex-wrap: wrap;
}
.bet-event-header .form-group {
  width: 100%;
  margin-bottom: 1rem;
}
.btn-remove-event {
  margin-left: auto; /* Allinea a destra */
  padding: 0.5rem;
  line-height: 1;
}
.bet-event-body .form-grid {
  grid-template-columns: 1fr;
}
.bet-item-header {
  flex-wrap: wrap;
  gap: 0.5rem;
}
.bet-status {
  width: 100%;
  text-align: center;
  margin-top: 0.5rem;
}
.bet-item-actions {
  flex-wrap: wrap;
  gap: 0.5rem;
}
.bet-item-actions .btn-status {
  flex-grow: 1; /* I bottoni occupano lo spazio */
  min-width: 120px;
  text-align: center;
}

/* ============================ */
/* STILI TABLET (min-width: 640px) */
/* ============================ */
@media (min-width: 640px) {
  .container {
    padding: 0 1.5rem;
  }

  .logo {
    font-size: 1.35rem;
  }

  .page {
    padding-top: 7rem;
  }

  .hero h1 {
    font-size: 3rem;
  }
  .hero p {
    font-size: 1.1rem;
  }

  .stats-header h2 {
    font-size: 2rem;
  }
  .stats-header p {
    font-size: 1rem;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr; /* Due colonne */
  }

  .form-grid {
    grid-template-columns: 1fr 1fr; /* Due colonne */
  }

  .btn {
    width: auto; /* Larghezza automatica per bottoni */
  }

  .auth-container {
    padding: 2rem;
  }
  .auth-card {
    padding: 3rem;
  }

  /* Specifici Eco.php */
  .movimento-importo {
    width: auto;
    text-align: right;
    margin-top: 0;
  }

  /* Specifici Bet.php */
  #bet-slip-form .form-grid {
    grid-template-columns: 1fr 1fr;
  }
  .bet-event-body .form-grid {
    grid-template-columns: 1fr 1fr;
  }
  .bet-status {
    width: auto;
    margin-top: 0;
  }
  .bet-item-actions .btn-status {
    flex-grow: 0;
  }

  .hero {
    text-align: center;
    padding: 4rem 0;
  }
}

/* =============================== */
/* STILI DESKTOP (min-width: 1024px) */
/* =============================== */
@media (min-width: 1024px) {
  .container {
    padding: 0 2rem;
  }

  nav .container {
    padding: 0 2rem;
    flex-wrap: nowrap;
  }

  .logo {
    font-size: 1.5rem;
  }

  nav ul {
    gap: 2rem;
    width: auto;
    margin-top: 0;
    overflow-x: visible;
  }

  nav a {
    font-size: 1rem;
    padding: 0;
  }

  .page {
    padding-top: 8rem;
  }

  .hero {
    padding: 4rem 0 0;
  }

  .hero h1 {
    font-size: 4rem;
  }
  .hero p {
    font-size: 1.25rem;
  }

  .features {
    grid-template-columns: repeat(2, 1fr); /* Tre colonne */
    margin-top: 4rem;
  }

  .featuresB {
    grid-template-columns: repeat(3, 1fr); /* Tre colonne */
    margin-top: 4rem;
  }

  .feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 40px rgba(99, 102, 241, 0.3);
  }

  .feature-card {
    padding: 2rem;
  }
  .feature-icon {
    width: 60px;
    height: 60px;
  }
  .feature-card h3 {
    font-size: 1.5rem;
  }
  .feature-card p {
    font-size: 1rem;
  }

  .stats-header {
    margin-bottom: 3rem;
  }
  .stats-header h2 {
    font-size: 2.5rem;
  }

  .stats-grid {
    grid-template-columns: repeat(
      auto-fit,
      minmax(250px, 1fr)
    ); /* Layout originale */
    gap: 1.5rem;
    margin-bottom: 3rem;
  }

  .stat-card {
    padding: 1.5rem;
  }
  .stat-card h4 {
    font-size: 0.875rem;
  }
  .stat-card .value {
    font-size: 2rem;
  }
  .stat-card .change {
    font-size: 0.875rem;
  }

  .chart-container {
    padding: 2rem;
    margin-bottom: 2rem;
  }
  .chart-container h3 {
    font-size: 1.25rem;
  }

  .input-form {
    padding: 2rem;
    margin-bottom: 2rem;
  }
  .input-form h3 {
    font-size: 1.25rem;
  }

  .form-grid {
    grid-template-columns: repeat(
      auto-fit,
      minmax(200px, 1fr)
    ); /* Layout originale */
  }

  .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(99, 102, 241, 0.4);
  }

  .btn:active {
    transform: none;
  }
}

/* Stili Selettore Lingua */
.lang-switcher {
  display: flex;
  align-items: center;
  margin-left: 1rem;
}
.lang-switcher a {
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
}
.lang-switcher a.active {
  background: var(--primary);
  color: #fff;
}
.lang-switcher span {
  color: var(--gray);
  margin: 0 0.15rem;
}
nav ul {
  flex-wrap: wrap; /* Permette al menu di andare a capo */
}

@media (max-width: 640px) {
  .lang-switcher {
    margin-left: 0;
    margin-top: 0.5rem; /* Spazio in mobile */
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 425px) {
  .hero {
    text-align: center;
    padding: 0rem 0;
  }

  .hero h1 {
    margin-top: 100px;
  }
}

.app-description {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(99, 102, 241, 0.2);
}

.app-description .hero h2 {
  font-size: 2.25rem;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, #6366f1, #06b6d4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

@media (max-width: 768px) {
  .app-description {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
  }
  .app-description .hero h2 {
    font-size: 1.75rem;
  }
}

.install-alert {
  position: fixed;
  bottom: -200px; /* Nascosto di default */
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 450px;
  background: rgba(30, 41, 59, 0.95); /* Sfondo scuro */
  border: 1px solid var(--primary);
  border-radius: 1rem;
  padding: 1.5rem;
  z-index: 1002; /* Sopra il cookie banner */
  backdrop-filter: blur(5px);
  box-shadow: 0 -5px 30px rgba(0, 0, 0, 0.3);
  transition: bottom 0.5s ease-in-out;
  display: block; /* Sarà sempre un blocco, ma nascosto da 'bottom' */
}
.install-alert.show {
  bottom: 1rem; /* Mostra in posizione */
}
.install-alert-content h4 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 0.5rem;
}
.install-alert-content p {
  color: var(--gray);
  font-size: 0.875rem;
  margin-bottom: 1rem;
  line-height: 1.5;
}
.install-alert-actions {
  display: flex;
  gap: 0.5rem;
}
.install-alert-actions .btn {
  flex-grow: 1; /* Due bottoni di larghezza uguale */
  padding: 0.75rem;
  font-size: 0.9rem;
}
.install-alert-actions .btn-secondary {
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #a5b4fc;
}
.install-alert-actions .btn-secondary:hover {
  background: var(--dark-light);
  box-shadow: none;
  transform: none;
}

@media (max-width: 768px) {
  /* Sposta l'alert PWA sopra il cookie banner se è visibile */
  .cookie-banner-container:not([style*="display: none"]) + .install-alert.show {
    bottom: 6rem;
  }
}

/* --- NUOVI STILI HEADER MODERNO --- */

/* 1. Modifica Container Navigazione */
nav .container {
  flex-wrap: nowrap !important; /* Impedisce di andare a capo (Importante!) */
  gap: 1rem; /* Spazio tra logo, link e azioni */
}

/* 2. Nasconde il vecchio switcher lingua testuale */
.lang-switcher {
  display: none !important;
}

/* 3. Modifica la lista link principale (vecchio nav ul) */
nav ul {
  display: flex;
  list-style: none;
  gap: 1rem;
  width: auto; /* Sovrascrive 100% */
  flex-grow: 1; /* Occupa lo spazio centrale */
  min-width: 0; /* Permette di rimpicciolirsi */
  justify-content: flex-start; /* Allinea a sinistra */
  margin-top: 0 !important; /* Sovrascrive 0.5rem */
  overflow-x: auto !important; /* Abilita scorrimento orizzontale */
  overflow-y: hidden;
  padding-bottom: 5px !important;
  -ms-overflow-style: none; /* IE e Edge */
  scrollbar-width: none; /* Firefox */
}
/* Nasconde scrollbar per Chrome, Safari e Opera */
nav ul::-webkit-scrollbar {
  display: none;
}

/* Rinomina per chiarezza (usa la classe data in header.php) */
.nav-links {
  /* Questi stili sono già in 'nav ul' */
}

/* 4. Stili per i link */
.nav-links a {
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s;
  position: relative;
  font-size: 0.9rem;
  white-space: nowrap;
  padding: 0.5rem 0.25rem;
}
.nav-links a:hover {
  color: var(--secondary);
}
.nav-links a.active::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary);
}

/* 5. Nuovo Contenitore Azioni (User + Lingua) */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem; /* Spazio tra i due dropdown */
  flex-shrink: 0; /* Non rimpicciolire */
}

/* 6. Stili Dropdown Generici */
.dropdown {
  position: relative;
}

.dropdown-toggle {
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #a5b4fc;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
  transition: all 0.3s;
}
.dropdown-toggle:hover {
  background: var(--primary);
  color: white;
}
.dropdown-toggle .chevron {
  font-size: 0.7rem;
  transition: transform 0.2s;
}
.dropdown-toggle .user-icon {
  font-size: 1.1rem;
}

/* Bottone lingua specifico */
#lang-dropdown .dropdown-toggle {
  font-size: 1.25rem; /* Rende la bandiera più grande */
  padding: 0.5rem;
}

/* Nome utente (nascosto su mobile) */
.username-nav {
  display: none;
}

/* 7. Menu a tendina */
.dropdown-menu {
  display: none; /* Nascosto di default */
  position: absolute;
  top: 130%;
  right: 0;
  background: var(--dark-light);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 0.5rem;
  min-width: 150px;
  z-index: 1001;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  animation: fadeInDropdown 0.2s ease-out;
}

@keyframes fadeInDropdown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dropdown-menu.show {
  display: block;
}

.dropdown-menu a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  color: #fff;
  text-decoration: none;
  font-size: 0.9rem;
  white-space: nowrap;
}
/* Applica gli stili base di nav a anche ai link del dropdown */
.dropdown-menu a.nav-link {
  padding: 0.75rem 1rem !important; /* Sovrascrive padding strano */
  font-size: 0.9rem !important;
}

.dropdown-menu a:hover {
  background-color: var(--primary);
  color: #fff;
}
.dropdown-menu a.active {
  background-color: var(--primary-dark);
  font-weight: 600;
}

/* --- MEDIA QUERY per Desktop ( > 1024px) --- */
@media (min-width: 1024px) {
  nav ul {
    overflow-x: visible !important; /* Niente scroll su desktop */
    justify-content: flex-start;
    gap: 2rem !important;
    padding: 0 !important;
  }
  .nav-links a {
    font-size: 1rem !important;
    padding: 0 !important;
  }

  .username-nav {
    display: inline !important; /* Mostra il nome utente su desktop */
  }
}

/* --- STILI MENU HAMBURGER E MOBILE --- */

/* 1. Nascondi la navigazione desktop su mobile */
.desktop-nav {
  display: none; /* Nascosto di default */
}

/* 2. Bottone Hamburger (visibile solo su mobile) */
#mobile-menu-toggle {
  display: flex; /* Visibile di default (mobile-first) */
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
}
#mobile-menu-toggle span {
  display: block;
  width: 24px;
  height: 3px;
  background: #fff;
  border-radius: 2px;
  transition: all 0.3s;
}

/* 3. Contenitore Menu Mobile (Nascosto) */
#mobile-menu-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: var(--dark); /* Sfondo pieno */
  z-index: 2000; /* Sopra tutto */
  padding: 1rem;
  display: flex;
  flex-direction: column;
  transform: translateX(100%); /* Nascosto a destra */
  transition: transform 0.3s ease-in-out;
}
#mobile-menu-container.show {
  transform: translateX(0); /* Mostra */
}

/* 4. Header del Menu Mobile */
.mobile-menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 1rem;
  margin-bottom: 2rem;
  flex-shrink: 0;
}
#mobile-menu-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 2.5rem;
  font-weight: 300;
  cursor: pointer;
}

/* 5. Link nel Menu Mobile */
.mobile-nav-links {
  list-style: none;
  flex-grow: 1; /* Occupa lo spazio centrale */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  width: 100%;
}
.mobile-nav-links a {
  color: #fff;
  text-decoration: none;
  font-size: 1.75rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  position: relative;
}
.mobile-nav-links a.active {
  color: var(--primary);
}
.mobile-nav-links a.active::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 1rem;
  right: 1rem;
  height: 2px;
  background: var(--primary);
}

/* 6. Azioni (Utente/Lingua) nel Menu Mobile */
.mobile-nav-actions {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem;
  flex-shrink: 0;
}
.mobile-nav-actions .dropdown {
  width: 100%;
}
.mobile-nav-actions .dropdown-toggle {
  width: 100%;
  justify-content: center;
  padding: 1rem;
  font-size: 1rem;
}
.mobile-nav-actions .dropdown-toggle .chevron {
  margin-left: auto; /* Spinge la freccia a destra */
}
/* Stile specifico per nome utente mobile */
.mobile-nav-actions #user-dropdown-mobile .username-nav {
  display: inline; /* Mostra nome utente nel menu mobile */
  font-weight: 600;
}
/* Stile specifico per lingua mobile */
.mobile-nav-actions #lang-dropdown-mobile .dropdown-toggle {
  gap: 0.5rem;
  font-weight: 400;
}
.mobile-nav-actions .dropdown-menu {
  width: 100%; /* Menu dropdown a larghezza piena */
  bottom: 100%; /* Si apre verso l'alto */
  top: auto;
  animation: none; /* Rimuovi animazione fade-in */
}
.mobile-nav-actions .dropdown-menu a {
  font-size: 1rem;
}

/* --- MEDIA QUERY PER DESKTOP (min-width: 1024px) --- */
@media (min-width: 1024px) {
  /* Mostra la navigazione desktop */
  .desktop-nav {
    display: flex;
    align-items: center;
    flex-grow: 1; /* Occupa lo spazio centrale */
    min-width: 0; /* Permette di rimpicciolirsi */
  }

  /* Nascondi il bottone hamburger */
  #mobile-menu-toggle {
    display: none;
  }

  /* Stili Desktop che erano già presenti (leggermente modificati) */
  .desktop-nav .nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
    width: auto;
    flex-grow: 1;
    justify-content: flex-start;
    margin-top: 0;
    overflow-x: visible;
    padding-bottom: 0;
  }
  .desktop-nav .nav-links a {
    font-size: 1rem;
    padding: 0;
    white-space: nowrap;
  }
  .desktop-nav .nav-links a.active::after {
    bottom: -10px; /* Posizione linea 'active' */
  }

  .desktop-nav .nav-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem; /* Era 0.5rem, va bene */
    flex-shrink: 0;
  }
  .desktop-nav .dropdown-toggle .username-nav {
    display: inline; /* Mostra nome utente */
  }
}
/* --- MEDIA QUERY PER DESKTOP (min-width: 1024px) --- */
@media (min-width: 1024px) {
  /* ... stili desktop nav ... */
  .desktop-nav .dropdown-toggle .username-nav {
    display: inline; /* Mostra nome utente */
  }
}

/* Floating Action Button (NUOVO) */
.fab {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 2.5rem;
  font-weight: 300;
  line-height: 54px; /* Aggiustato per centrare il + */
  text-align: center;
  box-shadow: 0 5px 20px rgba(99, 102, 241, 0.4);
  cursor: pointer;
  z-index: 1010; /* Sopra la pagina, sotto il modal */
  transition: all 0.3s ease;
}
.fab:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.5);
}

@media (max-width: 768px) {
  .fab {
    bottom: 1.5rem;
    right: 1.5rem;
  }
  /* Se il cookie banner è visibile, sposta il FAB più in alto */
  .cookie-banner-container:not([style*="display: none"]) ~ .fab {
    bottom: 7rem; /* Abbastanza da superare il banner mobile (che è ~5rem) */
  }
}
