@tailwind base;
@tailwind components;
@tailwind utilities;

@layer utilities {
  .glass-card {
    @apply bg-white/10 backdrop-blur-md border border-white/20 shadow-xl;
  }
  .glass-card-dark {
    @apply bg-brand-blue/80 backdrop-blur-lg border border-white/10 shadow-2xl;
  }
  .text-gradient {
    @apply bg-clip-text text-transparent bg-gradient-to-r from-brand-yellow to-yellow-500;
  }
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', sans-serif;
  @apply bg-brand-light text-slate-800;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', sans-serif;
}

/* Custom Micro-animations */
.fade-in-up {
  animation: fadeInUp 0.8s ease-out forwards;
  opacity: 0;
  transform: translateY(20px);
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.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; }

/* =============================================
   Hero Section — Mobile Optimization
   ============================================= */

.hero-subtitle {
  line-height: 1.6;
}

/* Desktop: stacca il bottone dal testo */
.hero-cta-wrapper {
  margin-top: 35px;
}

@media (max-width: 640px) {
  .hero-subtitle {
    padding-left: 20px;
    padding-right: 20px;
  }
}

/* Hero CTA active/tap feedback */
.hero-cta {
  transition: transform 0.15s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.hero-cta:active {
  transform: scale(1.05);
  background-color: #e6bc00;
}

/* Bottone secondario hero — bordo ovale giallo, sfondo trasparente */
.hero-btn-secondary {
  background: transparent;
  border: 1.5px solid #FACC15;
  color: #FACC15;
  transition: background 0.2s ease, color 0.2s ease;
}

.hero-btn-secondary:hover {
  background: rgba(250, 204, 21, 0.12);
}

/* Hero CTA wrapper — gap e layout */
.hero-cta-wrapper {
  gap: 1rem; /* 16px desktop */
}

@media (max-width: 640px) {
  .hero-cta-wrapper {
    gap: 15px; /* 15px mobile come richiesto */
  }
}

/* =============================================
   Footer — Icone Social
   ============================================= */

.footer-social-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.footer-social-icon:hover {
  color: #FACC15;
  background: rgba(250, 204, 21, 0.1);
  border-color: rgba(250, 204, 21, 0.4);
  transform: translateY(-2px);
}

/* =============================================
   Expertise Carousel
   ============================================= */

.expertise-carousel-wrapper {
  position: relative;
  padding-top: 1.5rem;
  padding-bottom: 3.5rem;
  overflow: visible;
}

.expertise-carousel {
  display: flex;
  overflow-x: auto;
  overflow-y: visible;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  gap: 1.5rem;
  padding-top: 0.5rem;
  padding-bottom: 1rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.expertise-carousel::-webkit-scrollbar {
  display: none;
}

/* Cards: 2.5 visible on desktop — sfondo chiaro uniforme */
.expertise-card {
  flex: 0 0 calc((100% - 2 * 1.5rem) / 2.5);
  scroll-snap-align: start;
  padding: 2rem;
  min-height: 260px;
  background: #F8FAFC;
  border: 2px solid #e5e7eb;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  transition:
    transform 0.35s ease,
    box-shadow 0.35s ease,
    border-color 0.35s ease,
    background 0.35s ease;
}

/* Featured cards: leggermente più alte e più spaziose */
.expertise-card--featured {
  min-height: 320px;
  padding: 2.5rem;
}

/* ── Hover: card diventa scura con glow azzurro ── */
.expertise-card:hover {
  background: linear-gradient(135deg, #0F172A 0%, #1e293b 100%);
  box-shadow:
    0 0 0 2px #4e81ee,
    0 0 28px rgba(78, 129, 238, 0.5),
    0 16px 52px rgba(78, 129, 238, 0.22);
  border-color: #4e81ee;
}

/* Titolo e testo cambiano colore al hover */
.expertise-card:hover .card-title {
  color: #ffffff;
}

.expertise-card:hover .card-text {
  color: #cbd5e1;
}

/* Icona: sfondo scuro semitrasparente, colore giallo brand */
.expertise-card:hover .card-icon-wrap {
  background-color: rgba(255, 255, 255, 0.12) !important;
  color: #FACC15 !important;
  border-color: rgba(255, 255, 255, 0.15);
}

/* Tablet: show 2 cards */
@media (max-width: 1024px) {
  .expertise-card {
    flex: 0 0 calc((100% - 1.5rem) / 2);
  }
}

/* Mobile: show 1.2 cards */
@media (max-width: 640px) {
  .expertise-carousel {
    gap: 1rem;
  }
  .expertise-card {
    flex: 0 0 calc((100% - 1rem) / 1.2);
  }
  .expertise-carousel-wrapper {
    padding-left: 0;
    padding-right: 0;
  }
}

/* =============================================
   Carousel Navigation Arrows
   ============================================= */

.carousel-arrow {
  position: absolute;
  top: calc(50% - 1.5rem);
  transform: translateY(-50%);
  z-index: 10;
  width: 2.75rem;
  height: 2.75rem;
  background: white;
  border: 2px solid #e5e7eb;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0F172A;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.carousel-arrow:hover {
  background: #4e81ee;
  border-color: #4e81ee;
  color: white;
  box-shadow: 0 4px 18px rgba(78, 129, 238, 0.45);
}

.carousel-arrow:disabled {
  opacity: 0.25;
  cursor: not-allowed;
  pointer-events: none;
}

.carousel-prev { left: -1.375rem; }
.carousel-next { right: -1.375rem; }

@media (max-width: 640px) {
  .carousel-prev { left: 0.25rem; }
  .carousel-next { right: 0.25rem; }
}

/* =============================================
   Carousel Dot Indicators
   ============================================= */

.carousel-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.75rem;
}

.carousel-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 9999px;
  background: #d1d5db;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: width 0.3s ease, background 0.3s ease;
}

.carousel-dot.active {
  width: 1.75rem;
  background: #4e81ee;
}

.carousel-dot:hover:not(.active) {
  background: #93c5fd;
}

/* =============================================
   Testimonianze Carousel
   ============================================= */

.testi-carousel-wrapper {
  position: relative;
  padding-top: 1.5rem;
  padding-bottom: 3.5rem;
  overflow: visible;
}

.testi-carousel {
  display: flex;
  overflow-x: auto;
  overflow-y: visible;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  gap: 1.5rem;
  padding-top: 0.5rem;
  padding-bottom: 1rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.testi-carousel::-webkit-scrollbar {
  display: none;
}

/* Desktop: 3 card visibili */
.testi-card {
  flex: 0 0 calc((100% - 2 * 1.5rem) / 3);
  scroll-snap-align: start;
  background: #F8FAFC;
  border: 1.5px solid #e5e7eb;
  border-radius: 1rem;
  padding: 2rem;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}

.testi-card:hover {
  transform: translateY(-4px);
  box-shadow:
    0 0 0 2px #4e81ee,
    0 0 20px rgba(78, 129, 238, 0.3);
  border-color: #4e81ee;
}

/* Tablet: 2 card */
@media (max-width: 1024px) {
  .testi-card {
    flex: 0 0 calc((100% - 1.5rem) / 2);
  }
}

/* Mobile: 1.1 card */
@media (max-width: 640px) {
  .testi-carousel { gap: 1rem; }
  .testi-card {
    flex: 0 0 calc((100% - 1rem) / 1.1);
    padding: 1.5rem;
  }
}

.testi-prev { left: -1.375rem; }
.testi-next { right: -1.375rem; }

@media (max-width: 640px) {
  .testi-prev { left: 0.25rem; }
  .testi-next { right: 0.25rem; }
}

/* =============================================
   Footer Colonne
   ============================================= */

.footer-col-title {
  font-family: 'Outfit', sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

/* =============================================
   Partner Logos — Minimalist Watermark Style
   ============================================= */

.partners-scroll {
  display: flex;
  gap: 3rem;
  animation: partnersScroll 18s linear infinite;
  will-change: transform;
}

@keyframes partnersScroll {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

.partners-scroll:hover {
  animation-play-state: paused;
}

.partner-logo {
  flex: 0 0 auto;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: grayscale(100%);
  opacity: 0.5;
  transition: opacity 0.3s ease;
}

/* =============================================
   Blog Post — Tipografia e contenuto
   ============================================= */

/* Immagini inline nel post */
.prose img {
  border-radius: 0.75rem;
  margin: 2rem auto;
  box-shadow: 0 4px 24px rgba(0,0,0,0.4);
  width: 100%;
  height: auto;
}

/* H2 con accento giallo */
.prose h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: #ffffff;
  border-left: 4px solid #FACC15;
  padding-left: 0.85rem;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}

/* H3 e H4 */
.prose h3, .prose h4 {
  font-family: 'Outfit', sans-serif;
  color: #e2e8f0;
  margin-top: 1.75rem;
  margin-bottom: 0.75rem;
}

/* Paragrafi */
.prose p {
  color: #cbd5e1;
  line-height: 1.85;
  margin-bottom: 1.25rem;
}

/* Grassetto */
.prose strong {
  color: #f1d74d;
  font-weight: 600;
}

/* Liste */
.prose ul {
  color: #cbd5e1;
  list-style: none;
  padding-left: 0;
  margin-bottom: 1.25rem;
}

.prose ul li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.6rem;
  line-height: 1.75;
}

.prose ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.65em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #4e81ee;
  flex-shrink: 0;
}

.prose ol {
  color: #cbd5e1;
  list-style: none;
  padding-left: 0;
  margin-bottom: 1.25rem;
  counter-reset: ol-counter;
}

.prose ol li {
  position: relative;
  padding-left: 2rem;
  margin-bottom: 0.6rem;
  line-height: 1.75;
  counter-increment: ol-counter;
}

.prose ol li::before {
  content: counter(ol-counter) '.';
  position: absolute;
  left: 0;
  top: 0;
  font-family: 'Outfit', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  color: #4e81ee;
}

/* Separatori */
.prose hr {
  border-color: rgba(255,255,255,0.08);
  margin: 2rem 0;
}

/* =============================================
   Blog Post — Indice (TOC)
   ============================================= */

.post-toc {
  background: rgba(78, 129, 238, 0.07);
  border: 1px solid rgba(78, 129, 238, 0.3);
  border-radius: 0.75rem;
  padding: 1.5rem 1.75rem;
  margin: 2rem 0;
}

.post-toc p strong,
.post-toc > strong {
  display: block;
  font-family: 'Outfit', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #4e81ee;
  margin-bottom: 0.75rem;
}

.post-toc ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.post-toc ul li {
  margin-bottom: 0.4rem;
}

.post-toc ul li a {
  color: #94a3b8;
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.2s ease;
}

.post-toc ul li a:hover {
  color: #f1d74d;
}

/* =============================================
   Blog Post — FAQ
   ============================================= */

.post-faq {
  margin-top: 2.5rem;
}

/* Accordion FAQ con <details>/<summary> */
.post-faq .faq-item {
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

.post-faq .faq-item:last-child {
  border-bottom: none;
}

.post-faq .faq-item summary {
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: #ffffff;
  padding: 1.1rem 0.25rem 1.1rem 0;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: color 0.2s ease;
}

.post-faq .faq-item summary::-webkit-details-marker {
  display: none;
}

.post-faq .faq-item summary::after {
  content: '+';
  font-size: 1.4rem;
  font-weight: 300;
  color: #4e81ee;
  flex-shrink: 0;
  margin-left: 1rem;
  transition: transform 0.25s ease, color 0.2s ease;
}

.post-faq .faq-item[open] summary::after {
  transform: rotate(45deg);
  color: #f1d74d;
}

.post-faq .faq-item[open] summary {
  color: #f1d74d;
}

.post-faq .faq-item summary:hover {
  color: #f1d74d;
}

.post-faq .faq-item p {
  color: #94a3b8;
  font-size: 0.95rem;
  line-height: 1.75;
  padding: 0 0.25rem 1.1rem 0;
  margin: 0;
}
