/* ========================================
   MedNexa - Melhorias Landing Page
   ======================================== */

/* Este arquivo adiciona melhorias e animações aos estilos existentes */

/* 1. PRELOADER */
/* ---------------------------------------- */

.loader-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #ffffff;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loader-track {
  width: 60px;
  height: 60px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #0B638C;
  border-radius: 50%;
  animation: loaderSpin 1s linear infinite;
  position: relative;
}

.loader-fill {
  display: none; /* Não usado nesta versão */
}

@keyframes loaderSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Estado oculto do loader */
.loader-bg.hidden {
  opacity: 0;
  visibility: hidden;
}

/* 2. ANIMAÇÕES SUAVES */
/* ---------------------------------------- */

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

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

@keyframes slideDown {
  from {
    transform: translateX(-50%) translateY(-200%);
    opacity: 0;
  }
  to {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
  }
}

/* 2. MELHORIAS NO NAVBAR */
/* ---------------------------------------- */

/* Navbar mais suave ao rolar */
.navbar {
  transition: all 0.3s ease;
}

/* Logo com transição */
.navbar-brand img {
  transition: all 0.3s ease;
}

/* 3. HERO SECTION APRIMORADA */
/* ---------------------------------------- */

/* Animação de entrada */
.hero-content > * {
  opacity: 0;
  animation: fadeInUp 0.8s ease forwards;
}

.hero-content > *:nth-child(1) { animation-delay: 0.1s; }
.hero-content > *:nth-child(2) { animation-delay: 0.2s; }
.hero-content > *:nth-child(3) { animation-delay: 0.3s; }
.hero-content > *:nth-child(4) { animation-delay: 0.4s; }

/* 4. CARDS COM HOVER MELHORADO */
/* ---------------------------------------- */

/* Feature cards */
.feature-card {
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s;
}

.feature-card:hover::before {
  left: 100%;
}

/* Ícones animados */
.feature-card i {
  transition: all 0.3s ease;
}

.feature-card:hover i {
  transform: scale(1.2) rotate(5deg);
  color: var(--mednexa-secondary);
}

/* 5. PLANOS COM MICRO-INTERAÇÕES */
/* ---------------------------------------- */

/* Badge animado */
.featured-badge {
  animation: slideDown 0.6s ease;
  position: absolute !important;
  left: 50% !important;
  transform: translateX(-50%) !important;  
}

/* Lista de recursos */
.plan-card ul li {
  transition: all 0.2s ease;
}

.plan-card:hover ul li {
  padding-left: 0.5rem;
}

.plan-card ul li i {
  transition: all 0.3s ease;
}

.plan-card:hover ul li i {
  transform: scale(1.2);
}

/* 6. BOTÕES COM EFEITO RIPPLE */
/* ---------------------------------------- */

.btn {
  position: relative;
  overflow: hidden;
}

.btn .ripple {
  position: absolute;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.7);
  transform: scale(0);
  animation: ripple 0.6s ease-out;
}

