/* ============================================
   ENHANCEMENTS - Melhorias de Design
   ============================================ */

/* ===== 1. SCROLL PROGRESS BAR ===== */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1001;
  height: 3px;
  background: var(--gradient-orange);
  width: 0%;
  transition: width 0.1s linear;
  box-shadow: 0 0 10px rgba(230, 81, 0, 0.5);
}

/* ===== 2. ANIMATED GRADIENTS ===== */
@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.animated-gradient {
  background-size: 200% 200% !important;
  animation: gradientShift 6s ease infinite;
}

/* ===== 3. MAGNETIC BUTTON ===== */
.btn--magnetic {
  transition: transform 0.3s cubic-bezier(0.23, 1, 0.32, 1);
  will-change: transform;
}

/* ===== 4. 3D TILT CARD ===== */
.tilt-card {
  will-change: transform;
  transition: opacity 0.6s ease, transform 0.1s ease;
  transform-style: preserve-3d;
  perspective: 800px;
}

.tilt-card__content {
  transform: translateZ(20px);
  transition: transform 0.3s ease;
}

.tilt-card:hover .tilt-card__content {
  transform: translateZ(30px);
}

.history-3d {
  transform-style: preserve-3d;
  perspective: 800px;
  will-change: transform;
}

.history-3d .history__mission-quote {
  transform: translateZ(25px);
  transition: transform 0.3s ease;
}

.history-3d:hover .history__mission-quote {
  transform: translateZ(45px);
}

.history-3d .history__mission-quote {
  text-shadow:
    0 -1px 0 rgba(255, 255, 255, 0.45),
    0 1px 2px rgba(0, 0, 0, 0.45),
    0 6px 14px rgba(0, 0, 0, 0.4);
}

/* Shine effect */
.tilt-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 10;
  border-radius: inherit;
}

.tilt-card:hover::before {
  opacity: 1;
}

/* ===== 5. TYPEWRITER EFFECT ===== */
.typewriter {
  display: inline;
  overflow: hidden;
  white-space: normal;
}

.typewriter-cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--color-orange-500);
  margin-left: 2px;
  animation: blink 0.8s step-end infinite;
  vertical-align: text-bottom;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* ===== 6. RIPPLE EFFECT ===== */
.ripple-btn {
  position: relative;
  overflow: hidden;
}

.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  transform: scale(0);
  animation: rippleAnim 0.6s ease-out;
  pointer-events: none;
}

@keyframes rippleAnim {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* ===== 7. FLOATING ICONS ENHANCED ===== */
@keyframes floatOrganic {
  0%, 100% {
    transform: translateY(0) translateX(0) rotate(0deg);
  }
  25% {
    transform: translateY(-12px) translateX(5px) rotate(3deg);
  }
  50% {
    transform: translateY(-4px) translateX(-3px) rotate(-2deg);
  }
  75% {
    transform: translateY(-18px) translateX(4px) rotate(1deg);
  }
}

@keyframes floatSlow {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes floatMedium {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  33% { transform: translateY(-10px) rotate(5deg); }
  66% { transform: translateY(-3px) rotate(-3deg); }
}

.float-organic {
  animation: floatOrganic 5s ease-in-out infinite;
}

.float-slow {
  animation: floatSlow 4s ease-in-out infinite;
}

.float-medium {
  animation: floatMedium 3.5s ease-in-out infinite;
}

/* ===== 8. SECTION DIVIDER GRADIENTS ===== */
.section-wave {
  width: 100%;
  height: 60px;
  pointer-events: none;
}

@media (max-width: 768px) {
  .section-wave {
    height: 30px;
  }
}

/* ===== 9. MICRO PARALLAX ===== */
.micro-parallax {
  will-change: transform;
}

/* ===== 10. FLOATING WHATSAPP BUTTON ===== */
.whatsapp-float {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--color-whatsapp);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  box-shadow: 0 4px 16px rgba(37, 211, 102, 0.4);
  text-decoration: none;
  transition: all 0.3s ease;
  animation: whatsappFloatIn 0.6s ease-out 3.5s both;
}

.whatsapp-float:hover {
  transform: scale(1.1);
  box-shadow: 0 8px 30px rgba(37, 211, 102, 0.5);
  color: white;
}

.whatsapp-float::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: transparent;
  border: 2px solid var(--color-whatsapp);
  animation: whatsappRing 2s ease-in-out infinite;
}

@keyframes whatsappFloatIn {
  from {
    opacity: 0;
    transform: scale(0) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes whatsappRing {
  0% {
    transform: scale(1);
    opacity: 0.6;
  }
  100% {
    transform: scale(1.3);
    opacity: 0;
  }
}

/* ===== KEYFRAMES ===== */
@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .scroll-progress,
  .animated-gradient,
  .btn--magnetic,
  .tilt-card,
  .history-3d,
  .ripple,
  .float-organic,
  .float-slow,
  .float-medium,
  .micro-parallax,
  .whatsapp-float::before,
  .typewriter-cursor {
    animation: none !important;
    transition: none !important;
  }
  
  .scroll-progress {
    display: none;
  }
}

/* ===== SMART NAVBAR HIDE ===== */
.navbar--hidden {
  transform: translateY(-100%);
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .whatsapp-float {
    width: 52px;
    height: 52px;
    font-size: 24px;
    bottom: 16px;
    right: 16px;
  }
}

/* ===== BACK TO TOP ===== */
.back-to-top {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 999;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--gradient-orange);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: 0 4px 16px rgba(230, 81, 0, 0.3);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.3s ease;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(230, 81, 0, 0.4);
}

