/* ============================================
   GLOBAL FONT SETTINGS
   Let Tailwind CSS handle font sizes, just set base
   ============================================ */

html, body {
  overflow-x: hidden;
  max-width: 100vw;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: white;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Force all text to be white - override gray colors */
[class*="text-gray"],
[class*="text-slate"],
[class*="text-zinc"],
[class*="text-neutral"],
.text-gray-400,
.text-gray-500,
.text-gray-600,
.text-gray-800 {
  color: white !important;
}

/* Display font for headings */
.font-display {
  font-family: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* Better text rendering - minimal styles */
h1, h2, h3, h4, h5, h6 {
  letter-spacing: -0.01em;
}

p {
  line-height: 1.7;
}

/* Links */
a {
  transition: color 0.2s ease;
}

/* ============================================
   ZOOM OUT ANIMATION - Installation to Universe
   Inspired by cosmic zoom effect
   ============================================ */

@keyframes zoomOut {
  0% {
    /* Installation close-up view */
    background-image: 
      radial-gradient(circle at 50% 50%, rgba(26, 115, 232, 0.4) 0%, transparent 20%),
      repeating-linear-gradient(0deg, rgba(255,255,255,0.05) 0px, transparent 2px, transparent 3px, rgba(255,255,255,0.05) 3px),
      repeating-linear-gradient(90deg, rgba(255,255,255,0.05) 0px, transparent 2px, transparent 3px, rgba(255,255,255,0.05) 3px);
    background-size: 100% 100%, 30px 30px, 30px 30px;
    background-position: 50% 50%, 0 0, 0 0;
    opacity: 1;
  }
  15% {
    /* Zooming out from building */
    background-image: 
      radial-gradient(circle at 50% 50%, rgba(26, 115, 232, 0.35) 0%, transparent 25%),
      repeating-linear-gradient(0deg, rgba(255,255,255,0.06) 0px, transparent 2px, transparent 5px, rgba(255,255,255,0.06) 5px),
      repeating-linear-gradient(90deg, rgba(255,255,255,0.06) 0px, transparent 2px, transparent 5px, rgba(255,255,255,0.06) 5px);
    background-size: 150% 150%, 50px 50px, 50px 50px;
    background-position: 50% 50%, 5px 5px, 5px 5px;
    opacity: 0.95;
  }
  30% {
    /* City block view */
    background-image: 
      radial-gradient(circle at 50% 50%, rgba(26, 115, 232, 0.3) 0%, transparent 30%),
      repeating-linear-gradient(0deg, rgba(255,255,255,0.07) 0px, transparent 3px, transparent 8px, rgba(255,255,255,0.07) 8px),
      repeating-linear-gradient(90deg, rgba(255,255,255,0.07) 0px, transparent 3px, transparent 8px, rgba(255,255,255,0.07) 8px);
    background-size: 250% 250%, 80px 80px, 80px 80px;
    background-position: 50% 50%, 15px 15px, 15px 15px;
    opacity: 0.9;
  }
  45% {
    /* City skyline */
    background-image: 
      radial-gradient(circle at 50% 50%, rgba(26, 115, 232, 0.25) 0%, transparent 35%),
      repeating-linear-gradient(0deg, rgba(255,255,255,0.08) 0px, transparent 4px, transparent 12px, rgba(255,255,255,0.08) 12px),
      repeating-linear-gradient(90deg, rgba(255,255,255,0.08) 0px, transparent 4px, transparent 12px, rgba(255,255,255,0.08) 12px);
    background-size: 400% 400%, 120px 120px, 120px 120px;
    background-position: 50% 50%, 30px 30px, 30px 30px;
    opacity: 0.85;
  }
  60% {
    /* Earth view */
    background-image: 
      radial-gradient(circle at 50% 50%, rgba(26, 115, 232, 0.2) 0%, transparent 40%),
      radial-gradient(ellipse at 30% 70%, rgba(255,255,255,0.05) 0%, transparent 30%),
      radial-gradient(ellipse at 70% 30%, rgba(255,255,255,0.05) 0%, transparent 30%);
    background-size: 600% 600%, 300% 300%, 300% 300%;
    background-position: 50% 50%, 30% 70%, 70% 30%;
    opacity: 0.8;
  }
  75% {
    /* Solar system */
    background-image: 
      radial-gradient(circle at 50% 50%, rgba(26, 115, 232, 0.15) 0%, transparent 45%),
      radial-gradient(circle at 20% 20%, rgba(255,255,255,0.04) 0%, transparent 25%),
      radial-gradient(circle at 80% 80%, rgba(255,255,255,0.04) 0%, transparent 25%);
    background-size: 800% 800%, 400% 400%, 400% 400%;
    background-position: 50% 50%, 20% 20%, 80% 80%;
    opacity: 0.7;
  }
  100% {
    /* Universe / Galaxy view */
    background-image: 
      radial-gradient(circle at 50% 50%, rgba(26, 115, 232, 0.1) 0%, transparent 50%),
      radial-gradient(circle at 15% 85%, rgba(255,255,255,0.02) 0%, transparent 20%),
      radial-gradient(circle at 85% 15%, rgba(255,255,255,0.02) 0%, transparent 20%);
    background-size: 1200% 1200%, 800% 800%, 800% 800%;
    background-position: 50% 50%, 15% 85%, 85% 15%;
    opacity: 0.6;
  }
}

.zoom-out-animation {
  position: absolute;
  inset: 0;
  animation: zoomOut 20s ease-in-out infinite;
}

/* Fade in animation for content */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 1.2s ease-out forwards;
}

/* Gradient animation for text */
@keyframes animate-gradient {
  0%, 100% {
    background-size: 200% 200%;
    background-position: left center;
  }
  50% {
    background-size: 200% 200%;
    background-position: right center;
  }
}

.animate-gradient {
  animation: animate-gradient 3s ease infinite;
}

/* ============================================
   CHATBOT WIDGET STYLES
   ============================================ */

.chat-button {
  width: 56px;
  height: 56px;
  position: relative;
}

.chat-button:hover {
  transform: scale(1.1);
}

.chat-notification {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: .5;
  }
}

