/* ==========================================================================
   GLOBAL RESET, CORE LAYOUT & RESPONSIVE GRID (MAIN.CSS)
   ========================================================================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  cursor: none !important; /* Hide native cursor globally */
}

/* ==================== 🏹 CUSTOM CURSOR (TIAGOTECH TECH ARROW - OPCIÓN 1) ==================== */
#cursor-dot {
  position: fixed;
  top: 0;
  left: 0;
  width: 26px;
  height: 26px;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  pointer-events: none;
  z-index: 9999999 !important;
  will-change: transform;
  transform: translate3d(-100px, -100px, 0);
  transition: opacity 0.25s ease;
}

#cursor-dot svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  filter: drop-shadow(0 2px 8px rgba(0, 132, 255, 0.65));
  transition: transform 0.15s cubic-bezier(0.2, 0, 0.1, 1), filter 0.2s ease;
  transform-origin: 2px 2px;
}

#cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  width: 32px;
  height: 32px;
  margin-top: -16px;
  margin-left: -16px;
  border: 1.5px dashed var(--accent-secondary);
  background: transparent;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999998 !important;
  will-change: transform;
  transform: translate3d(-100px, -100px, 0);
  opacity: 0.4;
  box-shadow: 0 0 10px rgba(var(--accent-green-rgb), 0.25);
  transition: opacity 0.25s ease, border-color 0.25s ease, width 0.22s ease, height 0.22s ease, margin 0.22s ease, box-shadow 0.25s ease;
}

/* Estado al pasar por botones o elementos interactivos (Target Locked) */
body.cursor-hover #cursor-dot svg {
  transform: scale(1.18) rotate(-8deg);
  filter: drop-shadow(0 0 12px #22C55E);
}

body.cursor-hover #cursor-ring {
  width: 44px;
  height: 44px;
  margin-top: -22px;
  margin-left: -22px;
  border: 2px solid var(--accent-primary);
  border-radius: 50%;
  opacity: 0.9;
  box-shadow: 0 0 18px rgba(var(--accent-rgb), 0.5);
}

/* Feedback de clic táctil (Disparo/Recoil) */
body.cursor-click #cursor-dot svg {
  transform: scale(0.85);
}

body.cursor-click #cursor-ring {
  border-color: #ffffff;
  box-shadow: 0 0 20px #ffffff;
}


/* Touch & Mobile Cursor Fallback */
@media (hover: none), (max-width: 768px) {
  * {
    cursor: auto !important;
  }
  #cursor-dot, #cursor-ring {
    display: none !important;
  }
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  line-height: 1.6;
  /* Smoothly transition themes */
  transition: 
    background-color var(--transition-speed) var(--transition-ease),
    color var(--transition-speed) var(--transition-ease),
    font-family var(--transition-speed) var(--transition-ease);
}

/* ==================== 🌌 CYBER GRID & SPOTLIGHT AURORA BACKGROUND ==================== */
/* Capa 1: Cuadrícula cibernética milimétrica técnica (GPU Composited) */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: -4;
  pointer-events: none;
  background-color: var(--bg-primary);
  background-image: 
    linear-gradient(rgba(0, 132, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 132, 255, 0.05) 1px, transparent 1px),
    linear-gradient(rgba(34, 197, 94, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 197, 94, 0.02) 1px, transparent 1px);
  background-size: 50px 50px, 50px 50px, 12.5px 12.5px, 12.5px 12.5px;
  background-position: center center;
  transform: translateZ(0);
}

/* Capa 2: Foco interactivo (Renderizado en Canvas de alta velocidad para 144 FPS) */
body::after {
  display: none;
}

/* Capa 3: Luces Aurora Ambientales (Glow Líquido Optimizado) */
.aurora-bg-container {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: -2;
  pointer-events: none;
  overflow: hidden;
  transform: translateZ(0);
}

.aurora-orb {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  transform: translateZ(0);
}

.aurora-orb-blue {
  width: 520px;
  height: 520px;
  top: -120px;
  right: -60px;
  background: radial-gradient(circle, rgba(0, 132, 255, 0.28) 0%, rgba(0, 132, 255, 0.08) 45%, transparent 70%);
  animation: auroraFloat1 18s ease-in-out infinite alternate;
}

.aurora-orb-green {
  width: 440px;
  height: 440px;
  top: 45%;
  left: -100px;
  background: radial-gradient(circle, rgba(34, 197, 94, 0.22) 0%, rgba(34, 197, 94, 0.06) 45%, transparent 70%);
  animation: auroraFloat2 22s ease-in-out infinite alternate;
}