@keyframes ripple {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* 7. TESTIMONIALS ANIMADOS */
/* ---------------------------------------- */

.testimonial-card {
  opacity: 0;
  transform: translateY(20px);
}

.testimonial-card.in-view {
  opacity: 1;
  transform: translateY(0);
  transition: all 0.6s ease;
}

.testimonial-card:nth-child(1) { transition-delay: 0.1s; }
.testimonial-card:nth-child(2) { transition-delay: 0.2s; }
.testimonial-card:nth-child(3) { transition-delay: 0.3s; }

/* Estrelas animadas */
.testimonial-card .stars i {
  display: inline-block;
  color: #fbbf24;
  animation: pulse 2s ease-in-out infinite;
}

.testimonial-card .stars i:nth-child(1) { animation-delay: 0.1s; }
.testimonial-card .stars i:nth-child(2) { animation-delay: 0.2s; }
.testimonial-card .stars i:nth-child(3) { animation-delay: 0.3s; }
.testimonial-card .stars i:nth-child(4) { animation-delay: 0.4s; }
.testimonial-card .stars i:nth-child(5) { animation-delay: 0.5s; }

/* 8. FAQ INTERATIVO */
/* ---------------------------------------- */

.faq-item {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  margin-bottom: 1rem;
  overflow: hidden;
  transition: all 0.3s ease;
}

.faq-item:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.faq-question {
  padding: 1.25rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.3s ease;
}

.faq-question:hover {
  background-color: #f8f9fa;
}

.faq-question i {
  transition: transform 0.3s ease;
}

.faq-item.active .faq-question i {
  transform: rotate(180deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  padding: 0 1.25rem;
}

.faq-item.active .faq-answer {
  max-height: 500px;
  padding: 0 1.25rem 1.25rem;
}

/* 9. WHATSAPP PULSE */
/* ---------------------------------------- */

.whatsapp-float a::before {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  background-color: #25d366;
  border-radius: 50%;
  animation: whatsapp-pulse 1.5s ease-out infinite;
  z-index: -1;
}

@keyframes whatsapp-pulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  100% {
    transform: scale(1.3);
    opacity: 0;
  }
}

/* 10. SCROLL TO TOP */
/* ---------------------------------------- */

.scroll-to-top {
  position: fixed;
  bottom: 100px;
  right: 30px;
  width: 40px;
  height: 40px;
  background: var(--mednexa-primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 999;
}

.scroll-to-top.show {
  opacity: 1;
  visibility: visible;
}

.scroll-to-top:hover {
  background: var(--mednexa-primary-dark);
  transform: translateY(-3px);
}

/* 11. LOADING STATES */
/* ---------------------------------------- */

.btn.loading {
  color: transparent;
  pointer-events: none;
}

.btn.loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  top: 50%;
  left: 50%;
  margin-left: -8px;
  margin-top: -8px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  border-top-color: transparent;
  animation: spinner 0.8s linear infinite;
}

@keyframes spinner {
  to { transform: rotate(360deg); }
}

/* 12. SMOOTH REVEAL */
/* ---------------------------------------- */

[data-reveal] {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.6s ease;
}

[data-reveal].revealed {
  opacity: 1;
  transform: translateY(0);
}

[data-reveal="left"] {
  transform: translateX(-20px);
}

[data-reveal="right"] {
  transform: translateX(20px);
}

[data-reveal="zoom"] {
  transform: scale(0.9);
}

/* 13. PERFORMANCE OTIMIZADA */
/* ---------------------------------------- */

/* Desabilitar animações complexas em mobile */
@media (max-width: 768px) {
  .feature-card::before,
  .whatsapp-float a::before {
    display: none;
  }
  
  .plan-card.featured {
    animation: none;
  }
  
  [data-reveal] {
    opacity: 1;
    transform: none;
  }
}

/* Respeitar preferências do usuário */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* 14. MELHORIAS DE ACESSIBILIDADE */
/* ---------------------------------------- */

/* Focus visible */
*:focus-visible {
  outline: 2px solid var(--mednexa-secondary);
  outline-offset: 2px;
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--mednexa-primary);
  color: white;
  padding: 8px;
  text-decoration: none;
  border-radius: 0 0 4px 0;
}

.skip-link:focus {
  top: 0;
}

/* 15. INTEGRAÇÕES COM O TEMPLATE */
/* ---------------------------------------- */

/* Ajustes para o tema preset-1 */
[data-pc-preset="preset-1"] .btn-primary {
  background: var(--mednexa-primary);
  border-color: var(--mednexa-primary);
}

[data-pc-preset="preset-1"] .text-primary {
  color: var(--mednexa-primary) !important;
}

/* Landing page específica */
.landing-page .pc-navbar {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
}

/* Correções para o layout horizontal */
[data-pc-layout="horizontal"] .navbar {
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

/* Tema light */
[data-pc-theme="light"] {
  --pc-primary-color: #0B638C;
  --pc-secondary-color: #09ADBF;
}