/* ===== VARIABLES CSS ===== */
:root {
  /* Colores principales - Azul a Aguamarina */
  --primary-color: #0066cc;
  --primary-light: #4da6ff;
  --primary-dark: #004499;
  --secondary-color: #00d4aa;
  --secondary-light: #40e0d0;
  --secondary-dark: #00a085;
  --accent-color: #0099dd;
  
  /* Gradientes */
  --gradient-primary: linear-gradient(135deg, #0066cc 0%, #00d4aa 100%);
  --gradient-secondary: linear-gradient(135deg, #00d4aa 0%, #40e0d0 100%);
  --gradient-hero: linear-gradient(135deg, #001122 0%, #004499 50%, #0066cc 100%);
  --gradient-glass: rgba(255, 255, 255, 0.1);
  
  /* Colores neutros */
  --white: #ffffff;
  --light-gray: #f8f9fa;
  --gray: #6c757d;
  --dark-gray: #343a40;
  --black: #000000;
  
  /* Tipografía */
  --font-family: 'Raleway', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-size-base: 1rem;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  
  /* Espaciado */
  --section-padding: 100px 0;
  --container-padding: 0 15px;
  
  /* Sombras */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.2);
  --shadow-glass: 0 8px 32px rgba(0, 102, 204, 0.3);
  
  /* Bordes */
  --border-radius-sm: 8px;
  --border-radius-md: 12px;
  --border-radius-lg: 20px;
  --border-radius-xl: 30px;
  
  /* Transiciones */
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;
}

/* ===== RESET Y BASE ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  max-width: 100%;
}

body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  line-height: 1.6;
  color: var(--dark-gray);
  background-color: var(--white);
  overflow-x: hidden;
  max-width: 100vw;
}

/* ===== UTILIDADES ===== */
.text-gradient {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: inline-block;
}

.text-white-75 {
  color: rgba(255, 255, 255, 0.75);
}

.smooth-scroll {
  scroll-behavior: smooth;
}

/* ===== LOADING SCREEN ===== */
#loading-screen {
  background: var(--gradient-hero);
  z-index: 9999;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

#loading-screen.fade-out {
  opacity: 0;
  visibility: hidden;
}

.spinner-border {
  width: 3rem;
  height: 3rem;
  border-width: 0.3em;
}

/* ===== NAVEGACIÓN ===== */
.glass-nav {
  background: rgba(0, 20, 40, 0.9);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  transition: all var(--transition-normal);
  padding: 0.8rem 0;
}

.glass-nav.scrolled {
  background: rgba(0, 20, 40, 0.95);
  padding: 0.4rem 0;
}

.navbar-brand {
  font-size: 1.5rem;
  font-weight: var(--font-weight-bold);
}

.navbar-nav .nav-link {
  color: rgba(255, 255, 255, 0.9) !important;
  font-weight: var(--font-weight-medium);
  padding: 0.5rem 1rem !important;
  border-radius: var(--border-radius-sm);
  transition: all var(--transition-fast);
  position: relative;
}

.navbar-nav .nav-link.active {
  color: var(--white) !important;
  background: rgba(255, 255, 255, 0.15);
}

.navbar-nav .nav-link:hover {
  color: var(--white) !important;
  background: rgba(255, 255, 255, 0.1);
}

.navbar-nav .nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--gradient-primary);
  transition: all var(--transition-fast);
  transform: translateX(-50%);
}

.navbar-nav .nav-link.active::after {
  width: 80%;
}

.navbar-nav .nav-link:hover::after {
  width: 80%;
}

/* ===== HERO SECTION ===== */
.hero-section {
  min-height: 100vh;
  position: relative;
  overflow: hidden;
  opacity: 1;
}

.hero-section h1,
.hero-section .lead,
.hero-section .btn {
  opacity: 1;
  transform: translateY(0);
}

.hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--gradient-hero);
  z-index: -2;
}

.hero-bg::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(circle at 25% 25%, rgba(0, 212, 170, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 75% 75%, rgba(64, 224, 208, 0.1) 0%, transparent 50%);
  z-index: -1;
}

.hero-tech-grid {
  position: relative;
  height: 400px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 2rem;
  align-items: center;
  justify-items: center;
  padding: 2rem;
}