.aurora-orb-cyan {
  width: 480px;
  height: 480px;
  bottom: -100px;
  right: 15%;
  background: radial-gradient(circle, rgba(2, 132, 199, 0.22) 0%, rgba(34, 197, 94, 0.12) 35%, transparent 70%);
  animation: auroraFloat3 26s ease-in-out infinite alternate;
}

@keyframes auroraFloat1 {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(-60px, 80px, 0) scale(1.15); }
  100% { transform: translate3d(50px, 120px, 0) scale(0.95); }
}

@keyframes auroraFloat2 {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(80px, -60px, 0) scale(1.1); }
  100% { transform: translate3d(40px, 80px, 0) scale(0.92); }
}

@keyframes auroraFloat3 {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(-80px, -70px, 0) scale(1.18); }
  100% { transform: translate3d(60px, -30px, 0) scale(1); }
}

/* ==================== 🕸️ CUSTOM SCROLLBAR ==================== */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
  transition: background var(--transition-speed) var(--transition-ease);
}

::-webkit-scrollbar-thumb {
  background: var(--card-border);
  border: 2px solid var(--bg-primary);
  border-radius: 5px;
  transition: background var(--transition-speed) var(--transition-ease);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-primary);
  box-shadow: var(--glow-shadow);
}

/* ==================== 🌌 CANVAS BACKGROUND (CHISPAS DIGITALES) ==================== */
#bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  pointer-events: none;
  background-color: transparent;
  transform: translateZ(0);
  will-change: transform;
}

/* ==================== ⚡ GLITCH TRANSITION OVERLAY ==================== */
.transition-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #000;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s ease;
}

.transition-overlay.active {
  opacity: 1;
  animation: flash-glitch 0.4s steps(2) forwards;
}

.transition-overlay::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--accent-primary);
  box-shadow: var(--glow-shadow);
  opacity: 0;
}

.transition-overlay.active::after {
  opacity: 1;
  animation: scanline 0.4s linear forwards;
}

@keyframes flash-glitch {
  0% { background: rgba(var(--accent-rgb), 0.25); }
  50% { background: rgba(var(--accent-green-rgb), 0.25); }
  100% { background: rgba(0, 0, 0, 0); }
}

@keyframes scanline {
  0% { top: 0%; }
  100% { top: 100%; }
}

/* ==================== 🧱 GLOBAL CONTAINER ==================== */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-md);
}

section {
  padding: var(--spacing-xl) 0;
  position: relative;
  overflow: hidden;
}

/* ==================== 🧭 CABECERA / HEADER ==================== */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  background: rgba(var(--accent-rgb), 0.02);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(var(--accent-rgb), 0.08);
  transition: 
    background var(--transition-speed) var(--transition-ease),
    border-color var(--transition-speed) var(--transition-ease);
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 80px;
}

/* Logo Design */
.logo {
  font-size: 22px;
  font-weight: 800;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-accent);
  letter-spacing: -0.5px;
  transition: all var(--transition-speed) var(--transition-ease);
}

.logo::before {
  content: '';
  display: inline-block;
  width: 32px;
  height: 32px;
  background: url('../assets/img/tiagotech-symbol.png') no-repeat center center / contain;
  filter: drop-shadow(0 0 10px rgba(0, 132, 255, 0.5));
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.3s ease;
  flex-shrink: 0;
}

.logo img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  flex-shrink: 0;
}

.logo:hover::before {
  transform: rotate(10deg) scale(1.1);
  filter: drop-shadow(0 0 16px rgba(34, 197, 94, 0.65));
}

.logo .logo-text {
  color: #FFFFFF;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.logo .logo-accent {
  color: var(--accent-secondary);
  font-weight: 800;
}

.logo .code-tag {
  color: var(--text-muted);
  font-family: var(--font-code);
  font-weight: 400;
  font-size: 16px;
  opacity: 0.6;
  margin: 0 2px;
}

/* Nav Links */
nav {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

.nav-links {
  display: flex;
  list-style: none;
  gap: var(--spacing-md);
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  font-size: 15px;
  transition: color var(--transition-speed) ease, text-shadow 0.3s ease;
  position: relative;
  padding: 4px 0;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent-primary);
  box-shadow: var(--glow-shadow);
  transition: width 0.3s ease;
}

.nav-links a:hover {
  color: var(--accent-primary);
  text-shadow: 0 0 10px rgba(var(--accent-rgb), 0.5);
}

