/* === ONIRIKA - STYLE.CSS DEFINITIVO === */
/* Sistema temporale onirico + particelle cosmiche + performance ottimizzata */

/* === OROLOGIO ONIRICO - VARIABILI DINAMICHE === */
:root {
  /* Colori dinamici (controllati da JavaScript) */
  --onirika-primary: #3a0ca3;
  --onirika-secondary: #7209b7;
  --onirika-accent: #f72585;

  /* Gradiente circolare dinamico */
  --onirika-gradient: radial-gradient(circle,
      var(--onirika-primary) 0%,
      var(--onirika-secondary) 50%,
      var(--onirika-accent) 100%);

  /* 🎨 Colori più scuri per il body */
  --onirika-bg-primary: #585618;
  --onirika-bg-secondary: #562e63;
  --onirika-bg-accent: #3c3c6e;

  /* Gradiente per il body */
  --onirika-body-gradient: radial-gradient(circle,
      var(--onirika-bg-primary) 0%,
      var(--onirika-bg-secondary) 50%,
      var(--onirika-bg-accent) 100%);
}

/* === ANIMAZIONI PARTICELLE === */
@keyframes distant-float-1 {

  0%,
  100% {
    transform: translate(0px, 0px);
    opacity: 0.7;
  }

  50% {
    transform: translate(8px, -12px);
    opacity: 0.9;
  }
}

@keyframes distant-float-2 {

  0%,
  100% {
    transform: translate(0px, 0px);
    opacity: 0.8;
  }

  33% {
    transform: translate(-6px, 4px);
    opacity: 0.6;
  }

  66% {
    transform: translate(4px, -8px);
    opacity: 1;
  }
}

/* === TYPOGRAPHY UNIFICATA === */
:root {
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-size-h1: 24px;
  --font-size-h2: 20px;
  --font-size-body: 17px;
  --font-size-small: 15px;
}

/* === BASE === */
body {
  margin: 0;
  font-family: var(--font-primary);
  /* Gradiente dinamico a tutta pagina - stringato */
  background: var(--onirika-gradient);
  background-size: 100% 150%;
  background-attachment: fixed;
  transition: background 3s ease-in-out;
  color: #e2e8f0;
  line-height: 1.6;
  overflow: auto !important;
  min-height: 100vh;
  position: relative;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  font-size: 16px;
}

/* Padding solo per pagine con header fisso */
body:has(.onirika-map-header) {
  padding-top: 70px;
}

/* === CONTENITORE UNIFICATO PER TUTTE LE PAGINE === */
.onirika-page-wrapper {
  max-width: 1400px;
  margin: 0 auto;
  padding: 48px 24px 24px 24px; /* Più spazio in alto */
  min-height: calc(100vh - 140px); /* viewport - header - footer */
}

/* === LISTA TEAM COMPATTA === */
.team-list-compact {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 800px;
  margin: 0 auto;
}

.team-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.3s ease;
}

.team-item:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--item-color);
  transform: translateX(4px);
}

.team-item-badge {
  width: 4px;
  height: 40px;
  border-radius: 2px;
  flex-shrink: 0;
}

.team-item-content {
  flex: 1;
}

.team-item-name {
  margin: 0 0 4px 0;
  font-size: 1.1rem;
  font-weight: 500;
  color: #e2e8f0;
}

.team-item-id {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 400;
  margin-left: 8px;
}

.team-item-role {
  margin: 0;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.6);
}

.team-item-icon {
  margin-left: 8px;
  font-size: 1rem;
}

.team-item-arrow {
  color: var(--item-color);
  font-size: 1.5rem;
  opacity: 0.5;
  transition: opacity 0.3s ease;
}

.team-item:hover .team-item-arrow {
  opacity: 1;
}

/* === TEAM PAGE LAYOUT === */
.team-container {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  max-width: 1400px;
  margin: 0 auto;
}

.team-main {
  flex: 1;
  min-width: 0;
}

.team-sidebar {
  width: 380px;
  flex-shrink: 0;
  position: sticky;
  top: 90px;
}

/* === TEAM ACTIONS BAR === */
.team-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  align-items: center;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.team-search-input {
  flex: 1;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #e2e8f0;
  font-size: 0.95rem;
  transition: all 0.3s ease;
}

