/* ═══════════════════════════════════════════════════════════════
   TECNÓPOLIS — ANIMACIONES PROFESIONALES UNIVERSITARIAS v2.0
   Agregar en: assets/css/estiloindex.css  (o como <style> en head)
   ═══════════════════════════════════════════════════════════════ */

/* ── VARIABLES ─────────────────────────────────────── */
:root {
  --tec-blue:     #0066B3;
  --tec-blue2:    #00A8E8;
  --tec-gold:     #F5A623;
  --tec-dark:     #0a1628;
  --tec-dark2:    #0f2044;
  --ease-spring:  cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-smooth:  cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ══════════════════════════════════════════════════════
   1. PRELOADER MEJORADO
   ══════════════════════════════════════════════════════ */
#preloader {
  position: fixed; inset: 0; z-index: 99999;
  background: var(--tec-dark);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}
#preloader.hidden { opacity: 0; visibility: hidden; pointer-events: none; }

.preloader-logo img {
  width: 140px;
  animation: preloaderPulse 1.5s ease-in-out infinite;
  filter: drop-shadow(0 0 20px rgba(0,168,232,0.5));
}
@keyframes preloaderPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%       { transform: scale(1.08); opacity: 0.85; }
}

/* Barra de progreso animada */
.preloader-bar {
  width: 200px; height: 3px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px; margin-top: 24px; overflow: hidden;
}
.preloader-bar::after {
  content: '';
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--tec-blue), var(--tec-blue2), var(--tec-gold));
  animation: preloaderBar 1.4s var(--ease-smooth) forwards;
}
@keyframes preloaderBar {
  from { width: 0; }
  to   { width: 100%; }
}

/* ══════════════════════════════════════════════════════
   2. NAVBAR — SCROLL EFFECT + ENTRADA
   ══════════════════════════════════════════════════════ */
#navbarPro {
  animation: navSlideDown 0.7s var(--ease-smooth) both;
}
@keyframes navSlideDown {
  from { transform: translateY(-100%); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}

#navbarPro.scrolled {
  backdrop-filter: blur(16px) saturate(180%);
  box-shadow: 0 4px 30px rgba(0,102,179,0.18);
}

/* Nav links: subrayado animado */
.nav-link-pro {
  position: relative; overflow: hidden;
}
.nav-link-pro::after {
  content: '';
  position: absolute; bottom: 0; left: 50%;
  width: 0; height: 2px;
  background: linear-gradient(90deg, var(--tec-blue), var(--tec-blue2));
  border-radius: 2px;
  transition: width 0.3s var(--ease-smooth), left 0.3s var(--ease-smooth);
}
.nav-link-pro:hover::after,
.nav-link-pro.active::after {
  width: 100%; left: 0;
}

/* ══════════════════════════════════════════════════════
   3. HERO SLIDER — ANIMACIONES DE CONTENIDO
   ══════════════════════════════════════════════════════ */

/* Partículas flotantes (ya en .floating-elements — mejoramos) */
.floating-element {
  animation-timing-function: var(--ease-smooth) !important;
}

