/* ============================================================
   KAORA — Custom CSS
   Animazioni, parallax, effetti non coperti da Tailwind
   ============================================================ */

/* ----- Google Font ----- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ----- CSS Variables ----- */
:root {
  --primary: #0073a8;
  --primary-dark: #005580;
  --accent: #0aa8ee;
  --dark: #333333;
}

/* ----- Base ----- */
html { scroll-behavior: smooth; }
body { font-family: 'Inter', sans-serif; color: var(--dark); }

/* Logo: bianco sull'header trasparente, colore originale dopo scroll */
.logo-img {
  filter: brightness(0) invert(1);
  transition: filter 0.4s ease;
}
#header.scrolled .logo-img {
  filter: none;
}

/* ============================================================
   HEADER
   ============================================================ */
#header {
  transition: background 0.4s ease, box-shadow 0.4s ease, padding 0.3s ease;
}
#header.scrolled {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 2px 24px rgba(0, 0, 0, 0.10);
}
#header.scrolled .nav-link { color: var(--primary); }
#header.scrolled .nav-link:hover { color: var(--accent); }
#header.scrolled .logo-text { color: var(--primary); }
#header.scrolled .logo-dot { color: var(--accent); }
#header.scrolled .hamburger { color: var(--primary); }
#header.scrolled .cta-nav {
  background: var(--primary);
  color: white;
}

.nav-link {
  color: white;
  font-weight: 500;
  position: relative;
  transition: color 0.2s;
}
/* Underline animata sui nav link */
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.3s ease;
}
.nav-link:hover::after { width: 100%; }
.nav-link:hover { color: var(--accent); }

.logo-text { color: white; }
.logo-dot { color: var(--accent); }

.cta-nav {
  background: white;
  color: var(--primary);
  font-weight: 700;
  padding: 0.5rem 1.4rem;
  border-radius: 50px;
  transition: all 0.3s ease;
}
.cta-nav:hover {
  background: var(--accent);
  color: white;
  transform: translateY(-1px);
}

/* ============================================================
   MOBILE MENU — Slide-in da destra
   ============================================================ */
.mobile-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 55;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}
.mobile-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.mobile-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 300px;
  max-width: 85vw;
  height: 100vh;
  background: linear-gradient(180deg, var(--primary-dark) 0%, #001f33 100%);
  z-index: 60;
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
}
.mobile-drawer.active {
  transform: translateX(0);
}
.mobile-drawer .drawer-close {
  align-self: flex-end;
  color: white;
  background: rgba(255,255,255,0.1);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-bottom: 2rem;
  transition: background 0.3s;
}
.mobile-drawer .drawer-close:hover {
  background: rgba(255,255,255,0.2);
}
.mobile-drawer ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.mobile-drawer ul li a {
  display: block;
  color: rgba(255,255,255,0.8);
  font-weight: 500;
  font-size: 1.15rem;
  padding: 0.875rem 1rem;
  border-radius: 12px;
  text-decoration: none;
  transition: all 0.25s ease;
}
.mobile-drawer ul li a:hover,
.mobile-drawer ul li a.active {
  background: rgba(255,255,255,0.1);
  color: white;
}
.mobile-drawer ul li a.drawer-cta {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  font-weight: 700;
  text-align: center;
  margin-top: 1rem;
}
.mobile-drawer ul li a.drawer-cta:hover {
  filter: brightness(1.1);
}

/* ============================================================
   HERO
   ============================================================ */
@keyframes gradientShift {
  0%   { background-position: 0%   50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0%   50%; }
}

.hero-gradient {
  background: linear-gradient(-45deg, #001a2e, #002d45, #0073a8, #0aa8ee, #004d70, #0073a8);
  background-size: 400% 400%;
  animation: gradientShift 14s ease infinite;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(50px); }
  to   { opacity: 1; transform: translateY(0); }
}
.hero-title   { animation: fadeInUp 0.9s ease forwards; }
.hero-sub     { animation: fadeInUp 0.9s ease 0.2s forwards; opacity: 0; }
.hero-cta     { animation: fadeInUp 0.9s ease 0.4s forwards; opacity: 0; }

