/* ============================================================================
   Modulo FAQ - Stili Ottimizzati per SEO, UX e Accessibilità
   ============================================================================ */

/* ============================================================================
   Container Principale
   ============================================================================ */

.faq-section {
  background-color: #f8f9fa;
  
  padding: 3rem 1rem;
}

/* ============================================================================
   Titolo della Sezione
   ============================================================================ */

.faq-section h2#faq-heading {
  color: #2c3e50;
  position: relative;
  display: inline-block;
  font-weight: 700;
  margin-bottom: 1rem;
}

/* Linea decorativa sotto il titolo */
.faq-section h2#faq-heading::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, #000000, #ffffff);
}

/* Sottotitolo */
.faq-section .lead {
  color: #6c757d;
  font-weight: 400;
  max-width: 800px;
  margin: 0 auto;
}

/* ============================================================================
   Accordion - Pulsanti delle Domande
   ============================================================================ */

.accordion-button {
  font-size: 1.1rem;
  font-weight: 600;
  color: #2c3e50;
  background-color: #ffffff;
  padding: 1.25rem 1.5rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Stato attivo - Accordion aperto */
.accordion-button:not(.collapsed) {
  background-color: #000000;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(18, 23, 31, 0.2);
}

/* Focus - Accessibilità */
.accordion-button:focus {
  box-shadow: 0 0 0 0.25rem rgba(17, 21, 29, 0.25);
  border-color: rgba(13, 110, 253, 0.25);
}

/* Focus visible - Per keyboard navigation */
.accordion-button:focus-visible {
  outline: 2px solid #000000;
  outline-offset: 2px;
}

/* ============================================================================
   Accordion - Icone freccia
   ============================================================================ */

/* Icona freccia - stato chiuso */
.accordion-item .accordion-button::after {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%232c3e50'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Icona freccia - stato aperto */
.accordion-item .accordion-button:not(.collapsed)::after {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23ffffff'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
  transform: rotate(-180deg);
}

/* ============================================================================
   Accordion - Risposte
   ============================================================================ */

.accordion-body {
  font-size: 1rem;
  line-height: 1.6;
  color: #495057;
  background-color: #ffffff;
  padding: 1.5rem;
}

/* Ottimizzazione per la lettura */
.accordion-body p {
  margin-bottom: 0;
}

/* ============================================================================
   Accordion - Items
   ============================================================================ */

.accordion-item {
  overflow: hidden;
  margin-bottom: 1rem;
  border: none;
  background-color: transparent;
}

/* Animazione smooth per l'apertura/chiusura */
.accordion-collapse {
  transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================================================
   Schema.org Markup - SEO Optimization
   ============================================================================ */

[itemtype="https://schema.org/FAQPage"] {
  display: contents;
}

/* ============================================================================
   Call to Action - Assistenza
   ============================================================================ */

.faq-section .btn-outline-primary {
  border-color: #000000;
  color: #000710;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  transition: all 0.3s ease;
}

.faq-section .btn-outline-primary:hover {
  background-color: #000000;
  color: #ffffff;
  border-color: #000000;
  box-shadow: 0 4px 12px rgba(19, 25, 34, 0.2);
}

.faq-section .btn-primary {
  background-color: #000000;
  border-color: #000000;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  transition: all 0.3s ease;
}

.faq-section .btn-primary:hover {
  background-color: #0e0f11;
  border-color: #1d1e1f;
  box-shadow: 0 4px 12px rgba(29, 37, 47, 0.3);
  transform: translateY(-2px);
}

/* ============================================================================
   Responsive Design - Mobile First
   ============================================================================ */

/* Mobile (≤ 576px) */
@media (max-width: 576px) {
  .faq-section {
    padding: 2rem 1rem;
  }

  .faq-section h2#faq-heading {
    font-size: 1.75rem;
  }

  .faq-section .lead {
    font-size: 1rem;
  }

  .accordion-button {
    font-size: 1rem;
    padding: 1rem 1.25rem;
  }

  .accordion-body {
    font-size: 0.95rem;
    padding: 1.25rem;
  }

  .faq-section .btn {
    font-size: 0.9rem;
    padding: 0.625rem 1.25rem;
  }
}

/* Tablet (577px - 768px) */
@media (min-width: 577px) and (max-width: 768px) {
  .faq-section {
    padding: 2.5rem 1.5rem;
  }

  .faq-section h2#faq-heading {
    font-size: 2rem;
  }

  .accordion-button {
    font-size: 1.05rem;
  }

  .accordion-body {
    font-size: 0.98rem;
  }
}

/* Desktop (≥ 769px) */
@media (min-width: 769px) {
  .faq-section {
    padding: 4rem 1rem;
  }

  .faq-section h2#faq-heading {
    font-size: 2.5rem;
  }

  .accordion-button {
    font-size: 1.15rem;
  }

  .accordion-body {
    font-size: 1.05rem;
  }
}