.tech-item {
  font-size: 3rem;
  opacity: 0.8;
  transition: opacity 0.3s ease;
}

.tech-item:hover {
  opacity: 1;
  transform: scale(1.1);
}

/* ===== HERO IMAGE ===== */
.hero-image-container {
  height: 400px;
  width: 100%;
}

.hero-image {
  max-width: 100%;
  max-height: 100%;
  height: auto;
  width: auto;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-lg);
  object-fit: cover;
}

.scroll-indicator {
  opacity: 0.7;
  transition: opacity 0.3s ease;
}

.scroll-indicator:hover {
  opacity: 1;
}

.scroll-arrow {
  width: 30px;
  height: 30px;
  border-right: 2px solid var(--white);
  border-bottom: 2px solid var(--white);
  transform: rotate(45deg);
}

/* ===== BOTONES ===== */
.btn {
  border-radius: var(--border-radius-md);
  font-weight: var(--font-weight-semibold);
  text-transform: none;
  transition: all var(--transition-normal);
  border: none;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: var(--gradient-primary);
  border: none;
  color: var(--white);
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  background: var(--gradient-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  filter: brightness(1.1);
}

.btn-outline-primary {
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
  background: transparent;
}

.btn-outline-primary:hover {
  background: var(--primary-color);
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-outline-light {
  border: 2px solid rgba(255, 255, 255, 0.5);
  color: var(--white);
  background: transparent;
}

.btn-outline-light:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--white);
  color: var(--white);
  transform: translateY(-2px);
}

/* ===== ESTADÍSTICAS ===== */
.stat-card {
  background: var(--white);
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
  border: 1px solid rgba(0, 102, 204, 0.1);
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
}

.stat-card h3 {
  font-size: 2.5rem;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ===== FEATURES ===== */
.feature-item {
  transition: all var(--transition-normal);
  padding: 1rem;
  border-radius: var(--border-radius-md);
}

.feature-item:hover {
  background: rgba(0, 102, 204, 0.05);
  transform: translateX(10px);
}

.feature-icon {
  width: 60px;
  height: 60px;
  min-width: 60px;
  min-height: 60px;
  background: var(--gradient-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 1.5rem;
  box-shadow: var(--shadow-md);
  flex-shrink: 0;
}

/* ===== TARJETAS DE SERVICIOS ===== */
.service-card {
  background: var(--white);
  border-radius: var(--border-radius-lg);
  padding: 2rem 1.5rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0, 102, 204, 0.1);
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--gradient-primary);
  transform: scaleX(0);
  transition: all var(--transition-normal);
}

.service-card:hover::before {
  transform: scaleX(1);
}

.service-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
}

.service-icon {
  width: 70px;
  height: 70px;
  background: var(--gradient-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 1.8rem;
  margin-bottom: 1.2rem;
  box-shadow: var(--shadow-md);
}

.service-card h4 {
  color: var(--dark-gray);
  margin-bottom: 1rem;
}

.service-card ul li {
  padding: 0.25rem 0;
  color: var(--gray);
}

.service-card ul li i {
  color: var(--primary-color);
}

/* ===== TARJETAS DE SOLUCIONES ===== */
.solution-card {
  background: var(--white);
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-normal);
  border: 1px solid rgba(0, 212, 170, 0.2);
}

.solution-card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-lg);
}

.solution-header {
  background: var(--gradient-secondary);
  padding: 1.8rem;
  color: var(--white);
  text-align: center;
  position: relative;
}

.solution-header::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 20px;
  background: var(--white);
  border-radius: 20px 20px 0 0;
}

.solution-icon {
  width: 70px;
  height: 70px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  margin: 0 auto 1rem;
  backdrop-filter: blur(10px);
}

.solution-content {
  padding: 1.8rem;
  padding-top: 1rem;
}

.feature-badge {
  background: rgba(0, 102, 204, 0.1);
  color: var(--primary-color);
  padding: 0.5rem 0.75rem;
  border-radius: var(--border-radius-sm);
  font-size: 0.875rem;
  font-weight: var(--font-weight-medium);
  text-align: center;
  border: 1px solid rgba(0, 102, 204, 0.2);
  transition: all var(--transition-normal);
}