.nav-links a:hover::after {
  width: 100%;
}

/* ==================== 🎛️ IDENTITY TOGGLE DUAL SWITCH ==================== */
.theme-switch-container {
  display: flex;
  align-items: center;
  position: relative;
  cursor: pointer;
  user-select: none;
  border-radius: 30px;
  transition: all var(--transition-speed) var(--transition-ease);
}

/* ==================== 🃏 GLASS CARDS & UI ELEMENTS ==================== */
.glass-card {
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--card-border);
  border-radius: var(--border-radius-md);
  padding: var(--spacing-md);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  transform: translateZ(0);
  backface-visibility: hidden;
  will-change: transform;
  transition: 
    border-color var(--transition-speed) var(--transition-ease),
    transform 0.25s ease,
    box-shadow 0.25s ease,
    background-color var(--transition-speed) var(--transition-ease);
}

.glass-card:hover {
  border-color: var(--card-border-hover);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.35), 0 0 20px rgba(var(--accent-rgb), 0.2);
}

/* ==================== ✨ 3D TILT & HOLOGRAPHIC GLARE ==================== */
.tilt-card {
  position: relative;
  transform-style: preserve-3d;
  will-change: transform;
  backface-visibility: hidden;
  transition: transform 0.15s cubic-bezier(0.2, 0, 0.2, 1), box-shadow 0.25s ease, border-color 0.3s ease;
}

.card-glare {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 15;
  opacity: 0;
  transition: opacity 0.25s ease;
  mix-blend-mode: screen;
  overflow: hidden;
}


/* Titles */
.section-title {
  font-size: 36px;
  font-weight: 800;
  text-align: center;
  margin-top: 80px; /* Generosa separación del final de la sección/información anterior */
  margin-bottom: var(--spacing-lg);
  font-family: var(--font-accent);
  position: relative;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.section-title span {
  background: var(--btn-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  position: relative;
  display: inline-block;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-xs);
  padding: 14px 28px;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  background: var(--btn-gradient);
  border: none;
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.3s ease;
  box-shadow: 0 4px 15px rgba(var(--accent-rgb), 0.3);
  font-family: var(--font-accent);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.25) 50%,
    transparent 100%
  );
  transition: left 0.6s ease;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(var(--accent-rgb), 0.5), var(--glow-shadow);
}

.btn:hover::before {
  left: 100%;
}

.btn:active {
  transform: translateY(1px);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--accent-primary);
  color: var(--accent-primary);
  box-shadow: none;
}

.btn-outline:hover {
  background: rgba(var(--accent-rgb), 0.1);
  color: #fff;
  border-color: var(--accent-primary);
}



/* ==================== 🛠️ RESPONSIVE STYLING & MOBILE NAVIGATION ==================== */
/* Botón de Menú Hamburguesa Responsivo */
.mobile-menu-btn {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 20px;
  background: transparent;
  border: none;
  cursor: none !important; /* Respetar cursor custom */
  z-index: 110;
  padding: 0;
}

.mobile-menu-btn span {
  display: block;
  width: 100%;
  height: 3px;
  background-color: var(--accent-primary);
  box-shadow: 0 0 8px rgba(var(--accent-rgb), 0.5);
  border-radius: 2px;
  transition: transform 0.4s var(--transition-ease), opacity 0.3s ease, background-color 0.4s ease, box-shadow 0.4s ease;
}

/* Animaciones del botón al transformarse en X */
.mobile-menu-btn.active span:nth-child(1) {
  transform: translateY(8.5px) rotate(45deg);
}

.mobile-menu-btn.active span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.mobile-menu-btn.active span:nth-child(3) {
  transform: translateY(-8.5px) rotate(-45deg);
}

/* Menú Móvil Lateral Glassmorphic Overlay */
.mobile-nav-overlay {
  position: fixed;
  top: 0;
  right: -100%;
  width: 80%;
  max-width: 320px;
  height: 100vh;
  z-index: 105;
  background: rgba(10, 10, 12, 0.85);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border-left: 1px solid var(--card-border);
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5), inset 10px 0 30px rgba(var(--accent-rgb), 0.02);
  display: flex;
  flex-direction: column;
  padding: 100px var(--spacing-md) var(--spacing-xl) var(--spacing-md);
  transition: right 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94), border-color var(--transition-speed) ease;
}

.mobile-nav-overlay.active {
  right: 0;
  border-color: var(--accent-primary);
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.6), 0 0 25px rgba(var(--accent-rgb), 0.15);
}