/* ============================================ */
/* CHATBOT RESPONSIVE & ANTARES THEME */
/* ============================================ */

.chat-window {
  width: 384px;
  max-width: calc(100vw - 32px);
  max-height: 600px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .chat-window {
    width: calc(100vw - 24px);
    max-height: calc(100vh - 120px);
    right: 12px !important;
    bottom: 80px !important;
    position: fixed !important;
  }

  #chatbot-widget {
    right: 12px;
    bottom: 12px;
  }

  /* Asegurar que el header del chat sea accesible */
  .chat-window > div:first-child {
    min-height: 60px;
    padding: 12px 16px !important;
  }

  /* Botón de cerrar más grande y accesible en móvil */
  #chat-close {
    padding: 8px;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Área de mensajes con altura fija */
  #chat-messages {
    height: 280px !important;
    max-height: 40vh !important;
    min-height: 200px;
  }

  /* Quick actions más compactas */
  #quick-actions {
    padding: 8px !important;
  }

  #quick-actions .flex-wrap {
    gap: 4px !important;
  }

  .quick-action-btn {
    padding: 6px 10px !important;
    font-size: 11px !important;
  }

  /* Input area compacta */
  .chat-window > div:last-child {
    padding: 8px 12px !important;
  }

  #chat-input {
    padding: 8px 12px !important;
    font-size: 14px !important;
  }
}

@media (max-width: 480px) {
  .chat-window {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 100px);
    right: 8px !important;
    left: 8px !important;
    bottom: 70px !important;
  }

  #chatbot-widget {
    right: 8px;
    bottom: 8px;
  }

  /* Mensajes más pequeños */
  #chat-messages {
    height: 250px !important;
    max-height: 35vh !important;
    padding: 8px !important;
  }

  #chat-messages > div {
    max-width: 90% !important;
  }
}

/* Quick Action Buttons - Dark Theme */
.quick-action-btn {
  color: white !important;
  font-weight: 500;
}

.quick-action-btn:hover {
  background-color: #1a73e8 !important;
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -5px rgba(26, 115, 232, 0.3);
}

/* Shimmer Animation for Header */
@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

.animate-shimmer {
  animation: shimmer 3s infinite;
}

/* Fade In Animation for Messages */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fadeIn {
  animation: fadeIn 0.3s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideDown {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(20px);
  }
}

/* Explore curved arrow with continuous animation */
.explore-arrow-container {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-left: 12px;
  width: 36px;
  height: 36px;
}

.explore-arrow-img {
  width: 32px;
  height: 32px;
  transform: rotate(45deg);
  filter: brightness(0) saturate(100%);
  animation: arrowCurveMove 1s ease-in-out infinite;
}

/* Color filters for each service */
.text-antares-blue .explore-arrow-img {
  filter: brightness(0) saturate(100%) invert(44%) sepia(98%) saturate(1847%) hue-rotate(196deg) brightness(96%) contrast(91%);
}

.text-orange-500 .explore-arrow-img {
  filter: brightness(0) saturate(100%) invert(57%) sepia(95%) saturate(1538%) hue-rotate(360deg) brightness(101%) contrast(105%);
}

.text-green-500 .explore-arrow-img {
  filter: brightness(0) saturate(100%) invert(62%) sepia(52%) saturate(512%) hue-rotate(88deg) brightness(93%) contrast(88%);
}

@keyframes arrowCurveMove {
  0% {
    transform: rotate(45deg) translate(0, 0);
    opacity: 1;
  }
  50% {
    transform: rotate(45deg) translate(4px, -4px);
    opacity: 0.8;
  }
  100% {
    transform: rotate(45deg) translate(0, 0);
    opacity: 1;
  }
}

/* Ghost arrows flowing outward */
.explore-arrow-ghost {
  position: absolute;
  width: 26px;
  height: 26px;
  transform: rotate(45deg);
  opacity: 0;
}

.explore-arrow-ghost-1 {
  animation: arrowGhostFlow 1.5s ease-out infinite;
}