.feature-badge:hover {
  background: rgba(0, 102, 204, 0.15);
  transform: translateY(-2px);
}

/* ===== CTA BOX ===== */
.cta-box {
  background: var(--white);
  border-radius: var(--border-radius-xl);
  padding: 3rem 2rem;
  box-shadow: var(--shadow-lg);
  border: 3px solid;
  border-image: var(--gradient-primary) 1;
  position: relative;
  overflow: hidden;
}

.cta-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(45deg, rgba(0, 102, 204, 0.05), rgba(0, 212, 170, 0.05));
  z-index: -1;
}

/* ===== SECCIÓN DE CONTACTO ===== */
.contact-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--gradient-hero);
  z-index: -2;
}

.contact-bg::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(circle at 20% 80%, rgba(0, 212, 170, 0.3) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(64, 224, 208, 0.3) 0%, transparent 50%);
  z-index: -1;
}

.contact-form-container {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  border-radius: var(--border-radius-lg);
  padding: 2.5rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: var(--shadow-glass);
}

.contact-form-container .form-control,
.contact-form-container .form-select {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--border-radius-md);
  padding: 0.75rem 1rem;
  font-weight: var(--font-weight-medium);
  transition: all var(--transition-normal);
}

.contact-form-container .form-control:focus,
.contact-form-container .form-select:focus {
  background: var(--white);
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem rgba(0, 102, 204, 0.25);
}

.contact-form-container .form-label {
  color: var(--white);
  font-weight: var(--font-weight-semibold);
  margin-bottom: 0.5rem;
}

.contact-info-item {
  text-align: center;
  padding: 1.5rem;
}