.team-search-input:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.3);
}

.team-search-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.team-info-btn {
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: #e2e8f0;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.95rem;
  white-space: nowrap;
}

.team-info-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

/* === PREVIEW CARD === */
.team-preview-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 0;
  min-height: 500px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.preview-placeholder {
  text-align: center;
  padding: 80px 30px;
  color: rgba(255, 255, 255, 0.4);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 500px;
}

.preview-icon {
  font-size: 4rem;
  margin-bottom: 20px;
  opacity: 0.5;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.3; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.1); }
}

.preview-placeholder p {
  font-size: 1rem;
  line-height: 1.6;
  margin: 0;
}

/* PREVIEW HEADER */
.preview-header {
  background: rgba(255, 255, 255, 0.05);
  padding: 24px;
  border-left: 4px solid;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.preview-image {
  width: 100%;
  height: 240px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 8px;
  border: 2px solid rgba(255, 255, 255, 0.1);
}

.preview-no-image {
  width: 100%;
  height: 240px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  color: rgba(255, 255, 255, 0.2);
  border: 2px dashed rgba(255, 255, 255, 0.1);
  margin-bottom: 8px;
}

.preview-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.preview-info h3 {
  margin: 0;
  font-size: 1.4rem;
  color: #e2e8f0;
  flex: 1;
}

.preview-id {
  background: rgba(255, 255, 255, 0.1);
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: bold;
  color: rgba(255, 255, 255, 0.7);
  font-family: 'Courier New', monospace;
}

/* PREVIEW BODY */
.preview-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.preview-field {
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.preview-field:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.preview-field strong {
  display: block;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.preview-field p,
.preview-field a,
.preview-field span {
  color: #e2e8f0;
  font-size: 0.95rem;
  margin: 0;
}

.preview-field a {
  color: #60a5fa;
  text-decoration: none;
  word-break: break-all;
  transition: color 0.2s ease;
}

.preview-field a:hover {
  color: #93c5fd;
  text-decoration: underline;
}

.preview-desc {
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.8) !important;
}

/* PREVIEW FOOTER */
.preview-footer {
  padding: 20px 24px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.preview-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  text-align: center;
}

.preview-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  opacity: 0.9;
}

/* === RESPONSIVE DESIGN === */
@media (max-width: 1024px) {
  .team-container {
    flex-direction: column;
  }

  .team-sidebar {
    width: 100%;
    position: static;
    max-width: 600px;
    margin: 0 auto;
  }

  .team-preview-card {
    min-height: 400px;
  }

  .preview-placeholder {
    min-height: 400px;
    padding: 60px 20px;
  }
}

@media (max-width: 768px) {
  .team-actions {
    flex-direction: column;
    gap: 8px;
  }

  .team-search-input,
  .team-info-btn {
    width: 100%;
  }

  .preview-image,
  .preview-no-image {
    height: 180px;
  }

  .preview-info {
    flex-direction: column;
    align-items: flex-start;
  }

  .preview-info h3 {
    font-size: 1.2rem;
  }
}

/* === TITOLI PAGINA CON EFFETTO BLURRED/FROSTED === */
.onirika-page-title h1,
h1.onirika-title-blur,
.page-header h1,
.spirale-title,
.archive-header h1 {
  color: rgba(255, 255, 255, 0.9);
  text-shadow:
    0 0 30px rgba(255, 255, 255, 0.5),
    0 0 50px rgba(255, 255, 255, 0.3),
    0 0 80px rgba(255, 255, 255, 0.2),
    0 4px 20px rgba(0, 0, 0, 0.6),
    0 2px 8px rgba(0, 0, 0, 0.8);
  filter: blur(0.5px);
  -webkit-filter: blur(0.5px);
  letter-spacing: 0.05em;
  font-weight: 500;
  background: rgba(0, 0, 0, 0.2);
  padding: 12px 24px;
  border-radius: 8px;
  display: inline-block;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* Margine superiore uniforme per tutti i contenitori principali */
main,
.home-container,
.main-content,
.container {
  margin-top: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* Spacing interno per sezioni */
main > section:first-child,
main > h1:first-child,
main > .page-header:first-child {
  margin-top: 0;
}

/* === HEADER UNIFICATO STILE MAPPA === */
.onirika-map-header {
  background: linear-gradient(135deg, rgba(40, 40, 45, 0.5) 0%, rgba(60, 60, 70, 0.5) 50%, rgba(80, 80, 90, 0.5) 100%);
  backdrop-filter: blur(10px);
  color: white;
  padding: 16px 24px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  font-family: var(--font-primary);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.onirika-map-header.header-hidden {
  transform: translateY(-100%);
  opacity: 0;
}

.header-content {
  /* Full width - allineato con container */
}

.header-top {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 8px;
}

.onirika-map-header h1 {
  font-size: var(--font-size-h1);
  margin: 0;
  font-weight: 600;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  letter-spacing: 0.5px;
}

.header-subtitle {
  font-size: var(--font-size-small);
  opacity: 0.85;
  font-style: italic;
}

.header-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.main-nav {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.main-nav a {
  color: rgba(254, 240, 138, 1);
  text-decoration: none;
  font-size: var(--font-size-small);
  transition: color 0.2s ease;
  padding: 2px 0;
}

.main-nav a:hover {
  color: rgba(251, 191, 36, 1);
}

.main-nav a.nav-special {
  color: rgba(196, 181, 253, 1);
}

.main-nav a.nav-special:hover {
  color: rgba(233, 213, 255, 1);
}

.lang-switcher {
  display: flex;
  gap: 6px;
}

.language-switch {
  display: inline-block;
  padding: 2px 6px;
  font-size: 14px;
  text-decoration: none;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.language-switch:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}

.language-switch.active {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 215, 0, 0.5);
  box-shadow: 0 0 8px rgba(255, 215, 0, 0.3);
}

/* === MODAL === */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 9999;
  display: none;
  /* Modale nascosta di default */
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: #fff;
  color: #222;
  padding: 2rem;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  border-radius: 8px;
  position: relative;
}

.modal-content .close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 1.5rem;
  cursor: pointer;
}


/* === MODAL - ESTENSIONI PER ONIRIKA === */
/* Aggiungere DOPO la sezione === MODAL === esistente */

/* Modale visibile quando attivata */
.modal.show {
  display: flex;
}

/* Pulsante di apertura modale */
.team-intro-button {
  text-align: center;
  margin: 2rem 0;
  padding: 1rem;
}

.onirika-info-btn {
  background: linear-gradient(45deg, #6b46c1, #8b5cf6);
  border: none;
  color: white;
  padding: 1rem 2rem;
  border-radius: 25px;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Courier New', monospace;
}

.onirika-info-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.5);
  background: linear-gradient(45deg, #7c3aed, #a855f7);
}

/* Personalizzazione contenuto modale per tema Onirika */
.modal-content.onirika-theme {
  background: linear-gradient(135deg, #1e1b4b, #312e81);
  color: #e0d0ff;
  border: 1px solid rgba(139, 92, 246, 0.3);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  max-width: 700px;
  font-family: 'Courier New', monospace;
}

.modal-content.onirika-theme .close {
  color: #c084fc;
  transition: color 0.3s ease;
}

.modal-content.onirika-theme .close:hover {
  color: #f0abfc;
}

.onirika-modal-title {
  font-size: 2rem;
  background: linear-gradient(45deg, #f0abfc, #c084fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 1.5rem;
  text-align: center;
}

.modal-content.onirika-theme h3 {
  color: #c084fc;
  font-size: 1.3rem;
  margin-top: 2rem;
  margin-bottom: 1rem;
  border-bottom: 2px solid rgba(139, 92, 246, 0.3);
  padding-bottom: 0.5rem;
}

.onirika-modal-note {
  margin-top: 2rem;
  font-size: 0.7rem;
  text-align: center;
  font-style: italic;
}

.modal-content.onirika-theme p {
  line-height: 1.7;
  margin-bottom: 1.2rem;
}

.onirika-highlight {
  color: #f0abfc;
  font-weight: bold;
}

.onirika-specialization-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.onirika-spec-card {
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 10px;
  padding: 1rem;
  text-align: center;
  transition: all 0.3s ease;
}

.onirika-spec-card:hover {
  background: rgba(139, 92, 246, 0.2);
  transform: translateY(-2px);
}

.onirika-spec-emoji {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.onirika-warning-box {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 8px;
  padding: 1rem;
  margin: 1.5rem 0;
}

.onirika-warning-box::before {
  content: "⚠️ ";
  font-size: 1.2rem;
}

/* Scrollbar personalizzata per il tema scuro */
.modal-content.onirika-theme::-webkit-scrollbar {
  width: 8px;
}

.modal-content.onirika-theme::-webkit-scrollbar-track {
  background: rgba(139, 92, 246, 0.1);
  border-radius: 4px;
}

.modal-content.onirika-theme::-webkit-scrollbar-thumb {
  background: rgba(139, 92, 246, 0.5);
  border-radius: 4px;
}

.modal-content.onirika-theme::-webkit-scrollbar-thumb:hover {
  background: rgba(139, 92, 246, 0.7);
}

/* === RESPONSIVE DESIGN === */
@media (max-width: 768px) {
  .modal-content.onirika-theme {
    margin: 1rem;
    padding: 1.5rem;
    max-width: calc(100% - 2rem);
  }

  .onirika-modal-title {
    font-size: 1.5rem;
  }

  .onirika-specialization-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.8rem;
  }

  .onirika-info-btn {
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .modal-content.onirika-theme {
    padding: 1rem;
    margin: 0.5rem;
    max-width: calc(100% - 1rem);
  }

  .onirika-specialization-grid {
    grid-template-columns: 1fr;
  }
}


/* === MAIN CONTENT - TRASPARENTE PER BODY GRADIENT === */
main {
  /* Padding rimosso - gestito dal wrapper */
  max-width: none;
  margin: 0;
  padding: 0;
}

/* Home usa il suo layout flex */
main.home-main {
  max-width: none;
  margin: 0;
  padding: 0;
}

/* === SISTEMA PARTICELLE COSMICHE (25 CORPI CELESTI) === */
.test-particles {
  position: relative;
  overflow: hidden;
  z-index: 1;
}

/* Pianeti piccoli e medi (15 corpi - dimensioni 4-11px) */
.test-particles::before {
  content: "";
  position: absolute;
  top: 20%;
  left: 15%;
  width: 4px;
  height: 4px;
  background: radial-gradient(circle, #ff006e, #8b0040);
  border-radius: 50%;
  opacity: 0.7;

  box-shadow:
    0 0 0 0 transparent,
    100px 50px 0 0 #ff006e,
    /* 4px */
    -90px 110px 0 1px #8338ec,
    /* 5px */
    180px -30px 0 0 #3a86ff,
    /* 4px */
    -140px -70px 0 2px #06ffa5,
    /* 6px */
    260px 160px 0 1px #ff006e,
    /* 5px */
    -180px 140px 0 3px #c77dff,
    /* 7px */
    300px -90px 0 2px #8338ec,
    /* 6px */
    -230px -110px 0 4px #560bad,
    /* 8px */
    160px 180px 0 3px #3a86ff,
    /* 7px */
    -300px 40px 0 5px #06ffa5,
    /* 9px */
    350px 110px 0 4px #ff006e,
    /* 8px */
    -160px 220px 0 6px #8338ec,
    /* 10px */
    220px -140px 0 5px #c77dff,
    /* 9px */
    -380px 160px 0 7px #ff9500;
  /* 11px */

  animation: distant-float-1 55s ease-in-out infinite;
  will-change: transform;
  z-index: -1;
}

/* Stelle dorate (10 corpi - dimensioni 11-23px) */
.test-particles::after {
  content: "";
  position: absolute;
  top: 40%;
  right: 20%;
  width: 14px;
  height: 14px;
  background: radial-gradient(circle, #ffd60a 0%, #ffbe0b 40%, #ff9500 70%, #cc7700 100%);
  border-radius: 50%;
  opacity: 0.8;
  box-shadow: 0 0 15px rgba(255, 214, 10, 0.4);

  box-shadow:
    0 0 15px rgba(255, 214, 10, 0.4),
    /* Glow principale */
    -140px 90px 0 -3px #ffd60a,
    /* 11px */
    200px -70px 0 -1px #ffbe0b,
    /* 13px */
    -100px -120px 0 1px #ff9500,
    /* 15px */
    280px 50px 0 2px #ffd60a,
    /* 16px */
    -260px 180px 0 3px #ff8500,
    /* 17px */
    140px 160px 0 4px #ffd60a,
    /* 18px */
    -180px -50px 0 6px #ffbe0b,
    /* 20px */
    320px -100px 0 5px #ff9500,
    /* 19px */
    -320px 100px 0 9px #ffd60a;
  /* 23px */

  animation: distant-float-2 70s ease-in-out infinite;
  animation-delay: -35s;
  will-change: transform;
  z-index: -1;
}

/* === TYPOGRAPHY === */
h2 {
  color: #f72585;
  border-bottom: 1px solid #7209b7;
  padding-bottom: 0.3rem;
}

article.post {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px dashed #4cc9f0;
}

.meta {
  font-size: 0.9rem;
  color: #999;
}

/* === MANIFESTO === */
#manifesto-onirika {
  font-family: 'Courier New', monospace;
  line-height: 1.6;
  color: #e0e0e0;
  background-color: rgba(65, 62, 62, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  padding: 2rem;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  margin: 2rem auto;
  max-width: 800px;
  text-shadow: 0 0 2px rgba(255, 255, 255, 0.05);
  letter-spacing: 0.02em;
  line-height: 1.7;
}

#manifesto-onirika h2 {
  font-size: 2rem;
  color: #ff66cc;
  margin-bottom: 0.5rem;
}

#manifesto-onirika p {
  margin-bottom: 1.5rem;
}

#manifesto-onirika strong {
  color: #ffcc00;
}

#manifesto-onirika em {
  color: #999;
  font-style: italic;
}

/* === HOME LAYOUT 2 COLONNE === */
.home-container {
  display: flex;
  min-height: calc(100vh - 140px);
  gap: 0;
  padding: 0; /* Padding gestito dal wrapper */
  max-width: none; /* Width gestito dal wrapper */
  margin: 0;
  background: transparent;
}

.home-main {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

/* === BOX STILE MINIMALE === */

/* Base Box - Completamente trasparente */
.box {
  background: transparent;
  border-radius: 0;
  padding: 24px;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  transition: all 0.3s ease;
  cursor: pointer;
}

.box:hover {
  transform: translateY(-2px);
  background: rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(10px);
}

.box h2 {
  font-size: var(--font-size-h2);
  margin: 0 0 12px 0;
  color: #e2e8f0;
  font-weight: 500;
  font-family: var(--font-primary);
}

.box-content {
  font-size: var(--font-size-body);
  line-height: 1.6;
  color: #cbd5e1;
  font-family: var(--font-primary);
}

.box-content p {
  margin: 0 0 10px 0;
}

.box-content ul {
  margin: 0;
  padding-left: 0;
  list-style: none;
}

.box-content li {
  margin-bottom: 8px;
}

.box-content li a {
  color: #a78bfa;
  text-decoration: none;
  transition: color 0.2s;
}

.box-content li a:hover {
  color: #c4b5fd;
}

.box > a {
  display: inline-block;
  margin-top: 12px;
  font-size: 13px;
  color: #94a3b8;
  text-decoration: none;
  transition: color 0.2s;
}

.box > a:hover {
  color: #a78bfa;
}

/* Layout Variants */
.box-hero {
  grid-column: span 3;
}

.box-featured {
  grid-column: span 1;
}

/* Bollettino più largo per riempire la seconda riga */
.box-scritti {
  grid-column: span 2;
}

.box-compact {
  grid-column: span 1;
}

.box-service {
  grid-column: span 3;
}


/* === SIDEBAR INFO === */
.home-sidebar {
  width: 350px;
  flex-shrink: 0;
}

.sidebar-panel {
  background: transparent;
  border-radius: 0;
  padding: 20px;
  border: none;
}

.sidebar-title {
  font-size: 16px;
  color: #e2e8f0;
  margin: 0 0 16px 0;
  font-weight: 500;
}

.sidebar-content {
  font-size: var(--font-size-body);
  color: #cbd5e1;
  line-height: 1.6;
}

.sidebar-section {
  margin-bottom: 24px;
}

.sidebar-section:last-child {
  margin-bottom: 0;
}

.sidebar-section h3 {
  font-size: 14px;
  color: #94a3b8;
  margin: 0 0 12px 0;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sidebar-section p {
  margin: 0 0 8px 0;
}

.sidebar-highlight {
  background: transparent;
  padding: 12px;
  border-radius: 0;
  margin: 10px 0;
  border: none;
}

.sidebar-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 12px;
}

.stat-item {
  background: transparent;
  padding: 12px;
  border-radius: 0;
  text-align: center;
  border: none;
}

.stat-value {
  font-size: 20px;
  font-weight: 600;
  color: #a78bfa;
  display: block;
}

.stat-label {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 4px;
  display: block;
}

/* Layout alternativo per home nuova */
.box-manifesto {
  grid-column: span 6;
  border-left-color: #f72585;
}

.box-biografico {
  grid-column: span 3;
  border-left-color: #4cc9f0;
}

.box-oracolo {
  grid-column: span 3;
  border-left-color: #ffd60a;
}

.box-cta {
  grid-column: span 8;
  border-left-color: #4361ee;
}

.box-oggetto {
  grid-column: span 4;
  border-left-color: #ff99c8;
}

/* === ULTIMA RIGA - LABORATORIO E CONSULENZA SU STESSA RIGA === */
.box-laboratorio,
.box-lab {
  grid-column: span 6;
  border-left-color: #ff6b6b;
}

.box-consulenza,
.box-chatbot {
  grid-column: span 6;
  border-left-color: #ff99c8;
}

/* Se il chatbot è separato dalla consulenza */
.box-consulenza:not(.box-chatbot) {
  grid-column: span 6;
  border-left-color: #ff99c8;
}

/* Compatibilità nomi alternativi */
.box-mappa {
  grid-column: span 8;
  border-left-color: #4361ee;
}

/* === EMOJI PICKER === */
.emoji-picker {
  display: none;
  position: absolute;
  background: #111;
  color: #eee;
  border: 1px solid #444;
  border-radius: 6px;
  padding: 5px;
  font-size: 20px;
  max-width: 200px;
  flex-wrap: wrap;
  z-index: 1000;
}

.emoji-picker span {
  cursor: pointer;
  margin: 3px;
  display: inline-block;
  transition: transform 0.1s ease;
}

.emoji-picker span:hover {
  transform: scale(1.4);
  filter: hue-rotate(180deg);
}

input.emoji-input {
  background: transparent;
  border: none;
  font-weight: bold;
  display: inline-block;
  min-width: 1em;
  max-width: 1em;
  height: 2.5em;
  font-size: 1.6em;
  padding: 2px 8px;
  text-align: left;
  overflow: hidden;
}

input.emoji-input:focus {
  border-color: #66f;
  box-shadow: 0 0 3px #66f;
  outline: none;
}

/* === FOOTER === */
footer {
  text-align: center;
  padding: 2rem;
  color: #888;
  background-color: #111;
  font-size: 0.9rem;
  border-top: 1px solid #333;
}

.footer-content {
  text-align: center;
}

.footer-subtitle {
  margin-top: 0.5rem;
  color: #666;
  font-style: italic;
}

.footer-symbol {
  margin-top: 1rem;
  font-size: 2rem;
  color: #4CAF50;
  opacity: 0.7;
}

/* === OROLOGIO ONIRICO - UI === */
#onirika-time-info {
  position: fixed;
  top: 10px;
  right: 10px;
  background: linear-gradient(135deg, rgba(58, 12, 163, 0.9), rgba(114, 9, 183, 0.9)) !important;
  color: #fff;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 102, 204, 0.3);
  backdrop-filter: blur(8px);
  font-family: 'Courier New', monospace;
  font-size: 12px;
  z-index: 10000;
  max-width: 250px;
  display: none;
  transition: all 0.3s ease;
}

#onirika-time-info:hover {
  background: linear-gradient(135deg, rgba(58, 12, 163, 1), rgba(114, 9, 183, 1)) !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(255, 102, 204, 0.2);
}

#onirika-time-info strong {
  color: #ff66cc;
  font-size: 14px;
}

#onirika-time-info small {
  color: #cdb4db;
  font-style: italic;
}