.explore-arrow-ghost-2 {
  animation: arrowGhostFlow 1.5s ease-out infinite 0.5s;
}

.explore-arrow-ghost-3 {
  animation: arrowGhostFlow 1.5s ease-out infinite 1s;
}

@keyframes arrowGhostFlow {
  0% {
    transform: rotate(45deg) translate(0, 0);
    opacity: 0.6;
  }
  100% {
    transform: rotate(45deg) translate(15px, -15px);
    opacity: 0;
  }
}

/* Animation always active - no hover interruption */

#chat-messages::-webkit-scrollbar {
  width: 6px;
}

#chat-messages::-webkit-scrollbar-track {
  background: rgba(26, 115, 232, 0.1);
  border-radius: 10px;
}

#chat-messages::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #1a73e8, #0d47a1);
  border-radius: 10px;
}

#chat-messages::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #0d47a1, #1a73e8);
}

/* Quick action buttons */
.quick-action-btn {
  transition: all 0.2s ease;
}

.quick-action-btn:hover {
  transform: translateY(-2px);
}

/* ============================================
   CALL-TO-ACTION BUTTONS
   ============================================ */

.cta-phone-button {
  position: fixed;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  z-index: 40;
  background: linear-gradient(135deg, #1a73e8 0%, #0d47a1 100%);
  color: white;
  padding: 16px 12px;
  border-radius: 8px 0 0 8px;
  box-shadow: -4px 4px 20px rgba(26, 115, 232, 0.4);
  transition: all 0.3s ease;
  writing-mode: vertical-rl;
  text-orientation: mixed;
}

.cta-phone-button:hover {
  padding-right: 20px;
  box-shadow: -6px 6px 30px rgba(26, 115, 232, 0.6);
}

@media (max-width: 768px) {
  .cta-phone-button {
    display: none;
  }
}

/* ============================================
   ANTARES INNOVATE - PREMIUM STYLING
   ============================================ */

:root {
  --antares-blue: #1a73e8;
  --antares-dark: #0a0f1a;
  --antares-gray: #151921;
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Smooth Scrolling */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--antares-dark);
}

::-webkit-scrollbar-thumb {
  background: var(--antares-blue);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: #1557b0;
}

/* Grid Pattern Background */
.grid-pattern {
  background-image: 
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 50px 50px;
  width: 100%;
  height: 100%;
  animation: gridMove 20s linear infinite;
}

@keyframes gridMove {
  0% {
    transform: translate(0, 0);
  }
  100% {
    transform: translate(50px, 50px);
  }
}

/* Navigation Scroll Effect */
#navbar.scrolled {
  background: rgba(10, 15, 26, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* Fade In Animations */
.fade-in-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in-up.visible {
  opacity: 1;
  transform: translateY(0);
}

.fade-in-left {
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.fade-in-right {
  opacity: 0;
  transform: translateX(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in-right.visible {
  opacity: 1;
  transform: translateX(0);
}

/* Button Hover Effects */
.btn-primary {
  position: relative;
  overflow: hidden;
  transition: var(--transition-smooth);
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
}

.btn-primary:hover::before {
  width: 300px;
  height: 300px;
}

.btn-secondary {
  position: relative;
  transition: var(--transition-smooth);
}

/* Card Hover Effects */
.service-card {
  position: relative;
  overflow: hidden;
  transition: var(--transition-smooth);
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(26, 115, 232, 0.1), transparent);
  transition: left 0.5s ease;
}

.service-card:hover::before {
  left: 100%;
}

.service-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 40px rgba(26, 115, 232, 0.2);
}

/* Stat Card Animation */
.stat-card {
  transition: var(--transition-smooth);
}

.stat-card:hover {
  transform: scale(1.05);
  box-shadow: 0 15px 35px rgba(26, 115, 232, 0.15);
}

/* Compliance Card */
.compliance-card {
  transition: var(--transition-smooth);
}

.compliance-card:hover {
  transform: translateX(10px);
  box-shadow: -5px 0 20px rgba(26, 115, 232, 0.2);
}

/* Approach Phase */
.approach-phase {
  transition: var(--transition-smooth);
}

.approach-phase:hover {
  transform: translateX(10px);
  background: rgba(26, 115, 232, 0.05);
}

/* Form Input Focus */
input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--antares-blue) !important;
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

/* Loading State */
.loading {
  position: relative;
  pointer-events: none;
  opacity: 0.6;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 3px solid var(--antares-blue);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Parallax Effect */
.parallax {
  transform: translateY(var(--parallax-offset, 0));
  transition: transform 0.1s linear;
}

/* Mobile Menu Animation */
#mobile-menu {
  opacity: 0;
  transition: opacity 0.3s ease;
}

#mobile-menu.active {
  opacity: 1;
}

.mobile-nav-link {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

#mobile-menu.active .mobile-nav-link {
  opacity: 1;
  transform: translateY(0);
}