/* Título hero con typewriter shimmer */
.hero-title {
  background: linear-gradient(
    135deg,
    #ffffff 0%, #ffffff 40%,
    rgba(245,166,35,0.9) 55%,
    #ffffff 70%, #ffffff 100%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: heroTitleShimmer 4s linear infinite, heroFadeUp 0.9s var(--ease-smooth) both;
}
@keyframes heroTitleShimmer {
  from { background-position: 200% center; }
  to   { background-position: -200% center; }
}
@keyframes heroFadeUp {
  from { opacity: 0; transform: translateY(40px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero-subtitle {
  animation: heroFadeUp 0.9s 0.2s var(--ease-smooth) both;
}
.hero-btn-primary, .hero-btn-secondary {
  animation: heroFadeUp 0.9s 0.4s var(--ease-smooth) both;
}

/* Botón primario hero: efecto ripple */
.hero-btn-primary {
  position: relative; overflow: hidden;
  transition: transform 0.25s var(--ease-spring), box-shadow 0.25s ease !important;
}
.hero-btn-primary::before {
  content: '';
  position: absolute; top: 50%; left: 50%;
  width: 0; height: 0;
  background: rgba(255,255,255,0.25);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.5s ease, height 0.5s ease, opacity 0.5s ease;
}
.hero-btn-primary:hover { transform: translateY(-3px) scale(1.03); }
.hero-btn-primary:hover::before { width: 300px; height: 300px; opacity: 0; }
.hero-btn-primary:active { transform: scale(0.97); }

/* ══════════════════════════════════════════════════════
   4. WELCOME SECTION — REVEAL + IMAGEN 3D
   ══════════════════════════════════════════════════════ */
.welcome-section .welcome-image img {
  transition: transform 0.5s var(--ease-smooth), box-shadow 0.5s ease;
  transform-origin: center;
}
.welcome-section .welcome-image:hover img {
  transform: scale(1.03) rotate(-1deg);
  box-shadow: 0 24px 60px rgba(0,102,179,0.2) !important;
}

/* Decoración geométrica en la imagen */
.welcome-image {
  position: relative;
}
.welcome-image::before {
  content: '';
  position: absolute; bottom: -16px; right: -16px;
  width: 120px; height: 120px;
  background: linear-gradient(135deg, var(--tec-blue), var(--tec-blue2));
  border-radius: 20px; z-index: -1;
  opacity: 0.25;
  animation: floatDecor 4s ease-in-out infinite;
}
.welcome-image::after {
  content: '';
  position: absolute; top: -12px; left: -12px;
  width: 80px; height: 80px;
  border: 3px solid rgba(0,168,232,0.3);
  border-radius: 16px; z-index: -1;
  animation: floatDecor 4s 2s ease-in-out infinite;
}
@keyframes floatDecor {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%       { transform: translateY(-10px) rotate(5deg); }
}

/* ══════════════════════════════════════════════════════
   5. CONTADORES — CARD HOVER ELEVADO
   ══════════════════════════════════════════════════════ */
.counter-item.modern-card {
  transition: transform 0.35s var(--ease-spring), box-shadow 0.35s ease !important;
  border-bottom: 3px solid transparent !important;
  position: relative; overflow: hidden;
}
.counter-item.modern-card::before {
  content: '';
  position: absolute; bottom: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--tec-blue), var(--tec-blue2));
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.4s var(--ease-smooth);
}
.counter-item.modern-card:hover {
  transform: translateY(-8px) !important;
  box-shadow: 0 20px 50px rgba(0,102,179,0.15) !important;
}
.counter-item.modern-card:hover::before { transform: scaleX(1); }

.counter-item .counter-icon {
  transition: transform 0.4s var(--ease-spring);
}
.counter-item:hover .counter-icon { transform: scale(1.2) rotate(-5deg); }

/* Número del contador: animación de entrada */
.counter-number {
  background: linear-gradient(135deg, var(--tec-blue), var(--tec-blue2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ══════════════════════════════════════════════════════
   6. CARDS DE CARRERAS — FLIP + GLOW
   ══════════════════════════════════════════════════════ */
.course-card.modern-card {
  transition: transform 0.4s var(--ease-spring), box-shadow 0.4s ease !important;
  border-radius: 16px !important;
  overflow: hidden;
}
.course-card.modern-card:hover {
  transform: translateY(-12px) !important;
  box-shadow: 0 30px 70px rgba(0,102,179,0.2) !important;
}

/* Imagen de la carrera — object-position:top evita cortar cabezas */
.course-card-top { overflow: hidden !important; }
.course-img {
  transition: transform 0.5s var(--ease-smooth) !important;
  height: 260px !important;
  object-fit: cover !important;
  object-position: top center !important;
  display: block !important;
  width: 100% !important;
}
.course-card:hover .course-img { transform: scale(1.05) !important; }

/* Badge de categoría: entrada animada */
.course-category .badge {
  animation: badgePop 0.4s var(--ease-spring);
  position: relative; overflow: hidden;
}
.course-category .badge::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transform: translateX(-100%);
  transition: transform 0.5s ease;
}
.course-card:hover .course-category .badge::after { transform: translateX(100%); }

/* Botón "Más información": sliding arrow */
.card-footer .btn {
  position: relative; overflow: hidden;
  transition: all 0.3s var(--ease-smooth) !important;
}
.card-footer .btn::after {
  content: '→';
  position: absolute; right: -20px; top: 50%;
  transform: translateY(-50%);
  transition: right 0.3s var(--ease-smooth);
}
.card-footer .btn:hover { padding-right: 2.5rem !important; }
.card-footer .btn:hover::after { right: 16px; }

/* ══════════════════════════════════════════════════════
   7. SECCIÓN "¿POR QUÉ ELEGIR TECNÓPOLIS?" — FEATURES
   ══════════════════════════════════════════════════════ */
.feature-box {
  transition: transform 0.35s var(--ease-spring), box-shadow 0.35s ease !important;
  border-radius: 16px;
  padding: 1.25rem !important;
  background: #fff;
  border: 1px solid transparent;
}
.feature-box:hover {
  transform: translateX(8px) !important;
  box-shadow: -4px 0 0 var(--tec-blue), 0 16px 40px rgba(0,102,179,0.1) !important;
  border-color: rgba(0,102,179,0.08);
}

.feature-icon-circle {
  transition: transform 0.4s var(--ease-spring), box-shadow 0.4s ease !important;
}
.feature-box:hover .feature-icon-circle {
  transform: scale(1.2) rotate(10deg) !important;
  box-shadow: 0 8px 20px rgba(0,102,179,0.3) !important;
}

/* Gradientes para íconos */
.feature-icon-circle.icon-blue   { background: linear-gradient(135deg,#0066B3,#00A8E8) !important; }
.feature-icon-circle.icon-green  { background: linear-gradient(135deg,#10B981,#34D399) !important; }
.feature-icon-circle.icon-teal   { background: linear-gradient(135deg,#0D9488,#14B8A6) !important; }
.feature-icon-circle.icon-amber  { background: linear-gradient(135deg,#D97706,#F59E0B) !important; }

/* ══════════════════════════════════════════════════════
   8. SECCIÓN NOTICIAS — CARDS CON IMAGEN ZOOM
   ══════════════════════════════════════════════════════ */
.news-card.modern-card {
  transition: transform 0.4s var(--ease-spring), box-shadow 0.4s ease !important;
  border-radius: 16px !important;
}
.news-card:hover {
  transform: translateY(-10px) !important;
  box-shadow: 0 25px 60px rgba(0,0,0,0.12) !important;
}

.news-img {
  height: 200px !important;
  object-fit: cover !important;
  object-position: top center !important;
  transition: transform 0.5s var(--ease-smooth) !important;
  display: block !important; width: 100% !important;
}
.news-card:hover .news-img { transform: scale(1.05) !important; }

/* Badge de fecha mejorado */
.news-date.badge {
  backdrop-filter: blur(8px);
  background: linear-gradient(135deg, var(--tec-blue), var(--tec-blue2)) !important;
  border-radius: 8px !important;
}

/* Título: color hover */
.hover-primary { transition: color 0.25s ease !important; }
.hover-primary:hover { color: var(--tec-blue) !important; }

/* ══════════════════════════════════════════════════════
   9. SECTION TITLES — LÍNEA ANIMADA
   ══════════════════════════════════════════════════════ */
.section-title {
  position: relative;
}
.section-title::after {
  content: '';
  position: absolute; bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 0; height: 3px;
  background: linear-gradient(90deg, var(--tec-blue), var(--tec-blue2), var(--tec-gold));
  border-radius: 3px;
  transition: width 0.6s var(--ease-smooth);
}
/* Activar cuando la sección está visible (se combina con AOS) */
.section-header.aos-animate .section-title::after,
[data-aos].aos-animate .section-title::after {
  width: 80px;
}
/* Para títulos de texto izquierdo */
.section-title.text-start::after { left: 0; transform: none; }

/* ══════════════════════════════════════════════════════
   10. FOOTER — LINKS HOVER + SOCIAL ICONS
   ══════════════════════════════════════════════════════ */
.footer-links a {
  position: relative; display: inline-block;
  transition: color 0.25s ease, padding-left 0.25s ease !important;
}
.footer-links a::before {
  content: '›';
  position: absolute; left: -16px;
  opacity: 0; color: var(--tec-blue2);
  transition: opacity 0.25s ease, left 0.25s ease;
}
.footer-links a:hover {
  color: var(--tec-blue2) !important;
  padding-left: 8px !important;
}
.footer-links a:hover::before { opacity: 1; left: -8px; }

.social-link {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(255,255,255,0.08);
  transition: background 0.3s ease, transform 0.3s var(--ease-spring) !important;
}
.social-link:hover {
  background: linear-gradient(135deg, var(--tec-blue), var(--tec-blue2)) !important;
  transform: translateY(-4px) scale(1.15) !important;
}

/* ══════════════════════════════════════════════════════
   11. SIDEBAR CARRERAS — PULSE + GLOW
   ══════════════════════════════════════════════════════ */
.tec-career-btn {
  animation: sidebarEntrance 0.6s var(--ease-spring) both;
}
.tec-career-btn:nth-child(1) { animation-delay: 0.8s; }
.tec-career-btn:nth-child(2) { animation-delay: 1.0s; }
.tec-career-btn:nth-child(3) { animation-delay: 1.2s; }

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

/* Glow en hover */
.tec-career-btn.admin:hover    { box-shadow: 5px 5px 25px rgba(0,102,179,0.45) !important; }
.tec-career-btn.marketing:hover { box-shadow: 5px 5px 25px rgba(249,115,22,0.45) !important; }
.tec-career-btn.talento:hover  { box-shadow: 5px 5px 25px rgba(139,92,246,0.45) !important; }

/* ══════════════════════════════════════════════════════
   12. MEGA MENU — ANIMACIÓN ENTRADA
   ══════════════════════════════════════════════════════ */
.nav-mega, .nav-drop {
  animation: dropdownIn 0.3s var(--ease-smooth);
  transform-origin: top center;
}
@keyframes dropdownIn {
  from { opacity: 0; transform: translateY(-12px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.mega-card {
  transition: transform 0.3s var(--ease-spring), box-shadow 0.3s ease !important;
}
.mega-card:hover {
  transform: translateY(-4px) !important;
  box-shadow: 0 12px 30px rgba(0,0,0,0.15) !important;
}

/* ══════════════════════════════════════════════════════
   13. WHATSAPP CHATBOT — BOUNCE MEJORADO
   ══════════════════════════════════════════════════════ */
.whatsapp-chat-btn {
  animation: waBounce 2s 3s ease-in-out infinite !important;
}
@keyframes waBounce {
  0%, 100% { transform: translateY(0) scale(1); }
  50%       { transform: translateY(-8px) scale(1.05); }
}
.whatsapp-chat-btn::before {
  content: '';
  position: absolute; inset: -6px;
  border-radius: 50%;
  background: rgba(37,211,102,0.25);
  animation: waPulse 2s 3s ease-out infinite;
}
@keyframes waPulse {
  0%   { transform: scale(0.9); opacity: 0.7; }
  70%  { transform: scale(1.4); opacity: 0; }
  100% { transform: scale(0.9); opacity: 0; }
}

/* ══════════════════════════════════════════════════════
   14. POPUP BIENVENIDA — GLASSMORPHISM
   ══════════════════════════════════════════════════════ */
#tp-popup-overlay {
  backdrop-filter: blur(8px) saturate(160%) !important;
}
#tp-popup-box {
  box-shadow: 0 32px 80px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.05) !important;
}

/* ══════════════════════════════════════════════════════
   15. BOTONES GENERALES — MICRO-INTERACCIONES
   ══════════════════════════════════════════════════════ */
.btn {
  transition: transform 0.2s var(--ease-spring), box-shadow 0.2s ease !important;
}
.btn:hover  { transform: translateY(-2px) !important; }
.btn:active { transform: scale(0.97) !important; }

.btn-primary:hover {
  box-shadow: 0 8px 24px rgba(0,102,179,0.35) !important;
}
.btn-outline-primary:hover {
  box-shadow: 0 8px 24px rgba(0,102,179,0.2) !important;
}

/* ══════════════════════════════════════════════════════
   16. SCROLL REVEAL PERSONALIZADO (complementa AOS)
   ══════════════════════════════════════════════════════ */
[data-aos="fade-up"] {
  transition-timing-function: var(--ease-smooth) !important;
}
[data-aos="zoom-in"] {
  transition-timing-function: var(--ease-spring) !important;
}

/* ══════════════════════════════════════════════════════
   17. BACK TO TOP (si existe)
   ══════════════════════════════════════════════════════ */
#backToTop, .back-to-top {
  transition: opacity 0.3s ease, transform 0.3s var(--ease-spring) !important;
}
#backToTop:hover, .back-to-top:hover {
  transform: translateY(-4px) scale(1.1) !important;
}

/* ══════════════════════════════════════════════════════
   18. FORMULARIO FOOTER — FOCUS GLOW
   ══════════════════════════════════════════════════════ */
#footer-contact-form .form-control {
  border: 1px solid rgba(255,255,255,0.08) !important;
  transition: border-color 0.25s ease, box-shadow 0.25s ease !important;
  border-radius: 10px !important;
}
#footer-contact-form .form-control:focus {
  border-color: var(--tec-blue2) !important;
  box-shadow: 0 0 0 3px rgba(0,168,232,0.2) !important;
}
#footer-contact-form .btn[type="submit"] {
  background: linear-gradient(135deg, var(--tec-blue), var(--tec-blue2)) !important;
  border: none !important;
  font-weight: 700 !important;
}

/* ══════════════════════════════════════════════════════
   19. RESPONSIVE — DESACTIVAR ANIMACIONES PESADAS
       en dispositivos que prefieren movimiento reducido
   ══════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ══════════════════════════════════════════════════════
   20. SECTION HIGHLIGHT BORDER — ACENTO IZQUIERDO
   ══════════════════════════════════════════════════════ */
.section-title-left-accent {
  padding-left: 1rem;
  border-left: 4px solid var(--tec-blue);
  position: relative;
}
.section-title-left-accent::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: linear-gradient(180deg, var(--tec-blue), var(--tec-gold));
  border-radius: 4px;
}