/* Hero gradient text */
.hero-gradient-text {
  background: linear-gradient(135deg, #ffffff 0%, #0aa8ee 50%, #ffffff 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmerText 4s ease-in-out infinite;
}
@keyframes shimmerText {
  0%   { background-position: 0% center; }
  50%  { background-position: 200% center; }
  100% { background-position: 0% center; }
}

/* Animated blobs */
@keyframes blobFloat1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25%      { transform: translate(30px, -40px) scale(1.1); }
  50%      { transform: translate(-20px, 20px) scale(0.95); }
  75%      { transform: translate(15px, 30px) scale(1.05); }
}
@keyframes blobFloat2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25%      { transform: translate(-25px, 30px) scale(1.08); }
  50%      { transform: translate(30px, -15px) scale(0.92); }
  75%      { transform: translate(-10px, -35px) scale(1.04); }
}
@keyframes blobFloat3 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%      { transform: translate(20px, 25px) scale(1.06); }
  66%      { transform: translate(-30px, -20px) scale(0.96); }
}

.hero-blob {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(60px);
}
.hero-blob-1 {
  width: 500px;
  height: 500px;
  top: -15%;
  right: -10%;
  background: radial-gradient(circle, rgba(10,168,238,0.2), transparent 70%);
  animation: blobFloat1 18s ease-in-out infinite;
}
.hero-blob-2 {
  width: 400px;
  height: 400px;
  bottom: -10%;
  left: -8%;
  background: radial-gradient(circle, rgba(255,255,255,0.08), transparent 70%);
  animation: blobFloat2 22s ease-in-out infinite;
}
.hero-blob-3 {
  width: 300px;
  height: 300px;
  top: 40%;
  left: 50%;
  background: radial-gradient(circle, rgba(10,168,238,0.12), transparent 70%);
  animation: blobFloat3 15s ease-in-out infinite;
}

/* Scroll indicator migliorato */
@keyframes scrollPulse {
  0%, 100% { transform: translateY(0); opacity: 0.5; }
  50%      { transform: translateY(12px); opacity: 1; }
}
.scroll-indicator {
  animation: scrollPulse 2.5s ease-in-out infinite;
}
.scroll-indicator .scroll-dot {
  width: 24px;
  height: 40px;
  border: 2px solid rgba(255,255,255,0.4);
  border-radius: 12px;
  position: relative;
}
.scroll-indicator .scroll-dot::after {
  content: '';
  width: 4px;
  height: 8px;
  background: rgba(255,255,255,0.8);
  border-radius: 2px;
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  animation: scrollDotMove 2.5s ease-in-out infinite;
}
@keyframes scrollDotMove {
  0%, 100% { top: 6px; opacity: 1; }
  50%      { top: 22px; opacity: 0.3; }
}

/* ============================================================
   WAVE DIVIDERS
   ============================================================ */
.wave-divider {
  position: relative;
  margin-top: -1px;
  line-height: 0;
  overflow: hidden;
}
.wave-divider svg {
  display: block;
  width: 100%;
  height: 60px;
}
@media (min-width: 768px) {
  .wave-divider svg { height: 80px; }
}
.wave-divider-flip {
  transform: rotate(180deg);
}

/* ============================================================
   DOT PATTERN BACKGROUND
   ============================================================ */
.dot-pattern {
  position: relative;
}
.dot-pattern::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(0,115,168,0.07) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
  z-index: 0;
}
.dot-pattern > * {
  position: relative;
  z-index: 1;
}

/* ============================================================
   DECORAZIONI GEOMETRICHE
   ============================================================ */

/* SVG cerchi concentrici (fingerprint) */
.deco-fp {
  position: absolute;
  pointer-events: none;
  z-index: 0;
  opacity: 0.06;
}

/* Anello decorativo */
.deco-ring {
  position: absolute;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  pointer-events: none;
  z-index: 0;
}