#mobile-menu.active .mobile-nav-link:nth-child(1) { transition-delay: 0.1s; }
#mobile-menu.active .mobile-nav-link:nth-child(2) { transition-delay: 0.15s; }
#mobile-menu.active .mobile-nav-link:nth-child(3) { transition-delay: 0.2s; }
#mobile-menu.active .mobile-nav-link:nth-child(4) { transition-delay: 0.25s; }
#mobile-menu.active .mobile-nav-link:nth-child(5) { transition-delay: 0.3s; }

/* Text Gradient Animation */
@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.text-gradient-animated {
  background: linear-gradient(270deg, #ffffff, #9ca3af, #ffffff);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradientShift 5s ease infinite;
}

/* Responsive Typography */
@media (max-width: 768px) {
  h1 {
    font-size: 2rem !important;
    line-height: 1.2 !important;
  }
  
  h2 {
    font-size: 1.75rem !important;
    line-height: 1.3 !important;
  }
  
  h3 {
    font-size: 1.25rem !important;
  }
  
  .service-card,
  .compliance-card,
  .approach-phase {
    padding: 1.25rem !important;
  }
  
  /* Stat cards mobile optimization */
  .stat-card {
    padding: 1rem !important;
  }
  
  .stat-card .text-5xl,
  .stat-card .text-4xl,
  .stat-card .text-3xl {
    font-size: 2rem !important;
  }
}

@media (max-width: 640px) {
  h1 {
    font-size: 1.75rem !important;
  }
  
  h2 {
    font-size: 1.5rem !important;
  }
  
  /* Even smaller stat cards for tiny screens */
  .stat-card {
    padding: 0.75rem !important;
  }
  
  .stat-card .text-5xl,
  .stat-card .text-4xl,
  .stat-card .text-3xl {
    font-size: 1.5rem !important;
    margin-bottom: 0.25rem !important;
  }
  
  .stat-card .text-sm,
  .stat-card .text-xs {
    font-size: 0.65rem !important;
    line-height: 1.2 !important;
  }
}

/* Mobile menu improvements */
@media (max-width: 1024px) {
  #mobile-menu {
    padding: 1rem;
  }
  
  .mobile-nav-link {
    font-size: 1.25rem;
    padding: 0.75rem;
  }
}

/* Ensure buttons don't overflow on small screens */
@media (max-width: 640px) {
  .btn-primary,
  .btn-secondary {
    font-size: 0.875rem !important;
    padding: 0.75rem 1.5rem !important;
  }
}

/* Portfolio cards mobile optimization */
@media (max-width: 768px) {
  .project-card img {
    height: 16rem !important;
  }
  
  .portfolio-filter-btn {
    font-size: 0.875rem;
    padding: 0.5rem 1rem !important;
  }
}

/* Improve touch targets for mobile */
@media (hover: none) and (pointer: coarse) {
  a, button {
    min-height: 44px;
    min-width: 44px;
  }
  
  .nav-link {
    padding: 0.5rem 0.75rem;
  }
}

/* Responsive spacing utilities */
.section-spacing {
  padding-top: 4rem;
  padding-bottom: 4rem;
}

@media (min-width: 640px) {
  .section-spacing {
    padding-top: 5rem;
    padding-bottom: 5rem;
  }
}

@media (min-width: 768px) {
  .section-spacing {
    padding-top: 6rem;
    padding-bottom: 6rem;
  }
}

@media (min-width: 1024px) {
  .section-spacing {
    padding-top: 8rem;
    padding-bottom: 8rem;
  }
}

/* Responsive Typography */
@media (max-width: 768px) {
  h1 {
    font-size: 2.5rem !important;
  }
  
  h2 {
    font-size: 2rem !important;
  }
  
  .service-card,
  .compliance-card,
  .approach-phase {
    padding: 1.5rem !important;
  }
}

/* Print Styles */
@media print {
  nav,
  footer,
  #contact {
    display: none !important;
  }
  
  section {
    page-break-inside: avoid;
  }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  .border-white\/10 {
    border-color: rgba(255, 255, 255, 0.3) !important;
  }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  html {
    scroll-behavior: auto;
  }
}

/* Selection Styling */
::selection {
  background-color: var(--antares-blue);
  color: white;
}

/* Focus Visible for Accessibility */
*:focus-visible {
  outline: 2px solid var(--antares-blue);
  outline-offset: 2px;
}

/* ===== FONT SIZE ADJUSTMENTS ===== */
/* Base font size increase for better readability */
body {
  font-size: 18px !important;
}

/* Paragraphs and general text - increase by 10% */
/* Exclude heading children to keep titles at original size */
p {
  font-size: 1.1em;
}

/* List items */
li {
  font-size: 1.1em;
}

/* Buttons */
button, .btn {
  font-size: 1.1em;
}

/* Form elements */
input, textarea, select {
  font-size: 1.05em;
}

/* Navigation links */
nav a:not(.text-4xl):not(.text-5xl):not(.text-6xl) {
  font-size: 1.1em;
}

/* ============================================
   ENHANCED BUTTON ANIMATIONS - Bold & Visible
   Professional with strong visual feedback
   ============================================ */

