/* Stili personalizzati per HiveRoomi */

/* Stili per le animazioni di entrata e uscita */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeOut {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-20px); }
}

.animate-fade-in {
  animation: fadeIn 0.8s ease-out forwards;
}

.animate-fade-out {
  animation: fadeOut 0.5s ease-out forwards;
}

/* Stili per la rotazione (spinner) */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.animate-spin {
  animation: spin 1s linear infinite;
}

/* Stili per il segno di spunta animato */
.success-checkmark {
  width: 80px;
  height: 80px;
  margin: 0 auto;
  position: relative;
}

.success-checkmark .check-icon {
  width: 80px;
  height: 80px;
  position: relative;
  border-radius: 50%;
  box-sizing: content-box;
  border: 4px solid #22c55e;
  animation: scale-in 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.success-checkmark .check-icon .icon-line {
  height: 5px;
  background-color: #22c55e;
  display: block;
  border-radius: 2px;
  position: absolute;
  z-index: 10;
  opacity: 0;
  animation: fade-in 0.3s ease-out forwards;
  animation-delay: 0.4s;
}

.success-checkmark .check-icon .icon-line.line-tip {
  top: 46px;
  left: 14px;
  width: 25px;
  transform: rotate(45deg);
  transform-origin: left;
  animation: draw-line-tip 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
  animation-delay: 0.4s;
}

.success-checkmark .check-icon .icon-line.line-long {
  top: 38px;
  right: 8px;
  width: 47px;
  transform: rotate(-45deg);
  transform-origin: right;
  animation: draw-line-long 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
  animation-delay: 0.4s;
}

@keyframes scale-in {
  0% { transform: scale(0); opacity: 0; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes fade-in {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

@keyframes draw-line-tip {
  0% { width: 0; opacity: 0; }
  50% { width: 25px; opacity: 1; }
  100% { width: 25px; opacity: 1; }
}

@keyframes draw-line-long {
  0% { width: 0; opacity: 0; }
  50% { width: 47px; opacity: 1; }
  100% { width: 47px; opacity: 1; }
}

/* Stili per le notifiche */
.notification {
  position: fixed;
  top: 1rem;
  right: 1rem;
  padding: 1rem;
  border-radius: 0.5rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 24rem;
}

.notification-success {
  background-color: #ecfdf5;
  border-left: 4px solid #22c55e;
  color: #065f46;
}

.notification-error {
  background-color: #fef2f2;
  border-left: 4px solid #ef4444;
  color: #b91c1c;
}

.notification-info {
  background-color: #eff6ff;
  border-left: 4px solid #3b82f6;
  color: #1e40af;
}

/* Stili per adattare il sito a mobile */
@media (max-width: 640px) {
  .notification {
    left: 1rem;
    right: 1rem;
    max-width: calc(100% - 2rem);
  }
}

/* HiveRoomi Custom CSS - Effetti interattivi e animazioni */

/* Animazioni di base */
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

@keyframes float {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
  100% { transform: translateY(0px); }
}

/* Classi di animazione */
.animate-slide-in {
  animation: slideInRight 0.8s ease-out forwards;
}

.animate-pulse {
  animation: pulse 2s infinite;
}

.animate-float {
  animation: float 3s ease-in-out infinite;
}

/* Ritardi animazione */
.delay-100 { animation-delay: 100ms; }
.delay-200 { animation-delay: 200ms; }
.delay-300 { animation-delay: 300ms; }
.delay-400 { animation-delay: 400ms; }
.delay-500 { animation-delay: 500ms; }

/* Transizioni */
.transition-all {
  transition: all 0.3s ease;
}

.transition-transform {
  transition: transform 0.3s ease;
}

.transition-colors {
  transition: color 0.3s ease, background-color 0.3s ease;
}

/* Hover effects */
.hover-scale:hover {
  transform: scale(1.05);
}

.hover-lift:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

.hover-bright:hover {
  filter: brightness(1.1);
}

/* Tooltip personalizzato */
.tooltip {
  position: relative;
  cursor: pointer;
}

.tooltip:before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 8px;
  padding: 6px 10px;
  border-radius: 6px;
  background: #333;
  color: white;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 100;
}

.tooltip:after {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 4px;
  border: 4px solid transparent;
  border-top-color: #333;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 100;
}

.tooltip:hover:before,
.tooltip:hover:after {
  opacity: 1;
  visibility: visible;
}

/* Effetto vetro */
.glass {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.glass-dark {
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Effetti interattivi avanzati */
.card-interactive {
  transition: all 0.3s ease;
  transform-style: preserve-3d;
  perspective: 1000px;
}

.card-interactive:hover {
  transform: translateY(-10px) rotateX(5deg);
  box-shadow: 0 20px 30px -10px rgba(151, 71, 255, 0.2);
}

/* Bottoni con effetto */
.btn-gradient {
  background: linear-gradient(to right, var(--primary-light), var(--primary-dark));
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 9999px;
  display: inline-block;
  position: relative;
  z-index: 1;
  overflow: hidden;
  transition: all 0.3s ease;
}

.btn-gradient:before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to right, var(--primary-dark), var(--primary-light));
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.btn-gradient:hover:before {
  opacity: 1;
}

.btn-gradient:hover {
  box-shadow: 0 10px 20px -5px rgba(151, 71, 255, 0.3);
}

/* Sezioni interattive */
.parallax-bg {
  background-attachment: fixed;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

/* Responsive optimizations */
@media (max-width: 768px) {
  .parallax-bg {
    background-attachment: scroll;
  }
  
  .card-interactive:hover {
    transform: translateY(-5px);
  }
  
  /* Ottimizzazioni per tablet */
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  /* Riduci dimensioni font per tablet */
  h1 {
    font-size: 2.5rem;
    line-height: 1.2;
  }
  
  h2 {
    font-size: 2rem;
    line-height: 1.3;
  }
  
  /* Ottimizza spaziature */
  .py-16 {
    padding-top: 3rem;
    padding-bottom: 3rem;
  }
  
  .py-12 {
    padding-top: 2.5rem;
    padding-bottom: 2.5rem;
  }
}

/* Ottimizzazioni per smartphone */
@media (max-width: 640px) {
  /* Container più compatto */
  .container {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
  
  /* Font size ottimizzati per mobile */
  h1 {
    font-size: 2rem;
    line-height: 1.1;
  }
  
  h2 {
    font-size: 1.5rem;
    line-height: 1.2;
  }
  
  h3 {
    font-size: 1.25rem;
    line-height: 1.3;
  }
  
  /* Riduci padding verticale */
  .py-16 {
    padding-top: 2rem;
    padding-bottom: 2rem;
  }
  
  .py-12 {
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
  }
  
  /* Ottimizza form mobile */
  .signup-form input[type="email"] {
    font-size: 16px; /* Previene zoom su iOS */
    padding: 0.75rem;
  }
  
  .signup-form button {
    padding: 0.75rem 1rem;
    font-size: 1rem;
  }
  
  /* Stack elementi verticalmente */
  .flex-row {
    flex-direction: column;
  }
  
  .flex-row > * {
    margin-bottom: 1rem;
  }
  
  /* Riduci margini */
  .space-y-6 > * + * {
    margin-top: 1rem;
  }
  
  .space-y-4 > * + * {
    margin-top: 0.75rem;
  }
}

/* Ottimizzazioni per schermi molto piccoli */
@media (max-width: 480px) {
  h1 {
    font-size: 1.75rem;
  }
  
  h2 {
    font-size: 1.25rem;
  }
  
  .container {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
  
  /* Riduci ulteriormente spaziature */
  .py-16 {
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
  }
  
  .py-12 {
    padding-top: 1rem;
    padding-bottom: 1rem;
  }
}

/* Ottimizzazioni per schermi grandi */
@media (min-width: 1024px) {
  .container {
    max-width: 1200px;
    margin: 0 auto;
  }
  
  /* Migliora leggibilità su schermi grandi */
  body {
    font-size: 1.1rem;
    line-height: 1.7;
  }
  
  /* Aumenta spaziature */
  .py-16 {
    padding-top: 4rem;
    padding-bottom: 4rem;
  }
  
  .py-12 {
    padding-top: 3rem;
    padding-bottom: 3rem;
  }
}

/* Ottimizzazioni per schermi molto grandi */
@media (min-width: 1440px) {
  .container {
    max-width: 1400px;
  }
  
  body {
    font-size: 1.125rem;
  }
}

/* Fix per Safari iOS */
@supports (-webkit-touch-callout: none) {
  .signup-form input[type="email"] {
    font-size: 16px;
  }
  
  /* Fix per viewport height su iOS */
  .min-h-screen {
    min-height: -webkit-fill-available;
  }
}

/* Fix per dispositivi con notch */
@supports (padding: max(0px)) {
  .container {
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
  }
}

/* Ottimizzazioni per orientamento landscape su mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .py-16 {
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
  }
  
  .py-12 {
    padding-top: 1rem;
    padding-bottom: 1rem;
  }
  
  /* Riduci altezza hero su landscape */
  .min-h-screen {
    min-height: 100vh;
  }
}

/* Ottimizzazioni per dispositivi ad alta densità */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  /* Assicurati che le immagini siano nitide */
  img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}

/* Ottimizzazioni per riduzione movimento */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .animate-slide-in,
  .animate-pulse,
  .animate-float {
    animation: none;
  }
}

/* Ottimizzazioni per modalità scura */
@media (prefers-color-scheme: dark) {
  /* Mantieni i tuoi colori personalizzati anche in modalità scura */
  :root {
    --primary-light: #9747ff;
    --primary-dark: #7c3aed;
  }
}

/* ===== OTTIMIZZAZIONI PERFORMANCE E ACCESSIBILITÀ ===== */

/* Ottimizzazioni per performance */
* {
  box-sizing: border-box;
}

/* Migliora rendering su dispositivi mobili */
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Ottimizza animazioni per GPU */
.animate-slide-in,
.animate-pulse,
.animate-float,
.hover-scale,
.hover-lift {
  will-change: transform;
  transform: translateZ(0);
  backface-visibility: hidden;
}

/* Focus visibile per accessibilità */
button:focus,
input:focus,
a:focus {
  outline: 2px solid var(--primary-light);
  outline-offset: 2px;
}

/* Skip link per accessibilità */
.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: var(--primary-light);
  color: white;
  padding: 8px;
  text-decoration: none;
  border-radius: 4px;
  z-index: 1000;
}

.skip-link:focus {
  top: 6px;
}

/* Contrasto migliorato per accessibilità */
.text-white\/90 {
  color: rgba(255, 255, 255, 0.95);
}

/* Ottimizzazioni per screen reader */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Ottimizzazioni per touch devices */
@media (hover: none) and (pointer: coarse) {
  /* Rimuovi hover effects su dispositivi touch */
  .hover-scale:hover,
  .hover-lift:hover,
  .hover-bright:hover {
    transform: none;
    box-shadow: none;
    filter: none;
  }
  
  /* Aumenta target size per touch */
  button,
  a,
  input[type="checkbox"],
  input[type="radio"] {
    min-height: 44px;
    min-width: 44px;
  }
  
  /* Aumenta spaziatura per touch */
  .space-y-4 > * + * {
    margin-top: 1rem;
  }
}

/* Ottimizzazioni per dispositivi con schermo piccolo e alta densità */
@media (max-width: 480px) and (-webkit-min-device-pixel-ratio: 2) {
  /* Riduci ulteriormente le dimensioni per schermi piccoli ad alta densità */
  h1 {
    font-size: 1.5rem;
  }
  
  h2 {
    font-size: 1.125rem;
  }
  
  .container {
    padding-left: 0.25rem;
    padding-right: 0.25rem;
  }
}

/* Fix per Chrome su Android */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
  .signup-form input[type="email"] {
    font-size: 16px;
  }
}

/* Ottimizzazioni per Firefox */
@-moz-document url-prefix() {
  .glass {
    background: rgba(255, 255, 255, 0.25);
  }
  
  .glass-dark {
    background: rgba(0, 0, 0, 0.25);
  }
}

/* Ottimizzazioni per Edge */
@supports (-ms-ime-align: auto) {
  .container {
    max-width: 100%;
  }
}

/* Ottimizzazioni per Safari */
@media not all and (min-resolution: 0.001dpcm) {
  .signup-form input[type="email"] {
    font-size: 16px;
  }
}

/* Ottimizzazioni per dispositivi con tastiera fisica */
@media (hover: hover) and (pointer: fine) {
  /* Mantieni hover effects solo su dispositivi con mouse */
  .hover-scale:hover {
    transform: scale(1.05);
  }
  
  .hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
  }
  
  .hover-bright:hover {
    filter: brightness(1.1);
  }
}

/* Ottimizzazioni per stampa */
@media print {
  * {
    background: transparent !important;
    color: black !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }
  
  .signup-form,
  .cookie-banner,
  .cookie-settings {
    display: none !important;
  }
  
  body {
    font-size: 12pt;
    line-height: 1.4;
  }
  
  h1, h2, h3 {
    page-break-after: avoid;
  }
  
  p, blockquote {
    orphans: 3;
    widows: 3;
  }
}

/* Language-specific styles */
[data-lang="it"] .it-only,
[data-lang="en"] .en-only {
  display: inline-block;
}

[data-lang="it"] .en-only,
[data-lang="en"] .it-only {
  display: none;
} 