/* Watermark testuale */
.deco-text {
  position: absolute;
  font-weight: 900;
  line-height: 1;
  pointer-events: none;
  user-select: none;
  z-index: 0;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn-white {
  display: inline-block;
  background: white;
  color: var(--primary);
  font-weight: 700;
  padding: 1rem 2.5rem;
  border-radius: 50px;
  text-decoration: none;
  transition: all 0.3s ease;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.2);
}
.btn-white:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.28);
  background: #e8f5ff;
}

.btn-primary {
  display: inline-block;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  font-weight: 700;
  padding: 1rem 2.5rem;
  border-radius: 50px;
  text-decoration: none;
  transition: all 0.3s ease;
  box-shadow: 0 6px 24px rgba(0, 115, 168, 0.35);
}
.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 32px rgba(0, 115, 168, 0.5);
  filter: brightness(1.05);
}

/* ============================================================
   SCROLL REVEAL — stagger più ampi
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(36px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal-left.visible {
  opacity: 1;
  transform: translateX(0);
}
.reveal-right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal-right.visible {
  opacity: 1;
  transform: translateX(0);
}
/* Stagger delays più percepibili */
.delay-1 { transition-delay: 0.12s; }
.delay-2 { transition-delay: 0.24s; }
.delay-3 { transition-delay: 0.38s; }
.delay-4 { transition-delay: 0.52s; }

/* ============================================================
   COUNTERS
   ============================================================ */
.counter-number {
  font-variant-numeric: tabular-nums;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ============================================================
   PRODUCT CARDS — gradient border unique
   ============================================================ */
.product-card {
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.4s ease;
  border: 1px solid rgba(0,0,0,0.06);
  overflow: hidden;
  perspective: 800px;
  position: relative;
}
.product-card::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 2px;
  background: linear-gradient(135deg, transparent 40%, var(--accent) 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
  z-index: 1;
}
.product-card:hover::before {
  opacity: 1;
}
.product-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 24px 64px rgba(0, 115, 168, 0.18);
}

