/* Estilos personalizados - Solo lo que NO está en Tailwind */

/* Scroll suave */
.smooth-scroll {
  scroll-behavior: smooth;
}

/* Animaciones de fade-in personalizadas */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Animaciones del menú móvil */
.mobile-menu {
  transform: translateX(-100%);
  transition: transform 0.3s ease-in-out;
  background-color: #3b5a64 !important;
}

.mobile-menu.open {
  transform: translateX(0);
}

/* Forzar fondo sólido en el menú móvil */
.mobile-menu * {
  background-color: inherit;
}

.mobile-menu nav {
  background-color: #3b5a64 !important;
}

.mobile-menu div {
  background-color: #3b5a64 !important;
}

/* Animaciones del botón hamburguesa */
.hamburger {
  cursor: pointer;
  width: 24px;
  height: 24px;
  transition: all 0.25s;
  position: relative;
}

.hamburger-top,
.hamburger-middle,
.hamburger-bottom {
  position: absolute;
  top: 0;
  left: 0;
  width: 24px;
  height: 2px;
  background: #e5e7eb; /* Color claro para fondo oscuro */
  transform: rotate(0);
  transition: all 0.5s;
}

.hamburger-middle {
  transform: translateY(7px);
}

.hamburger-bottom {
  transform: translateY(14px);
}

.open .hamburger-top {
  transform: rotate(45deg) translateY(6px) translateX(6px);
}

.open .hamburger-middle {
  display: none;
}

.open .hamburger-bottom {
  transform: rotate(-45deg) translateY(6px) translateX(-6px);
}

/* Overlay del menú móvil */
.mobile-overlay {
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease-in-out;
}

.mobile-overlay.open {
  opacity: 1;
  visibility: visible;
}

/* Efectos adicionales para mejorar la UX */
.backdrop-blur {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* Animación para las tarjetas */
.card-hover {
  transition: all 0.3s ease;
}

.card-hover:hover {
  transform: translateY(-2px);
}

/* Gradiente personalizado para botones */
.btn-gradient {
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  transition: all 0.3s ease;
}

.btn-gradient:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
  transform: translateY(-1px);
  box-shadow: 0 10px 15px -3px rgba(59, 130, 246, 0.4);
}

/* Animación de entrada desde abajo */
@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.slide-in-up {
  animation: slideInUp 0.6s ease-out;
}

/* Efecto de enfoque mejorado para formularios */
.form-focus:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
  outline: none;
}

/* Estilo para testimonios con comillas */
.testimonial-quote::before {
  content: '"';
  position: absolute;
  top: -10px;
  left: 20px;
  font-size: 4rem;
  color: #e5e7eb;
  font-family: serif;
  line-height: 1;
}

.testimonial-quote {
  position: relative;
}

/* Efecto parallax suave para el hero */
.parallax-slow {
  transform: translateY(0);
  transition: transform 0.1s ease-out;
}

/* Animación de pulso para elementos importantes */
@keyframes pulse-soft {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.8;
  }
}