#onirika-time-info em {
  color: #4cc9f0;
  font-size: 11px;
}

/* === SISTEMA ATTIVAZIONE === */
.onirika-active main {
  /* Background rimosso - usa solo il gradiente del body */
}

.onirika-active.enable-effects .test-particles::before {
  animation: distant-float-1 55s ease-in-out infinite !important;
}

.onirika-active.enable-effects .test-particles::after {
  animation: distant-float-2 70s ease-in-out infinite !important;
  animation-delay: -35s !important;
}

/* === RESPONSIVE === */
@media (max-width: 1200px) {
  .home-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .box-hero,
  .box-service {
    grid-column: span 2;
  }

  .box-featured {
    grid-column: span 1;
  }

  .box-compact {
    grid-column: span 1;
  }
}

@media (max-width: 1024px) {
  .home-container {
    flex-direction: column;
  }

  .home-sidebar {
    width: 100%;
    order: -1;
    max-height: 400px;
  }

  .sidebar-panel {
    position: relative;
    top: 0;
    max-height: none;
  }

  .home-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
  }

  .box-hero,
  .box-service {
    grid-column: span 2;
  }

  .box-featured,
  .box-compact {
    grid-column: span 1;
  }

  .box-hero {
    padding: 32px 36px;
  }

  .box-hero h2 {
    font-size: 24px;
  }
}

