/* ============================================================
   SECTION: CONTACT
   ============================================================ */

.section-contact {
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Background Image */
.section-contact::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: url('../../assets/background/contact.webp');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  z-index: 0;
  filter: brightness(0.4) saturate(0.9);
}

/* Overlay Gradients */
.section-contact::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    linear-gradient(180deg, rgba(10, 10, 10, 0.9) 0%, transparent 25%),
    linear-gradient(0deg, rgba(10, 10, 10, 0.95) 0%, transparent 30%),
    radial-gradient(ellipse at center, rgba(10, 10, 10, 0.3) 0%, rgba(10, 10, 10, 0.7) 70%),
    radial-gradient(ellipse at 50% 80%, rgba(0, 217, 255, 0.1) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 60%, rgba(212, 175, 55, 0.08) 0%, transparent 40%);
  z-index: 1;
  pointer-events: none;
}

/* CTA Content */
.cta-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--spacing-3xl) var(--spacing-xl);
  width: 100%;
  box-sizing: border-box;
}

/* CTA Text Container */
.cta-text-container {
  max-width: 800px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* CTA Title */
.cta-title {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: var(--spacing-lg);
  text-align: center;
  width: 100%;
}

.cta-title .text-reveal-content {
  color: var(--color-text-primary);
}

.cta-title .text-reveal-content.accent {
  color: var(--color-gold);
  text-shadow: 0 0 50px var(--glow-gold);
}

/* CTA Subtitle */
.cta-subtitle {
  font-size: clamp(1rem, 2vw, 1.3rem);
  color: var(--color-text-secondary);
  line-height: 1.8;
  margin-bottom: var(--spacing-xl);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
  width: 100%;
}

/* ── CTA BUTTONS ─────────────────────────────────────────────── */
.cta-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: var(--spacing-md);
  width: 100%;
}

/* Button Shine Effect */
.btn-shine {
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  animation: btn-shine-move 3s ease-in-out infinite;
}

@keyframes btn-shine-move {
  0%       { left: -100%; }
  50%, 100% { left:  100%; }
}

/* Floating Elements */
.cta-floating-elements {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.floating-element {
  position: absolute;
  border-radius: 50%;
  opacity: 0.1;
  animation: float-element 20s ease-in-out infinite;
}

.fe-1 {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, var(--color-gold) 0%, transparent 70%);
  top: 10%;
  left: 10%;
  animation-delay: 0s;
}

.fe-2 {
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, var(--color-teal) 0%, transparent 70%);
  top: 60%;
  right: 15%;
  animation-delay: -7s;
}

.fe-3 {
  width: 150px;
  height: 150px;
  background: radial-gradient(circle, var(--color-gold) 0%, transparent 70%);
  bottom: 20%;
  left: 20%;
  animation-delay: -14s;
}

@keyframes float-element {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25%       { transform: translate(30px, -30px) scale(1.1); }
  50%       { transform: translate(0, -50px) scale(1); }
  75%       { transform: translate(-30px, -30px) scale(0.9); }
}

/* ============================================================
   RESPONSIVE BREAKPOINTS
   ============================================================ */

/* ── ≤ 768px ────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .cta-content {
    padding: var(--spacing-2xl) var(--spacing-md);
    align-items: center;       /* keep everything centered */
  }

  .cta-text-container {
    align-items: center;
    width: 100%;
  }

  .cta-title {
    text-align: center;
  }

  .cta-subtitle {
    text-align: center;
  }

  /* ── Buttons: stack vertically, centered ── */
  .cta-buttons {
    flex-direction:  column;
    align-items:     center;    /* ← centers the buttons */
    justify-content: center;
    width:           100%;
    max-width:       320px;     /* cap width so they don't stretch wall to wall */
    margin-left:     auto;
    margin-right:    auto;
    gap:             var(--spacing-sm);
  }

  .cta-buttons .btn {
    width:           100%;
    justify-content: center;
    text-align:      center;
    min-height:      48px;      /* tap-friendly */
  }

  .floating-element {
    display: none;
  }
}

/* ── ≤ 480px ────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .cta-content {
    padding: var(--spacing-xl) var(--spacing-sm);
    align-items: center;
  }

  .cta-title {
    font-size: clamp(2rem, 10vw, 3rem);
    text-align: center;
  }

  .cta-subtitle {
    font-size:  1rem;
    text-align: center;
  }

  .cta-buttons {
    max-width: 280px;      /* slightly narrower on small phones */
    gap:       var(--spacing-xs);
  }

  .cta-buttons .btn {
    width:      100%;
    min-height: 48px;
    font-size:  0.9rem;
    padding:    12px 20px;
  }
}

/* ── ≤ 360px — very small phones ───────────────────────────── */
@media (max-width: 360px) {
  .cta-content {
    padding: var(--spacing-lg) var(--spacing-xs);
  }

  .cta-title {
    font-size: clamp(1.7rem, 9vw, 2.5rem);
  }

  .cta-buttons {
    max-width: 260px;
  }

  .cta-buttons .btn {
    font-size: 0.85rem;
    padding:   10px 16px;
  }
}

/* ============================================================
   SCROLL ANIMATIONS
   ============================================================ */

/* ── Section base ───────────────────────────────────────────── */
.section-contact::before {
  opacity:    0;
  transition: opacity 1.6s ease 0.1s;
}

.section-contact.is-visible::before {
  opacity: 1;
}

.section-contact::after {
  opacity:    0;
  transition: opacity 1.4s ease 0.3s;
}

.section-contact.is-visible::after {
  opacity: 1;
}

/* ── Floating elements ──────────────────────────────────────── */
.floating-element {
  opacity:    0;
  transition: opacity 1.2s ease;
}