.contact-icon {
  width: 60px;
  height: 60px;
  background: var(--gradient-secondary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  color: var(--white);
  font-size: 1.5rem;
  box-shadow: var(--shadow-md);
}

/* ===== FOOTER ===== */
footer {
  background: linear-gradient(135deg, #000000 0%, #001122 100%);
}

.social-links a {
  display: inline-flex;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-normal);
  font-size: 1.2rem;
}

.social-links a:hover {
  background: var(--primary-color);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

/* ===== BACK TO TOP ===== */
#backToTop {
  width: 50px;
  height: 50px;
  background: var(--gradient-primary);
  border: none;
  box-shadow: var(--shadow-lg);
  transition: all var(--transition-normal);
}

#backToTop:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

/* ===== ANIMACIONES AOS PERSONALIZADAS ===== */
[data-aos="fade-up"] {
  transform: translate3d(0, 40px, 0);
  opacity: 0;
}

[data-aos="fade-up"].aos-animate {
  transform: translate3d(0, 0, 0);
  opacity: 1;
}

[data-aos="fade-right"] {
  transform: translate3d(-40px, 0, 0);
  opacity: 0;
}

[data-aos="fade-right"].aos-animate {
  transform: translate3d(0, 0, 0);
  opacity: 1;
}

[data-aos="fade-left"] {
  transform: translate3d(40px, 0, 0);
  opacity: 0;
}

[data-aos="fade-left"].aos-animate {
  transform: translate3d(0, 0, 0);
  opacity: 1;
}

/* ===== RESPONSIVE ===== */

/* Laptops HD (1366x768) y resoluciones similares */
@media (max-width: 1400px) and (max-height: 900px) {
  .hero-section {
    min-height: 100vh;
    padding: 1rem 0;
  }
  
  .hero-section h1 {
    font-size: 2.8rem;
    line-height: 1.2;
    margin-bottom: 1.5rem;
  }
  
  .hero-section .lead {
    font-size: 1.1rem;
    margin-bottom: 2rem;
  }
  
  .container {
    padding: 0 20px;
  }
  
  .py-5 {
    padding-top: 3rem !important;
    padding-bottom: 3rem !important;
  }
  
  .hero-tech-grid {
    height: 300px;
    gap: 1.5rem;
  }
  
  .tech-item {
    font-size: 2.5rem;
  }
  
  .glass-nav {
    padding: 0.7rem 0;
  }
  
  .glass-nav.scrolled {
    padding: 0.4rem 0;
  }
  
  .display-5 {
    font-size: 2.2rem;
  }
  
  .cta-box {
    padding: 2.5rem 1.8rem;
  }
  
  .contact-form-container {
    padding: 2rem;
  }
  
  .navbar-brand {
    font-size: 1.4rem;
  }
  
  .btn-lg {
    padding: 0.8rem 2rem;
    font-size: 1.1rem;
  }
  
  .hero-image-container {
    height: 300px;
  }
  
  .hero-image {
    max-width: 90%;
  }
}

/* Media query para tablets y pantallas medianas */
@media (max-width: 991px) {
  .hero-image-container {
    display: none !important;
  }
  
  .hero-mobile-cta {
    display: flex !important;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    margin-top: 1.5rem;
    opacity: 0.7;
  }
  
  .scroll-hint {
    color: #ffffff;
    font-size: 0.9rem;
    text-align: center;
    font-weight: 300;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
  }
  
  .scroll-arrow-mobile {
    color: #00d4aa;
    font-size: 1.2rem;
    animation: bounceDown 2s infinite;
  }
}

@media (max-width: 768px) {
  .hero-section {
    text-align: center;
    padding-top: 80px; /* Compensar navbar fixed */
  }
  
  .hero-section h1 {
    font-size: 2.5rem;
  }
  
  .hero-illustration {
    height: 300px;
    margin-top: 2rem;
  }
  
  .floating-icon {
    font-size: 1.5rem;
  }
  
  .service-card {
    padding: 2rem 1.5rem;
  }
  
  .solution-header,
  .solution-content {
    padding: 1.5rem;
  }
  
  .contact-form-container {
    padding: 2rem 1.5rem;
  }
  
  .cta-box {
    padding: 2rem 1.5rem;
  }
  
  .stat-card h3 {
    font-size: 2rem;
  }
  
  .hero-image-container {
    display: none !important;
  }
  
  .hero-mobile-cta {
    display: flex !important;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    margin-top: 2rem;
    opacity: 0.7;
  }
  
  .scroll-hint {
    color: #ffffff;
    font-size: 0.9rem;
    text-align: center;
    font-weight: 300;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
  }
  
  .scroll-arrow-mobile {
    color: #00d4aa;
    font-size: 1.2rem;
    animation: bounceDown 2s infinite;
  }
}

@media (max-width: 576px) {
  .hero-section {
    padding-top: 90px; /* Más padding para móviles pequeños */
  }
  
  .hero-section h1 {
    font-size: 2rem;
  }
  
  .display-5 {
    font-size: 2rem;
  }
  
  .btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
  }
  
  .service-card {
    padding: 1.5rem 1rem;
  }
  
  .contact-form-container {
    padding: 1.5rem 1rem;
  }
  
  .floating-icon {
    font-size: 1.2rem;
  }
  
  .hero-image-container {
    display: none !important;
  }
  
  .hero-mobile-cta {
    display: flex !important;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    margin-top: 1.5rem;
    opacity: 0.7;
  }
}

@media (max-width: 425px) {
  /* Feature badges en 2x2 para pantallas pequeñas */
  .solution-content .row > [class*="col-"] {
    width: 50% !important;
    flex: 0 0 50% !important;
    max-width: 50% !important;
  }
  
  .feature-badge {
    font-size: 0.65rem;
    padding: 0.4rem 0.3rem;
    line-height: 1.3;
  }
  
  .feature-badge i {
    font-size: 0.9rem;
    margin-right: 0 !important;
    display: block;
    margin-bottom: 0.3rem;
  }
  
  .feature-badge br {
    display: none;
  }
}

/* ===== SCROLL SUAVE Y EFECTOS PARALLAX ===== */
@media (prefers-reduced-motion: no-preference) {
  .parallax-element {
    transform: translateZ(0);
    will-change: transform;
  }
}

/* ===== MEJORAS DE ACCESIBILIDAD ===== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ===== FOCUS STYLES ===== */
.btn:focus,
.form-control:focus,
.form-select:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* ===== HOVER EFFECTS ADICIONALES ===== */
.nav-link,
.btn,
.service-card,
.solution-card {
  will-change: transform;
}

/* ===== ANIMACIÓN DE CARGA ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-up {
  animation: fadeInUp 0.6s ease-out;
}

/* ===== EFECTOS DE GLASSMORPHISM ===== */
.glass-effect {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: var(--shadow-glass);
}