:root {
  --btn-timing: cubic-bezier(0.34, 1.56, 0.64, 1);
  --btn-duration: 280ms;
  --antares-blue: #1a73e8;
  --antares-glow: rgba(26, 115, 232, 0.6);
}

/* Base Button Reset */
button,
.btn,
a[role="button"] {
  position: relative;
  isolation: isolate;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
}

/* ========================================
   PRIMARY BUTTONS (CTA) - Bold Effects
   ======================================== */
.bg-antares-blue,
button.bg-antares-blue,
button[type="submit"],
a.bg-antares-blue {
  position: relative;
  overflow: hidden;
  transition: all var(--btn-duration) var(--btn-timing);
  box-shadow:
    0 4px 15px rgba(26, 115, 232, 0.4),
    0 2px 6px rgba(0, 0, 0, 0.15);
}

/* Shine sweep effect */
.bg-antares-blue::before,
button.bg-antares-blue::before,
button[type="submit"]::before {
  content: '';
  position: absolute;
  top: 0;
  left: -75%;
  width: 50%;
  height: 100%;
  background: linear-gradient(
    120deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  transform: skewX(-25deg);
  transition: left 500ms ease;
}

.bg-antares-blue:hover,
button.bg-antares-blue:hover,
button[type="submit"]:hover {
  transform: translateY(-4px) scale(1.03);
  box-shadow:
    0 8px 30px rgba(26, 115, 232, 0.5),
    0 4px 15px rgba(0, 0, 0, 0.2),
    0 0 40px rgba(26, 115, 232, 0.3);
  filter: brightness(1.1);
}

.bg-antares-blue:hover::before,
button.bg-antares-blue:hover::before,
button[type="submit"]:hover::before {
  left: 125%;
}

.bg-antares-blue:active,
button.bg-antares-blue:active,
button[type="submit"]:active {
  transform: translateY(-1px) scale(0.97);
  box-shadow:
    0 2px 10px rgba(26, 115, 232, 0.4),
    0 1px 5px rgba(0, 0, 0, 0.15);
  transition-duration: 100ms;
}

/* Glow ring on focus/hover */
.bg-antares-blue::after,
button.bg-antares-blue::after,
button[type="submit"]::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(26, 115, 232, 0.5), rgba(59, 130, 246, 0.5));
  z-index: -1;
  opacity: 0;
  filter: blur(8px);
  transition: opacity var(--btn-duration) ease;
}

.bg-antares-blue:hover::after,
button.bg-antares-blue:hover::after,
button[type="submit"]:hover::after {
  opacity: 1;
}

/* ========================================
   SECONDARY/OUTLINE BUTTONS - Glass Effect
   ======================================== */
.border-antares-blue\/30,
.border-white\/10,
button.border,
.btn-secondary {
  position: relative;
  overflow: hidden;
  transition: all var(--btn-duration) var(--btn-timing);
  backdrop-filter: blur(4px);
}

.border-antares-blue\/30::before,
.border-white\/10::before,
button.border::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(26, 115, 232, 0) 0%, rgba(26, 115, 232, 0.15) 100%);
  opacity: 0;
  transition: opacity var(--btn-duration) ease;
}

.border-antares-blue\/30:hover,
.border-white\/10:hover,
button.border:hover,
.btn-secondary:hover {
  border-color: rgba(26, 115, 232, 0.8) !important;
  transform: translateY(-3px) scale(1.02);
  box-shadow:
    0 8px 25px rgba(26, 115, 232, 0.25),
    inset 0 0 20px rgba(26, 115, 232, 0.1);
}

.border-antares-blue\/30:hover::before,
.border-white\/10:hover::before,
button.border:hover::before {
  opacity: 1;
}

.border-antares-blue\/30:active,
.border-white\/10:active,
button.border:active,
.btn-secondary:active {
  transform: translateY(0) scale(0.98);
  box-shadow:
    0 2px 10px rgba(26, 115, 232, 0.2),
    inset 0 0 30px rgba(26, 115, 232, 0.15);
}

/* ========================================
   GHOST/TEXT BUTTONS
   ======================================== */
.btn-ghost,
button:not([class*="bg-"]):not([type="submit"]):not(.border):not(.lang-btn):not(.portfolio-filter-btn):not(.quick-action-btn):not(#chatbot-toggle):not(#mobile-menu-btn) {
  transition: all var(--btn-duration) var(--btn-timing);
}

.btn-ghost:hover,
button:not([class*="bg-"]):not([type="submit"]):not(.border):not(.lang-btn):not(.portfolio-filter-btn):not(.quick-action-btn):not(#chatbot-toggle):not(#mobile-menu-btn):hover {
  background-color: rgba(26, 115, 232, 0.1);
  transform: translateY(-2px);
}

/* ========================================
   PORTFOLIO FILTER BUTTONS - Tab Style
   ======================================== */
.portfolio-filter-btn {
  position: relative;
  overflow: hidden;
  transition: all var(--btn-duration) var(--btn-timing);
}

/* Animated bottom bar */
.portfolio-filter-btn::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--antares-blue), #60a5fa, var(--antares-blue));
  background-size: 200% 100%;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 300ms var(--btn-timing);
}