.mobile-nav-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  margin-bottom: auto;
}

.mobile-nav-links a {
  color: var(--text-primary);
  text-decoration: none;
  font-size: 20px;
  font-weight: 700;
  font-family: var(--font-accent);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 8px 12px;
  border-left: 2px solid transparent;
  display: block;
  transition: all 0.3s ease;
}

.mobile-nav-links a:hover {
  color: var(--accent-primary);
  border-left-color: var(--accent-primary);
  background: rgba(var(--accent-rgb), 0.05);
  text-shadow: 0 0 10px rgba(var(--accent-rgb), 0.4);
  transform: translateX(6px);
}


@media (max-width: 768px) {
  .header-container {
    height: 70px;
  }
  
  .nav-links {
    display: none; /* Ocultar menú de escritorio */
  }
  
  .mobile-menu-btn {
    display: flex; /* Mostrar botón hamburguesa */
  }
  
  .section-title {
    font-size: 28px;
    margin-top: 50px;
  }
  
  section {
    padding: var(--spacing-lg) 0;
  }
  
  /* Ajuste responsivo de widgets flotantes para evitar colisiones y superposiciones en móviles */
  .music-player-widget {
    bottom: 16px;
    left: 16px;
    max-width: 50px;
    padding: 8px;
  }
  
  .music-player-widget:hover {
    max-width: 280px;
  }
  
  .music-player-widget:hover .music-player-details {
    width: 200px;
  }
  
  .chatbot-widget {
    bottom: 16px;
    right: 16px;
  }
  
  .chatbot-bubble {
    width: 50px;
    height: 50px;
  }
  
  .chatbot-bubble-avatar {
    font-size: 22px;
  }
  
  .chatbot-window {
    width: 290px;
    height: 420px;
    bottom: 65px;
    right: -10px;
  }
  
  .chatbot-header {
    padding: 8px 12px;
  }
  
  .chatbot-messages {
    padding: 12px;
    gap: 8px;
  }
}

@media (max-width: 480px) {
  /* En pantallas súper angostas movemos el reproductor para dar prioridad total al chatbot */
  .music-player-widget {
    bottom: 80px; /* Lo subimos para que no se encime en pantallas ultra compactas */
    left: 16px;
  }
}

/* ==================== 🎵 GLOBAL FLOTANTE MUSIC PLAYER WIDGET ==================== */
.music-player-widget {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 999;
  background: rgba(10, 10, 12, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--card-border);
  padding: 10px;
  border-radius: 30px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 15px rgba(var(--accent-rgb), 0.15);
  transition: all 0.4s var(--transition-ease);
  max-width: 60px;
  overflow: hidden;
}

.music-player-widget:hover {
  max-width: 320px;
  border-radius: 16px;
  border-color: var(--accent-primary);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.6), 0 0 20px rgba(var(--accent-rgb), 0.3);
}

.music-player-compact {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.music-vinyl-disc {
  font-size: 24px;
  animation: spinVinyl 3s linear infinite paused;
  transition: transform 0.3s ease;
  user-select: none;
}

.music-player-widget.playing .music-vinyl-disc {
  animation-play-state: running;
}

@keyframes spinVinyl {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.music-eq-bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 20px;
  width: 20px;
}

.music-eq-bars .bar {
  width: 3px;
  height: 3px;
  background: var(--accent-primary);
  border-radius: 1px;
  transition: height 0.3s ease;
  animation: bounceEq 1.2s ease infinite alternate paused;
}

.music-player-widget.playing .music-eq-bars .bar {
  animation-play-state: running;
}

.music-eq-bars .bar:nth-child(2) { animation-delay: 0.15s; }
.music-eq-bars .bar:nth-child(3) { animation-delay: 0.3s; }
.music-eq-bars .bar:nth-child(4) { animation-delay: 0.45s; }

@keyframes bounceEq {
  0% { height: 3px; }
  100% { height: 18px; }
}

.music-control-mini-btn {
  background: var(--btn-gradient);
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: #fff;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--glow-shadow);
  transition: transform 0.2s;
}

.music-control-mini-btn:hover {
  transform: scale(1.1);
}

.music-player-details {
  display: flex;
  flex-direction: column;
  gap: 8px;
  opacity: 0;
  white-space: nowrap;
  transition: opacity 0.3s ease;
  width: 0;
}

.music-player-widget:hover .music-player-details {
  opacity: 1;
  width: 230px;
}

.track-info h5 {
  font-family: var(--font-accent);
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  margin: 0;
  text-transform: uppercase;
}

.track-info span {
  font-size: 10px;
  color: var(--text-muted);
}

.track-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.music-action-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 16px;
  cursor: pointer;
  transition: color 0.2s, transform 0.2s;
}