.pulse-soft {
  animation: pulse-soft 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Mejoras de accesibilidad */
.focus-visible:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

/* Transición suave para cambios de tema */
* {
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

/* Optimización para dispositivos móviles */
@media (max-width: 768px) {
  .mobile-optimized {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }

  /* Mejora para imágenes de fondo en móviles */
  section[style*="background-image"] {
    background-attachment: scroll !important;
    background-size: cover !important;
    background-position: center center !important;
    min-height: 100vh;
  }

  /* Asegurar que las secciones hero tengan altura completa en móviles */
  .min-h-screen {
    min-height: 100vh;
    min-height: -webkit-fill-available;
  }
}

/* Mejora de rendimiento para animaciones */
.gpu-accelerated {
  transform: translateZ(0);
  will-change: transform;
}

/* Estilo para elementos que se cargan dinámicamente */
.loading-skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Mejora del contraste del footer */
.footer-gradient {
  background: linear-gradient(135deg, #1f2937 0%, #111827 50%, #0f172a 100%);
}

/* Separador visual mejorado */
.header-separator {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
}

.footer-separator {
  box-shadow: 0 -4px 6px -1px rgba(0, 0, 0, 0.3), 0 -2px 4px -1px rgba(0, 0, 0, 0.2);
}

/* Mejora de legibilidad en header oscuro */
.header-dark .nav-link {
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.header-dark .logo img {
  filter: brightness(1.1) contrast(1.1);
}

/* Mejoras específicas para móviles */
@media (max-width: 640px) {
  /* Ajustar el espaciado en móviles */
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  /* Mejorar la visualización de texto en móviles */
  h1 {
    font-size: 2.5rem !important;
    line-height: 1.2 !important;
  }

  h2 {
    font-size: 2rem !important;
    line-height: 1.3 !important;
  }

  /* Asegurar que las imágenes de fondo se vean bien en móviles */
  section {
    background-attachment: scroll !important;
  }
}

/* Mejoras para el viewport en dispositivos iOS */
@supports (-webkit-touch-callout: none) {
  .min-h-screen {
    min-height: -webkit-fill-available;
  }
}

.header-dark .logo img {
  filter: brightness(1.1) contrast(1.1);
}

/* Estilos para el carrusel del equipo */
.team-slide {
  display: none;
  opacity: 0;
  transform: translateX(100px);
  transition: all 0.5s ease-in-out;
}

.team-slide.active {
  display: block;
  opacity: 1;
  transform: translateX(0);
}

/* Animaciones suaves para las transiciones */
@keyframes slideInFromRight {
  from {
    opacity: 0;
    transform: translateX(100px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInFromLeft {
  from {
    opacity: 0;
    transform: translateX(-100px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.slide-in-right {
  animation: slideInFromRight 0.5s ease-out;
}

.slide-in-left {
  animation: slideInFromLeft 0.5s ease-out;
}

/* Efectos hover para los botones de navegación */
#prevBtn:hover,
#nextBtn:hover {
  transform: translateY(-50%) scale(1.1);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

/* Responsive para el carrusel */
@media (max-width: 768px) {
  .team-slide .grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .team-slide img {
    width: 250px;
    height: 300px;
  }

  .team-slide h2 {
    font-size: 1.875rem;
  }
}

.header-dark .logo img {
  filter: brightness(1.1) contrast(1.1);
}

/* Mejoras para el carrusel del equipo */
#teamCarousel {
  position: relative;
  overflow: hidden;
  min-height: 500px; /* Altura mínima para evitar saltos */
}

.team-slide {
  transition: transform 0.5s ease-in-out, opacity 0.5s ease-in-out;
  backface-visibility: hidden;
  will-change: transform, opacity;
}

.team-slide.active {
  display: block;
}

/* Asegurar que el contenedor mantenga su altura durante las transiciones */
.team-slide > div {
  min-height: 500px;
}

@media (max-width: 768px) {
  #teamCarousel {
    min-height: 700px;
  }

  .team-slide > div {
    min-height: 700px;
  }
}

/* Estilos para el selector de teléfono internacional */
.iti {
  width: 100% !important;
  display: block !important;
}

.iti__country-list {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  border-radius: 0.375rem;
  border: 1px solid #d1d5db;
  max-height: 200px;
  overflow-y: auto;
  z-index: 1000;
}

.iti__country {
  padding: 8px 12px;
  border-bottom: 1px solid #f3f4f6;
}

.iti__country:hover {
  background-color: #f9fafb;
}

.iti__country.iti__highlight {
  background-color: #3b82f6;
  color: white;
}

.iti__flag-container {
  padding: 0;
}

.iti__selected-flag {
  padding: 8px 12px;
  border-right: 1px solid #d1d5db;
  background-color: transparent;
  border-radius: 0.375rem 0 0 0.375rem;
  height: 42px;
  display: flex;
  align-items: center;
}

.iti__selected-flag:hover {
  background-color: #f9fafb;
}

.iti__arrow {
  margin-left: 6px;
}

.iti input[type="tel"] {
  width: 100% !important;
  height: 42px !important;
  padding: 8px 12px 8px 80px !important;
  border-radius: 0.375rem !important;
  border: 1px solid #d1d5db !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
  font-size: 14px !important;
  line-height: 1.5 !important;
  background-color: white !important;
  box-sizing: border-box !important;
}

.iti input[type="tel"]:focus {
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1) !important;
  outline: none !important;
}

.iti input[type="tel"].border-red-500 {
  border-color: #ef4444 !important;
}

.iti--separate-dial-code input[type="tel"] {
  padding-left: 80px !important;
}

.iti--separate-dial-code .iti__selected-flag {
  background-color: #f9fafb;
  border-right: 1px solid #d1d5db;
}

.iti--separate-dial-code .iti__selected-dial-code {
  color: #374151;
  font-weight: 500;
}

/* Responsive para móviles */
@media (max-width: 640px) {
  .iti__country-list {
    max-height: 150px;
  }

  .iti__selected-flag {
    padding: 6px 8px;
    height: 38px;
  }

  .iti input[type="tel"] {
    height: 38px !important;
    padding: 6px 8px 6px 70px !important;
    font-size: 16px !important;
  }

  .iti--separate-dial-code input[type="tel"] {
    padding-left: 70px !important;
  }
}

/* Overlay para mejorar legibilidad del texto sobre imágenes de fondo */
.hero-overlay {
  background: rgba(0, 0, 0, 0.6) !important;
}

.hero-overlay-light {
  background: rgba(0, 0, 0, 0.4) !important;
}

.hero-overlay-dark {
  background: rgba(0, 0, 0, 0.7) !important;
}

/* Asegurar que todas las secciones con fondo tengan overlay */
section[style*="background-image"]::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1;
}

section[style*="background-image"] > * {
  position: relative;
  z-index: 2;
}

/* Mejorar contraste del texto sobre fondos */
.text-overlay {
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
}

.text-overlay-light {
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}

/* Asegurar legibilidad en todas las páginas */
.bg-overlay {
  position: relative;
}

.bg-overlay::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1;
}

.bg-overlay > * {
  position: relative;
  z-index: 2;
}