/* Background glow */
.portfolio-filter-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at bottom, rgba(26, 115, 232, 0.2) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 300ms ease;
}

.portfolio-filter-btn:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.portfolio-filter-btn:hover::before {
  opacity: 1;
}

.portfolio-filter-btn:hover::after,
.portfolio-filter-btn.active::after {
  transform: scaleX(1);
  animation: shimmer 2s linear infinite;
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.portfolio-filter-btn.active {
  background: rgba(26, 115, 232, 0.15);
}

.portfolio-filter-btn:active {
  transform: translateY(-1px) scale(0.98);
}

/* ========================================
   LANGUAGE SELECTOR BUTTONS
   ======================================== */
.lang-btn {
  transition: all var(--btn-duration) var(--btn-timing);
  border: 1px solid transparent;
}

.lang-btn:hover {
  background-color: rgba(26, 115, 232, 0.2);
  border-color: rgba(26, 115, 232, 0.5);
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 4px 15px rgba(26, 115, 232, 0.3);
}

.lang-btn.active {
  background-color: rgba(26, 115, 232, 0.25);
  border-color: rgba(26, 115, 232, 0.6);
  box-shadow: 0 0 20px rgba(26, 115, 232, 0.3);
}

/* ========================================
   CHATBOT TOGGLE BUTTON - Pulse Effect
   ======================================== */
#chatbot-toggle {
  transition: all 300ms var(--btn-timing);
  box-shadow:
    0 6px 20px rgba(26, 115, 232, 0.45),
    0 3px 10px rgba(0, 0, 0, 0.15);
}

/* Outer pulse ring */
#chatbot-toggle::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid rgba(26, 115, 232, 0.4);
  animation: pulse-ring 2s ease-out infinite;
}

@keyframes pulse-ring {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  100% {
    transform: scale(1.4);
    opacity: 0;
  }
}

#chatbot-toggle:hover {
  transform: scale(1.15) rotate(5deg);
  box-shadow:
    0 10px 35px rgba(26, 115, 232, 0.55),
    0 5px 15px rgba(0, 0, 0, 0.2),
    0 0 50px rgba(26, 115, 232, 0.3);
}

#chatbot-toggle:hover::before {
  animation: none;
  opacity: 0;
}

#chatbot-toggle:active {
  transform: scale(0.95);
  box-shadow:
    0 3px 12px rgba(26, 115, 232, 0.4),
    0 2px 6px rgba(0, 0, 0, 0.1);
}

/* ========================================
   QUICK ACTION BUTTONS (Chatbot)
   ======================================== */
.quick-action-btn {
  transition: all var(--btn-duration) var(--btn-timing);
  border: 1px solid rgba(26, 115, 232, 0.3);
}

.quick-action-btn:hover {
  background-color: var(--antares-blue) !important;
  color: white !important;
  transform: translateY(-3px) scale(1.05);
  box-shadow:
    0 6px 20px rgba(26, 115, 232, 0.4),
    0 0 25px rgba(26, 115, 232, 0.2);
  border-color: transparent;
}

.quick-action-btn:active {
  transform: translateY(-1px) scale(0.98);
}

/* ========================================
   MOBILE MENU BUTTON
   ======================================== */
#mobile-menu-btn {
  transition: all var(--btn-duration) var(--btn-timing);
}

#mobile-menu-btn:hover {
  background-color: rgba(26, 115, 232, 0.15);
  transform: scale(1.1);
  box-shadow: 0 0 20px rgba(26, 115, 232, 0.2);
}

#mobile-menu-btn:active {
  transform: scale(0.95);
}

/* ========================================
   CLOSE BUTTONS (Modals)
   ======================================== */
button[onclick*="close"],
.btn-close {
  transition: all var(--btn-duration) var(--btn-timing);
  opacity: 0.6;
}

button[onclick*="close"]:hover,
.btn-close:hover {
  opacity: 1;
  transform: scale(1.2) rotate(90deg);
  color: #ef4444;
}

button[onclick*="close"]:active,
.btn-close:active {
  transform: scale(1) rotate(90deg);
}

/* ========================================
   LINK BUTTONS (tel:, mailto:)
   ======================================== */
a[href^="tel:"],
a[href^="mailto:"] {
  position: relative;
  transition: all var(--btn-duration) var(--btn-timing);
}

a[href^="tel:"]::after,
a[href^="mailto:"]::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--antares-blue), #60a5fa);
  transition: width 350ms var(--btn-timing);
  border-radius: 2px;
}

a[href^="tel:"]:hover,
a[href^="mailto:"]:hover {
  color: #60a5fa;
  text-shadow: 0 0 20px rgba(26, 115, 232, 0.5);
}

a[href^="tel:"]:hover::after,
a[href^="mailto:"]:hover::after {
  width: 100%;
}

/* ========================================
   ICON BUTTONS
   ======================================== */
button:has(svg:only-child),
.btn-icon {
  transition: all var(--btn-duration) var(--btn-timing);
}