.music-action-btn:hover {
  color: var(--accent-primary);
  transform: scale(1.15);
}

.volume-slider-box {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
}

.volume-slider-box input[type="range"] {
  flex-grow: 1;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  accent-color: var(--accent-primary);
  outline: none;
  cursor: pointer;
}

/* ==================== 🤖 GLOBAL FLOTANTE CHATBOT IA WIDGET ==================== */
.chatbot-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  font-family: var(--font-main);
}

.chatbot-bubble {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(10, 10, 12, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 2px solid var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(var(--accent-rgb), 0.25);
  transition: transform 0.3s ease, border-color 0.4s ease, box-shadow 0.4s ease;
  position: relative;
}

.chatbot-bubble-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chatbot-bubble-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform 0.3s ease;
}

.chatbot-bubble:hover .chatbot-bubble-avatar img {
  transform: scale(1.1);
}

.chatbot-bubble:hover {
  transform: scale(1.08) rotate(5deg);
  border-color: var(--accent-secondary);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.6), 0 0 25px rgba(255, 106, 0, 0.4);
}

.chatbot-pulse {
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  border: 2px solid var(--accent-primary);
  animation: chatPulse 2s linear infinite;
  opacity: 0;
  pointer-events: none;
}

@keyframes chatPulse {
  0% { transform: scale(1); opacity: 0.5; }
  100% { transform: scale(1.3); opacity: 0; }
}

.chatbot-window {
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 350px;
  max-width: calc(100vw - 32px);
  height: 520px;
  max-height: calc(100vh - 110px);
  background: rgba(10, 10, 14, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--card-border);
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.7), 0 0 25px rgba(var(--accent-rgb), 0.2);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px) scale(0.95);
  transition: all 0.4s var(--transition-ease);
}

.chatbot-window.active {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0) scale(1);
  border-color: var(--accent-primary);
}

.chatbot-header {
  background: rgba(var(--accent-rgb), 0.05);
  border-bottom: 1px solid rgba(var(--accent-rgb), 0.15);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
}

.chatbot-header-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--accent-secondary);
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.4);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0B1120;
}

.chatbot-header-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.chatbot-header-info h4 {
  font-family: var(--font-accent);
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.chatbot-header-info span {
  font-size: 9px;
  color: var(--accent-primary);
  font-weight: 700;
}

.chatbot-reset-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.2s ease, color 0.2s ease;
}
.chatbot-reset-btn:hover {
  color: var(--accent-primary);
  transform: rotate(90deg);
}

.chatbot-close-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 20px;
  cursor: pointer;
  transition: color 0.2s;
  line-height: 1;
}

.chatbot-close-btn:hover {
  color: var(--accent-primary);
}

.chatbot-messages {
  flex-grow: 1;
  padding: 14px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scrollbar-width: thin;
  scrollbar-color: rgba(var(--accent-rgb), 0.45) rgba(0, 0, 0, 0.2);
}

.chatbot-messages::-webkit-scrollbar {
  width: 5px;
}
.chatbot-messages::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}
.chatbot-messages::-webkit-scrollbar-thumb {
  background: rgba(var(--accent-rgb), 0.35);
  border-radius: 4px;
}
.chatbot-messages::-webkit-scrollbar-thumb:hover {
  background: rgba(var(--accent-rgb), 0.7);
}

.chatbot-msg, .chat-message {
  max-width: 92%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 12.5px;
  line-height: 1.5;
  animation: msgFadeIn 0.25s ease forwards;
  word-break: break-word;
}

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