/* Colori accent unici per card */
.product-card.card-organizzo:hover  { box-shadow: 0 24px 64px rgba(0, 115, 168, 0.22); }
.product-card.card-organizzo::before { background: linear-gradient(135deg, transparent 40%, #0073a8 100%); }

.product-card.card-voip:hover  { box-shadow: 0 24px 64px rgba(10, 168, 238, 0.22); }
.product-card.card-voip::before { background: linear-gradient(135deg, transparent 40%, #0aa8ee 100%); }

.product-card.card-xstream:hover  { box-shadow: 0 24px 64px rgba(0, 180, 120, 0.22); }
.product-card.card-xstream::before { background: linear-gradient(135deg, transparent 40%, #00b478 100%); }

.product-card.card-messaggero:hover  { box-shadow: 0 24px 64px rgba(120, 80, 220, 0.22); }
.product-card.card-messaggero::before { background: linear-gradient(135deg, transparent 40%, #7850dc 100%); }

/* Badge prodotto */
.product-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.3rem 0.9rem;
  border-radius: 50px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  z-index: 2;
  box-shadow: 0 4px 12px rgba(0,115,168,0.3);
}

/* Area immagine in cima alla card */
.product-img-wrap {
  padding: 0;
  overflow: hidden;
}
.product-img-wrap img {
  width: 100%;
  max-height: 256px;
  object-fit: contain;
  object-position: center;
  display: block;
  transition: transform 0.4s ease;
}
.product-card:hover .product-img-wrap img {
  transform: scale(1.04);
}
.card-messaggero .product-img-wrap {
  height: 256px;
  align-content: center;
  padding: 3.5rem 3rem;
}

/* Icona freccia animata nelle card */
.product-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: gap 0.3s ease;
}
.product-card:hover .product-arrow {
  gap: 0.8rem;
}

/* ============================================================
   GLASSMORPHISM VALUE CARDS
   ============================================================ */
.glass-card {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.05);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s ease, border-color 0.35s ease;
}
.glass-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 16px 48px rgba(0, 115, 168, 0.12);
  border-color: rgba(10, 168, 238, 0.3);
}

/* Icona container animata */
.icon-float {
  transition: transform 0.3s ease;
}
.glass-card:hover .icon-float {
  transform: translateY(-4px) scale(1.1);
}

/* ============================================================
   TILT EFFECT
   ============================================================ */
.tilt-card {
  transform-style: preserve-3d;
  will-change: transform;
}
.tilt-card > * {
  transform: translateZ(20px);
}

/* ============================================================
   PARALLAX BANNER — con canvas particles
   ============================================================ */
.parallax-section {
  background: linear-gradient(135deg, #001a2e 0%, #002d45 30%, #0073a8 60%, #0aa8ee 100%);
  background-attachment: fixed;
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
}
@media (max-width: 768px) {
  .parallax-section { background-attachment: scroll; }
}
.parallax-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.2);
  z-index: 1;
}
.parallax-canvas {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

/* ============================================================
   CONTACT FORM
   ============================================================ */
.form-input {
  width: 100%;
  padding: 0.875rem 1.25rem;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  font-size: 1rem;
  font-family: 'Inter', sans-serif;
  color: var(--dark);
  background: white;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  outline: none;
}
.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(10, 168, 238, 0.12);
}
.form-input::placeholder { color: #9ca3af; }

.form-submit {
  width: 100%;
  padding: 1rem;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  font-weight: 700;
  font-size: 1.05rem;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 6px 24px rgba(0, 115, 168, 0.35);
  position: relative;
  overflow: hidden;
}
.form-submit::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent, rgba(255,255,255,0.15), transparent);
  transform: translateX(-100%);
  transition: transform 0.5s ease;
}
.form-submit:hover::after {
  transform: translateX(100%);
}
.form-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 32px rgba(0, 115, 168, 0.5);
}
.form-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* ============================================================
   TIMELINE (chi-siamo.html)
   ============================================================ */
.timeline {
  position: relative;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 24px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--primary), var(--accent), transparent);
}
@media (min-width: 768px) {
  .timeline::before { left: 50%; transform: translateX(-50%); }
}
.timeline-item {
  position: relative;
  padding-left: 72px;
  margin-bottom: 3rem;
}
@media (min-width: 768px) {
  .timeline-item { padding-left: 0; }
  .timeline-item:nth-child(odd)  { padding-right: calc(50% + 48px); }
  .timeline-item:nth-child(even) { padding-left: calc(50% + 48px); }
}
.timeline-dot {
  position: absolute;
  left: 16px;
  top: 8px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  border: 3px solid var(--accent);
  box-shadow: 0 0 0 4px rgba(10, 168, 238, 0.2);
  z-index: 1;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.timeline-item:hover .timeline-dot {
  transform: scale(1.3);
  box-shadow: 0 0 0 8px rgba(10, 168, 238, 0.15);
}
@media (min-width: 768px) {
  .timeline-dot { left: 50%; transform: translateX(-50%); }
  .timeline-item:hover .timeline-dot { transform: translateX(-50%) scale(1.3); }
}
.timeline-card {
  background: white;
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  border-left: 4px solid var(--accent);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.timeline-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 115, 168, 0.15);
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer-link {
  color: rgba(255,255,255,0.7);
  transition: color 0.2s;
  text-decoration: none;
}
.footer-link:hover { color: var(--accent); }

/* Footer gradient top border */
footer {
  position: relative;
}
footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent), var(--primary));
}

/* ============================================================
   SCROLL PROGRESS BAR
   ============================================================ */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  z-index: 100;
  width: 0%;
  transition: width 0.05s linear;
}

/* ============================================================
   SECTION LABEL PILL
   ============================================================ */
.section-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(10, 168, 238, 0.08);
  padding: 0.4rem 1rem;
  border-radius: 50px;
  border: 1px solid rgba(10, 168, 238, 0.15);
}
.section-pill::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  flex-shrink: 0;
}

/* ============================================================
   UTILITIES
   ============================================================ */
/* Skeleton loader for images */
.skeleton-img {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