button:has(svg:only-child):hover,
.btn-icon:hover {
  background-color: rgba(26, 115, 232, 0.15);
  transform: scale(1.15);
  box-shadow: 0 0 15px rgba(26, 115, 232, 0.2);
}

button:has(svg:only-child):active,
.btn-icon:active {
  transform: scale(0.95);
}

/* ========================================
   CONTINUOUS ICON ANIMATION IN BUTTONS
   Icons move up and down constantly
   ======================================== */

/* Keyframes for icon up-down bounce animation */
@keyframes iconUpDown {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}

/* Apply up-down animation to all icons inside buttons */
button svg,
.btn svg,
a[role="button"] svg,
.bg-antares-blue svg,
button[type="submit"] svg,
#chatbot-toggle svg,
.quick-action-btn svg,
a[href^="tel:"] svg,
a[href^="mailto:"] svg {
  animation: iconUpDown 1.5s ease-in-out infinite;
}

/* Pause animation on hover to avoid conflict with hover transforms */
button:hover svg,
.btn:hover svg,
a[role="button"]:hover svg {
  animation-play-state: paused;
}

/* ========================================
   NAVIGATION LINKS
   ======================================== */
nav a:not(.bg-antares-blue) {
  position: relative;
  transition: all var(--btn-duration) var(--btn-timing);
}

nav a:not(.bg-antares-blue)::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--antares-blue);
  transform: translateX(-50%);
  transition: width 300ms var(--btn-timing);
  border-radius: 2px;
}

nav a:not(.bg-antares-blue):hover {
  color: #60a5fa;
}

nav a:not(.bg-antares-blue):hover::after {
  width: 80%;
}

/* ========================================
   BUTTON STATES
   ======================================== */

/* Disabled */
button:disabled,
button.disabled,
.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
  transform: none !important;
  box-shadow: none !important;
  filter: grayscale(50%);
}

/* Loading */
button.loading,
.btn.loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}

button.loading::after,
.btn.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: btn-spin 700ms linear infinite;
}

@keyframes btn-spin {
  to { transform: rotate(360deg); }
}

/* Focus States (Accessibility) */
button:focus-visible,
.btn:focus-visible,
a[role="button"]:focus-visible {
  outline: 3px solid rgba(26, 115, 232, 0.8);
  outline-offset: 3px;
  box-shadow: 0 0 25px rgba(26, 115, 232, 0.4);
}

/* ========================================
   REDUCED MOTION
   ======================================== */
@media (prefers-reduced-motion: reduce) {
  button,
  .btn,
  a[role="button"],
  .portfolio-filter-btn,
  .quick-action-btn,
  .lang-btn,
  #chatbot-toggle,
  #mobile-menu-btn,
  nav a {
    transition-duration: 0ms !important;
    animation: none !important;
  }

  .bg-antares-blue::before,
  button.bg-antares-blue::before,
  button[type="submit"]::before,
  #chatbot-toggle::before {
    display: none;
  }
}

/* ============================================
   PROJECTS CAROUSEL - Infinite Scroll Animation
   Fully Responsive Design
   ============================================ */

.projects-carousel-container {
  width: 100%;
  overflow: hidden;
  position: relative;
}

.projects-carousel {
  display: flex;
  gap: 1rem;
  width: max-content;
  padding: 1rem 0;
}

/* Desktop - Large screens */
/* 25 images * (288px width + 16px gap) = 7600px for seamless loop */
@keyframes scrollDesktop {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(calc(-304px * 25));
  }
}

.animate-scroll {
  animation: scrollDesktop 60s linear infinite;
}

/* Pause animation on hover - only on devices with hover capability */
@media (hover: hover) {
  .projects-carousel-container:hover .animate-scroll {
    animation-play-state: paused;
  }
}

/* Carousel items - Base styles */
.carousel-item {
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
  flex-shrink: 0;
  border-radius: 12px;
  overflow: hidden;
}

.carousel-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.carousel-item:hover {
  box-shadow: 0 12px 35px rgba(26, 115, 232, 0.4);
  transform: scale(1.03);
  z-index: 10;
}

.carousel-item:hover img {
  transform: scale(1.1);
}

/* Gradient overlays responsive */
.projects-carousel-container .absolute {
  pointer-events: none;
}

/* ========== RESPONSIVE BREAKPOINTS ========== */

/* Extra Large screens (1440px+) */
@media (min-width: 1440px) {
  .carousel-item {
    width: 320px !important;
    height: 213px !important;
  }

  .projects-carousel {
    gap: 1.5rem;
  }
}

/* Large screens (1024px - 1439px) */
@media (min-width: 1024px) and (max-width: 1439px) {
  .carousel-item {
    width: 288px !important;
    height: 192px !important;
  }

  .projects-carousel {
    gap: 1.25rem;
  }
}