@media (max-width: 768px) {
  .home-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .home-container {
    padding: 16px;
    gap: 16px;
  }

  .box {
    padding: 20px 24px;
    grid-column: span 1 !important;
  }

  .box-hero {
    padding: 28px 32px;
  }

  .box-hero h2 {
    font-size: 22px;
  }

  .box-service h2,
  .box-service .service-text {
    display: block;
  }

  .box-service h2 {
    margin-bottom: 12px;
  }

  .onirika-map-header {
    padding: 12px 16px;
  }

  .onirika-map-header h1 {
    font-size: 20px;
  }

  .header-subtitle {
    font-size: 12px;
  }

  .main-nav {
    gap: 12px;
    font-size: 12px;
  }

  .sidebar-panel {
    padding: 16px;
  }

  #onirika-time-info {
    font-size: 11px;
    padding: 8px;
    max-width: 200px;
  }

  /* Wrapper con meno padding su mobile */
  .onirika-page-wrapper {
    padding: 32px 16px 16px 16px;
  }
}

@media (max-width: 480px) {
  .home-container {
    padding: 12px;
  }

  .home-grid {
    gap: 12px;
  }

  /* Wrapper ancora più compatto su mobile piccolo */
  .onirika-page-wrapper {
    padding: 24px 12px 12px 12px;
  }

  .box {
    padding: 14px;
  }

  .onirika-map-header {
    padding: 10px 12px;
  }

  .main-nav {
    gap: 8px;
    font-size: 11px;
  }

  .header-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .lang-switcher {
    align-self: flex-end;
  }
}