.section-contact.is-visible .fe-1 {
  opacity:          0.1;
  transition-delay: 0.8s;
}

.section-contact.is-visible .fe-2 {
  opacity:          0.1;
  transition-delay: 1.1s;
}

.section-contact.is-visible .fe-3 {
  opacity:          0.1;
  transition-delay: 1.4s;
}

/* ── CTA title lines — hidden base ─────────────────────────── */
.cta-title {
  overflow: hidden;
}

.cta-title .text-reveal-wrapper {
  overflow: hidden;
  display:  block;
}

.cta-title .text-reveal-content {
  display:   block;
  opacity:   0;
  transform: translateY(60px);
  transition:
    opacity   0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.cta-title .text-reveal-content.accent {
  opacity:   0;
  transform: translateY(60px);
  transition:
    opacity   0.85s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    transform 0.85s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ── CTA Subtitle — hidden base ─────────────────────────────── */
.cta-subtitle {
  opacity:   0;
  transform: translateY(30px);
  transition:
    opacity   0.75s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    transform 0.75s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ── CTA Buttons — hidden base ──────────────────────────────── */
.cta-buttons {
  opacity:   0;
  transform: translateY(25px);
  transition:
    opacity   0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    transform 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ── Individual button stagger ──────────────────────────────── */
.cta-buttons .btn {
  opacity:   0;
  transform: translateY(20px) scale(0.95);
  transition:
    opacity      0.55s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    transform    0.55s cubic-bezier(0.34, 1.56, 0.64, 1),
    background   var(--duration-normal) var(--easing-out),
    box-shadow   var(--duration-normal) var(--easing-out),
    border-color var(--duration-normal) var(--easing-out);
}

/* ── Accent title glow pulse ────────────────────────────────── */
.section-contact.is-visible .cta-title .accent {
  animation:       contactAccentGlow 3.5s ease-in-out infinite;
  animation-delay: 1.5s;
}

@keyframes contactAccentGlow {
  0%, 100% {
    text-shadow: 0 0 50px rgba(212, 175, 55, 0.4);
  }
  50% {
    text-shadow:
      0 0  80px rgba(212, 175, 55, 0.9),
      0 0 160px rgba(212, 175, 55, 0.3),
      0 0 240px rgba(212, 175, 55, 0.1);
  }
}

/* ── Divider line ───────────────────────────────────────────── */
.cta-divider {
  width: 0;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--color-gold),
    var(--color-teal),
    transparent
  );
  margin:        var(--spacing-lg) auto;
  border-radius: 999px;
  transition:    width 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.section-contact.is-visible .cta-divider {
  width: 200px;
}

/* ── Button entered state ───────────────────────────────────── */
.cta-buttons .btn.btn-entered {
  opacity:   1;
  transform: translateY(0) scale(1);
}

/* ── Button glow flash ──────────────────────────────────────── */
@keyframes btnFlashGold {
  0%   { box-shadow: 0 0  0px rgba(212, 175, 55, 0); }
  35%  { box-shadow: 0 0 40px rgba(212, 175, 55, 0.8),
                     0 0 80px rgba(212, 175, 55, 0.2); }
  100% { box-shadow: 0 0 30px rgba(212, 175, 55, 0.3); }
}

@keyframes btnFlashTeal {
  0%   { box-shadow: 0 0  0px rgba(0, 217, 255, 0); }
  35%  { box-shadow: 0 0 40px rgba(0, 217, 255, 0.6),
                     0 0 80px rgba(0, 217, 255, 0.15); }
  100% { box-shadow: 0 0  0px rgba(0, 217, 255, 0); }
}

.cta-buttons .btn.flash-gold { animation: btnFlashGold 1.2s ease forwards; }
.cta-buttons .btn.flash-teal { animation: btnFlashTeal 1.2s ease forwards; }

/* ── Section exit dims ──────────────────────────────────────── */
.section-contact.section-exit .cta-title .text-reveal-content,
.section-contact.section-exit .cta-subtitle {
  opacity:    0.3;
  transition: opacity 0.5s ease;
}

.section-contact.section-exit .cta-buttons .btn.btn-entered {
  opacity:    0.35;
  transition: opacity 0.5s ease;
}

/* ── Reduced motion ─────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .section-contact::before,
  .section-contact::after,
  .floating-element,
  .cta-title .text-reveal-content,
  .cta-title .text-reveal-content.accent,
  .cta-subtitle,
  .cta-buttons,
  .cta-buttons .btn,
  .cta-divider {
    transition: none !important;
    animation:  none !important;
    opacity:    1    !important;
    transform:  none !important;
    width:      auto !important;
  }
}


/* ── Loading state for submit button ──────────────────────── */
.btn-loading {
  opacity: 0.7;
  cursor: not-allowed;
  pointer-events: none;
}

/* ── Feedback message styles ──────────────────────────────── */
.contact-feedback.success {
  background: rgba(46, 213, 115, 0.12);
  border: 1px solid rgba(46, 213, 115, 0.3);
  color: #2ed573;
  padding: 14px 18px;
  border-radius: 8px;
  margin-top: 16px;
  font-size: 14px;
  font-weight: 500;
  animation: feedbackFadeIn 0.3s ease;
}

.contact-feedback.error {
  background: rgba(231, 76, 60, 0.12);
  border: 1px solid rgba(231, 76, 60, 0.3);
  color: #e74c3c;
  padding: 14px 18px;
  border-radius: 8px;
  margin-top: 16px;
  font-size: 14px;
  font-weight: 500;
  animation: feedbackFadeIn 0.3s ease;
}

@keyframes feedbackFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}