/* Medium screens / Tablets (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
  .carousel-item {
    width: 240px !important;
    height: 160px !important;
  }

  .projects-carousel {
    gap: 1rem;
  }

  @keyframes scrollDesktop {
    0% {
      transform: translateX(0);
    }
    100% {
      transform: translateX(calc(-256px * 25));
    }
  }

  .animate-scroll {
    animation: scrollDesktop 50s linear infinite;
  }
}

/* Small tablets / Large phones (640px - 767px) */
@media (min-width: 640px) and (max-width: 767px) {
  .carousel-item {
    width: 200px !important;
    height: 133px !important;
  }

  .projects-carousel {
    gap: 0.75rem;
  }

  @keyframes scrollDesktop {
    0% {
      transform: translateX(0);
    }
    100% {
      transform: translateX(calc(-212px * 25));
    }
  }

  .animate-scroll {
    animation: scrollDesktop 45s linear infinite;
  }

  /* Smaller gradient overlays on tablet */
  .projects-carousel-container .w-32 {
    width: 4rem !important;
  }
}

/* Mobile phones (480px - 639px) */
@media (min-width: 480px) and (max-width: 639px) {
  .carousel-item {
    width: 180px !important;
    height: 120px !important;
    border-radius: 8px;
  }

  .projects-carousel {
    gap: 0.625rem;
    padding: 0.5rem 0;
  }

  @keyframes scrollDesktop {
    0% {
      transform: translateX(0);
    }
    100% {
      transform: translateX(calc(-190px * 25));
    }
  }

  .animate-scroll {
    animation: scrollDesktop 40s linear infinite;
  }

  /* Smaller gradient overlays on mobile */
  .projects-carousel-container .w-32 {
    width: 2rem !important;
  }
}

/* Small mobile phones (< 480px) */
@media (max-width: 479px) {
  .carousel-item {
    width: 150px !important;
    height: 100px !important;
    border-radius: 6px;
  }

  .projects-carousel {
    gap: 0.5rem;
    padding: 0.5rem 0;
  }

  @keyframes scrollDesktop {
    0% {
      transform: translateX(0);
    }
    100% {
      transform: translateX(calc(-158px * 25));
    }
  }

  .animate-scroll {
    animation: scrollDesktop 35s linear infinite;
  }

  /* Minimal gradient overlays on small mobile */
  .projects-carousel-container .w-32 {
    width: 1.5rem !important;
  }

  /* Disable hover effects on small touch devices */
  .carousel-item:hover {
    transform: none;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
  }

  .carousel-item:hover img {
    transform: none;
  }
}

/* Extra small screens (< 360px) */
@media (max-width: 359px) {
  .carousel-item {
    width: 120px !important;
    height: 80px !important;
  }

  @keyframes scrollDesktop {
    0% {
      transform: translateX(0);
    }
    100% {
      transform: translateX(calc(-128px * 25));
    }
  }

  .animate-scroll {
    animation: scrollDesktop 30s linear infinite;
  }
}

/* Reduced motion support for carousel */
@media (prefers-reduced-motion: reduce) {
  .animate-scroll {
    animation: none !important;
  }

  .carousel-item,
  .carousel-item img {
    transition: none !important;
  }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
  .carousel-item:hover {
    transform: none;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
  }

  .carousel-item:active {
    transform: scale(0.98);
  }
}

/* ============================================
   MOBILE RESPONSIVE FIXES
   ============================================ */

/* Prevenir overflow horizontal en todas las páginas */
.container {
  max-width: 100%;
  overflow-x: hidden;
}

/* Contact page mobile fixes */
@media (max-width: 640px) {
  /* Forms inputs más pequeños */
  input, textarea, select {
    font-size: 16px !important; /* Previene zoom en iOS */
  }

  /* Grid de contacto en columna */
  .grid.lg\\:grid-cols-2 {
    grid-template-columns: 1fr !important;
  }

  /* Padding reducido en móvil */
  section {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  /* Cards con padding reducido */
  .bg-antares-gray.rounded-2xl {
    padding: 16px !important;
  }

  /* Video responsive */
  video {
    max-width: 100%;
    height: auto;
  }

  /* Títulos más pequeños */
  h1 {
    font-size: 1.75rem !important;
    line-height: 1.2 !important;
  }

  h2 {
    font-size: 1.25rem !important;
  }

  /* Botones de contacto directo */
  .flex.items-start.p-4 {
    padding: 12px !important;
  }

  .flex.items-start.p-4 .w-12 {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
  }
}

/* Video Sound Button */
.video-container {
  position: relative;
}

.video-sound-btn {
  position: absolute;
  bottom: 16px;
  right: 16px;
  width: 48px;
  height: 48px;
  background: rgba(0, 0, 0, 0.7);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  transition: all 0.3s ease;
  z-index: 10;
}

.video-sound-btn:hover {
  background: rgba(26, 115, 232, 0.9);
  border-color: #1a73e8;
  transform: scale(1.1);
}

.video-sound-btn .hidden {
  display: none;
}

/* Tablets */
@media (max-width: 768px) {
  /* Asegurar que nada se desborde */
  * {
    max-width: 100vw;
  }

  /* Videos y imágenes */
  img, video, iframe {
    max-width: 100% !important;
  }

  .video-sound-btn {
    width: 40px;
    height: 40px;
    font-size: 16px;
    bottom: 12px;
    right: 12px;
  }
}