/* Large Desktop (≥ 1200px) */
@media (min-width: 1200px) {
  .faq-section {
    padding: 5rem 1rem;
  }
}

/* ============================================================================
   Accessibility Enhancements
   ============================================================================ */

/* High contrast mode support */
@media (prefers-contrast: more) {
  .accordion-button {
    border: 2px solid #000;
  }

  .accordion-body {
    border: 1px solid #000;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .accordion-button,
  .accordion-item .accordion-button::after,
  .accordion-collapse,
  .faq-section .btn {
    transition: none !important;
  }
}

/* Focus styles for keyboard users */
*:focus-visible {
  outline: 2px solid #01060f;
  outline-offset: 2px;
}

/* ============================================================================
   Print Optimization
   ============================================================================ */

@media print {
  .faq-section {
    page-break-inside: avoid;
  }

  .accordion-button {
    background-color: #ffffff !important;
    color: #000000 !important;
    border: 1px solid #000 !important;
    box-shadow: none !important;
  }

  .accordion-body {
    border: 1px solid #000 !important;
  }

  .accordion-collapse {
    display: block !important;
  }

  /* Nascondi i bottoni CTA */
  .faq-section .btn {
    display: none;
  }
}

/* ============================================================================
   Dark Mode Support (Optional - preparazione)
   ============================================================================ */

@media (prefers-color-scheme: dark) {
  .faq-section {
    background-color: #212529;
  }

  .faq-section h2#faq-heading {
    color: #f8f9fa;
  }

  .faq-section .lead {
    color: #adb5bd;
  }

  .accordion-button {
    background-color: #343a40;
    color: #f8f9fa;
  }

  .accordion-body {
    background-color: #343a40;
    color: #dee2e6;
  }

  .accordion-button::after {
    filter: invert(1);
  }
}

/* ============================================================================
   Animation Enhancements
   ============================================================================ */

/* Hover effect sulle domande */
.accordion-button:hover:not(.collapsed) {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Smooth entrance animation */
@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.faq-section .accordion-item {
  animation: slideInUp 0.5s ease-out forwards;
  animation-delay: calc(var(--faq-index) * 0.1s);
  opacity: 0;
}

/* ============================================================================
   Browser Compatibility
   ============================================================================ */

/* Safari specific fix */
_::-webkit-full-page-media,
_:future,
:root .accordion-button {
  -webkit-appearance: none;
}

/* Firefox specific fix */
@-moz-document url-prefix() {
  .accordion-button {
    scrollbar-width: thin;
  }
}

/* ============================================================================
   Performance Optimization
   ============================================================================ */

/* Containment per performance */
.faq-section {
  contain: layout style paint;
}

.accordion-item {
  contain: layout style paint;
}

/* ============================================================================
   Utility Classes
   ============================================================================ */

.faq-container {
  position: relative;
}

/* Icone per enfatizzare le sezioni */
.faq-section .icon-emoji {
  font-size: 1.5rem;
  margin-right: 0.5rem;
}

/* Badge per categorie future (se necessario) */
.faq-category-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-right: 0.5rem;
}

.badge-booking {
  background-color: #e7f3ff;
  color: #010b19;
}

.badge-payment {
  background-color: #fff3cd;
  color: #856404;
}

.badge-technical {
  background-color: #d1e7dd;
  color: #0f5132;
}

/* ============================================================================
   End of FAQ Section Styles
   ============================================================================ */