.chatbot-msg-bot, .chat-message.assistant {
  align-self: flex-start;
  background: rgba(10, 20, 36, 0.94);
  border: 1px solid rgba(var(--accent-rgb), 0.22);
  color: #e2e8f0;
  border-bottom-left-radius: 2px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.chatbot-msg-user, .chat-message.user {
  align-self: flex-end;
  background: var(--btn-gradient);
  color: #020b14;
  font-weight: 600;
  border-bottom-right-radius: 2px;
  box-shadow: 0 4px 14px rgba(var(--accent-rgb), 0.35);
}

.chatbot-typing {
  align-self: flex-start;
  background: rgba(10, 20, 36, 0.85);
  border: 1px solid rgba(var(--accent-rgb), 0.2);
  padding: 10px 14px;
  border-radius: 12px;
  border-bottom-left-radius: 2px;
  display: flex;
  gap: 5px;
  margin-left: 14px;
  margin-bottom: 8px;
}

.chatbot-typing span {
  width: 6px;
  height: 6px;
  background: var(--accent-primary);
  border-radius: 50%;
  animation: typingPulse 0.8s infinite alternate;
}

.chatbot-typing span:nth-child(2) { animation-delay: 0.2s; }
.chatbot-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingPulse {
  0% { transform: scale(0.9); opacity: 0.4; }
  100% { transform: scale(1.3); opacity: 1; }
}

/* Ocultar barra horizontal previa con scrollbar lateral */
.chatbot-prompts {
  display: none !important;
}

/* Lista vertical ordenada de sistemas (de arriba hacia abajo) */
.chatbot-systems-menu {
  width: 100%;
  margin-top: 6px;
}

.chatbot-menu-header {
  font-size: 11.5px;
  color: #94a3b8;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.chatbot-systems-vertical-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  width: 100%;
}

.chatbot-system-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(var(--accent-rgb), 0.22);
  border-radius: 10px;
  padding: 8px 12px;
  color: #fff;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
  font-family: inherit;
  width: 100%;
  box-sizing: border-box;
}

.chatbot-system-row:hover {
  background: rgba(var(--accent-green-rgb), 0.12);
  border-color: var(--accent-secondary);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(var(--accent-green-rgb), 0.22);
}

.chatbot-system-row:active {
  transform: translateY(0);
}

.chatbot-sys-icon {
  font-size: 18px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 24px;
}

.chatbot-sys-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.chatbot-sys-info strong {
  font-size: 12px;
  color: #fff;
  font-weight: 600;
  line-height: 1.25;
}

.chatbot-sys-info small {
  font-size: 10px;
  color: #94a3b8;
  margin-top: 2px;
  line-height: 1.2;
}

.chatbot-sys-arrow {
  font-size: 16px;
  color: var(--accent-primary);
  font-weight: bold;
  opacity: 0.7;
  transition: transform 0.2s ease, opacity 0.2s ease, color 0.2s ease;
  flex-shrink: 0;
  margin-left: 4px;
}

.chatbot-system-row:hover .chatbot-sys-arrow {
  color: var(--accent-secondary);
  transform: translateX(3px);
  opacity: 1;
}

.chatbot-system-row.chatbot-sys-whatsapp {
  border-color: rgba(37, 211, 102, 0.35);
  background: rgba(37, 211, 102, 0.08);
}

.chatbot-system-row.chatbot-sys-whatsapp:hover {
  border-color: #25d366;
  background: rgba(37, 211, 102, 0.18);
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.25);
}

.chatbot-system-row.chatbot-sys-whatsapp .chatbot-sys-arrow {
  color: #25d366;
}

.chatbot-back-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(var(--accent-rgb), 0.25);
  color: #e2e8f0;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 11.5px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  font-weight: 600;
  width: 100%;
  box-sizing: border-box;
}

.chatbot-back-btn:hover {
  background: rgba(var(--accent-rgb), 0.15);
  border-color: var(--accent-primary);
  color: #fff;
}

/* Barra de Entrada de Texto Libre */
.chatbot-input-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: rgba(14, 14, 20, 0.95);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.chatbot-input-field {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  padding: 8px 14px;
  color: #fff;
  font-family: var(--font-main, sans-serif);
  font-size: 12.5px;
  outline: none;
  transition: all 0.25s ease;
}

.chatbot-input-field:focus {
  border-color: var(--accent-primary);
  background: rgba(0, 0, 0, 0.4);
  box-shadow: 0 0 10px rgba(var(--accent-rgb), 0.25);
}

.chatbot-send-btn {
  background: var(--accent-primary);
  border: none;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  flex-shrink: 0;
}

.chatbot-send-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 0 12px rgba(var(--accent-rgb), 0.6);
}

/* Botones interactivos dentro de las respuestas del bot */
.chat-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(var(--accent-rgb), 0.15);
  border: 1px solid var(--accent-primary);
  color: #fff !important;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 8px;
  margin-right: 6px;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.chat-action-btn:hover {
  background: var(--accent-primary);
  color: #000 !important;
  box-shadow: 0 0 12px rgba(var(--accent-rgb), 0.6);
  transform: translateY(-1px);
}