/* === PERFORMANCE MODE - DISABILITA ANIMAZIONI COSTOSE === */
*,
*::before,
*::after {
  animation: none !important;
  transition: none !important;
  backdrop-filter: none !important;
  filter: none !important;
}

/* Eccezioni per sistema onirico */
.onirika-active main,
.onirika-active.enable-effects .test-particles::before,
.onirika-active.enable-effects .test-particles::after,
#onirika-time-info {
  animation: initial !important;
  transition: initial !important;
  backdrop-filter: initial !important;
  filter: initial !important;
}

/* === ACCESSIBILITY === */
@media (prefers-reduced-motion: reduce) {

  .onirika-active.enable-effects .test-particles::before,
  .onirika-active.enable-effects .test-particles::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }

  .onirika-active main {
    transition-duration: 0.01ms !important;
  }
}

/* === UTILITY CLASSES === */
.ombra-uniforme {
  box-shadow:
    0 4px 8px rgba(0, 0, 0, 0.1),
    0 6px 20px rgba(0, 0, 0, 0.05);
}

/* AGGIUNGERE alla fine del file per compatibilità */
.onirika-weather-active {
  position: relative;
  overflow: hidden;
  /* Importante per contenere le animazioni */
}

/* Performance safeguard per dispositivi lenti */
@media (max-width: 480px),
(prefers-reduced-motion: reduce) {

  .weather-layer::before,
  .weather-layer::after {
    animation-duration: 0.1s !important;
    animation-iteration-count: 1 !important;
    opacity: 0.3 !important;
  }
}