/* ===== SECTION INDICATOR DOTS ===== */
.section-indicator {
  position: fixed;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 998;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.section-indicator__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(14, 14, 14, 0.2);
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0;
}

.section-indicator__dot:hover {
  background: rgba(14, 14, 14, 0.4);
  transform: scale(1.3);
}

.section-indicator__dot.active {
  background: var(--color-orange-700);
  box-shadow: 0 0 8px rgba(230, 81, 0, 0.4);
  transform: scale(1.3);
}

/* ===== TITLE REVEAL ===== */
.reveal-title {
  overflow: hidden;
}

.reveal-title .reveal-word {
  display: inline-block;
  opacity: 0;
  transform: translateY(30px) rotateX(15deg);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal-title.in-view .reveal-word {
  opacity: 1;
  transform: translateY(0) rotateX(0);
}

/* ===== CONTENT REVEAL (fade-up blocks) ===== */
.reveal-block {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

section.in-view .reveal-block,
footer.in-view .reveal-block {
  opacity: 1;
  transform: translateY(0);
  transition-delay: var(--reveal-delay, 0s);
}

/* ===== FAQ SECTION ===== */
.faq {
  padding: var(--spacing-6rem) 0;
  background: var(--section-bg-testimonials);
  position: relative;
  overflow: hidden;
}

.faq__list {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.faq__item {
  background: white;
  border-radius: var(--radius-base);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow 0.3s ease;
}

.faq__item:hover {
  box-shadow: var(--shadow-card);
}

.faq__question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-md);
  padding: var(--spacing-lg);
  background: none;
  border: none;
  cursor: pointer;
  font-size: var(--text-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--color-blue-900);
  text-align: left;
  transition: color 0.3s ease;
}

.faq__question:hover {
  color: var(--color-orange-700);
}

.faq__question i {
  font-size: var(--text-size-sm);
  color: var(--color-orange-700);
  transition: transform 0.3s ease;
  flex-shrink: 0;
}

.faq__item.open .faq__question i {
  transform: rotate(180deg);
}

.faq__answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.4s ease;
  padding: 0 var(--spacing-lg);
  color: var(--text-muted);
  line-height: 1.7;
}

.faq__item.open .faq__answer {
  max-height: 300px;
  padding: 0 var(--spacing-lg) var(--spacing-lg);
}

@media (max-width: 768px) {
  .back-to-top {
    width: 40px;
    height: 40px;
    font-size: 16px;
    bottom: 16px;
    left: 16px;
  }

  .section-indicator {
    right: 8px;
    gap: 8px;
  }

  .section-indicator__dot {
    width: 8px;
    height: 8px;
  }
}

/* ===== 3D effects disabled on mobile ===== */
@media (max-width: 768px) {
  .tilt-card,
  .tilt-card__content,
  .reveal-title .reveal-word,
  .history-3d,
  .history-3d .history__mission-quote {
    transform: none !important;
  }

  .reveal-title .reveal-word {
    opacity: 1 !important;
  }
}

/* ===== 11. WHATSAPP MODAL ===== */
.whatsapp-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  visibility: hidden;
  transition: visibility 0s linear 0.3s;
}

.whatsapp-modal.is-open {
  visibility: visible;
  transition: visibility 0s;
}

.whatsapp-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.whatsapp-modal.is-open .whatsapp-modal__overlay {
  opacity: 1;
}

.whatsapp-modal__dialog {
  position: relative;
  background: white;
  border-radius: 20px;
  width: 100%;
  max-width: 440px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 40px 32px 32px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
  z-index: 1001;
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.whatsapp-modal.is-open .whatsapp-modal__dialog {
  opacity: 1;
  transform: scale(1);
}

.whatsapp-modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: transparent;
  border: none;
  font-size: 24px;
  color: var(--color-whatsapp);
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

.whatsapp-modal__close:hover {
  color: var(--color-whatsapp-dark);
}

.whatsapp-modal__icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(37, 211, 102, 0.1);
  border-radius: 50%;
}

.whatsapp-modal__icon i {
  font-size: 40px;
  color: var(--color-whatsapp);
}

.whatsapp-modal__title {
  text-align: center;
  margin-bottom: 10px;
  font-size: 22px;
  font-weight: 700;
  color: var(--color-primary);
}

.whatsapp-modal__description {
  text-align: center;
  margin-bottom: 28px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--color-text-secondary);
}

.whatsapp-modal__textarea {
  width: 100%;
  padding: 16px 20px;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  font-size: 15px;
  line-height: 1.5;
  resize: vertical;
  min-height: 110px;
  margin-bottom: 24px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.whatsapp-modal__textarea:focus {
  outline: none;
  border-color: var(--color-whatsapp);
  box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.15);
}

.whatsapp-modal__actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.whatsapp-modal__send {
  background: var(--color-whatsapp);
  color: white;
  border: none;
  width: 100%;
  padding: 14px 24px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.2s ease, transform 0.1s ease;
}

.whatsapp-modal__send:hover {
  background: var(--color-whatsapp-dark);
  transform: translateY(-1px);
}

.whatsapp-modal__send:focus-visible {
  outline: 2px solid var(--color-whatsapp-dark);
  outline-offset: 2px;
}

body.whatsapp-modal--open {
  overflow: hidden;
}

@media (max-width: 480px) {
  .whatsapp-modal {
    padding: 16px;
  }

  .whatsapp-modal__dialog {
    padding: 32px 24px 24px;
    border-radius: 16px;
  }
}
