/* ============================================
   SPATIAL UI - SISTEMA DE DISEÑO
   Apple Vision Pro Style / Glassmorphism 3.0
   JUAMPI IA Redesign 2026
   ============================================ */

/* ------------------- */
/* 1. CSS VARIABLES    */
/* ------------------- */

:root {
  /* Fondos Espaciales */
  --spatial-bg-primary: radial-gradient(ellipse at 20% 30%, #0a1628 0%, #050810 50%, #020408 100%);
  --spatial-bg-secondary: linear-gradient(180deg, #0d1a2d 0%, #081220 100%);
  --spatial-bg-tertiary: #060912;

  /* Colores Glow */
  --spatial-glow-cyan: rgba(63, 180, 255, 0.4);
  --spatial-glow-teal: rgba(139, 44, 255, 0.4);
  --spatial-glow-amber: rgba(251, 191, 36, 0.3);
  --spatial-glow-mint: rgba(63, 180, 255, 0.3);

  /* Glassmorphism */
  --glass-bg-light: rgba(255, 255, 255, 0.03);
  --glass-bg-medium: rgba(255, 255, 255, 0.05);
  --glass-bg-heavy: rgba(255, 255, 255, 0.08);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-border-hover: rgba(255, 255, 255, 0.15);
  --glass-blur-light: blur(20px) saturate(150%);
  --glass-blur-medium: blur(40px) saturate(180%);
  --glass-blur-heavy: blur(60px) saturate(200%);

  /* Profundidad Z */
  --z-background: -100;
  --z-far: -50;
  --z-mid: 0;
  --z-near: 50;
  --z-close: 100;
  --z-overlay: 200;
  --z-cursor: 1000;

  /* Sombras Espaciales */
  --shadow-float:
    0 10px 40px rgba(0, 0, 0, 0.4),
    0 2px 8px rgba(63, 180, 255, 0.1);

  --shadow-float-hover:
    0 20px 60px rgba(0, 0, 0, 0.5),
    0 5px 20px rgba(63, 180, 255, 0.2),
    0 0 40px rgba(63, 180, 255, 0.1);

  --shadow-depth-1: 0 4px 20px rgba(0, 0, 0, 0.3);
  --shadow-depth-2: 0 8px 40px rgba(0, 0, 0, 0.4);
  --shadow-depth-3: 0 16px 60px rgba(0, 0, 0, 0.5);
  --shadow-depth-4: 0 24px 80px rgba(0, 0, 0, 0.6);

  /* Colores Base - Ocean Blue */
  --color-primary: #3fb4ff;
  --color-secondary: #60a5fa;
  --color-accent: #10b981;
  --color-amber: #fbbf24;
  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-error: #ef4444;

  /* Texto */
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.8);
  --text-tertiary: rgba(255, 255, 255, 0.75);
  --text-muted: rgba(255, 255, 255, 0.5);

  /* Transiciones */
  --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-medium: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Bordes */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --radius-full: 9999px;
}

/* ------------------- */
/* 2. RESET SPATIAL    */
/* ------------------- */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--spatial-bg-primary);
  background-attachment: fixed;
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

/* Ocultar cursor default cuando usamos cursor de luz */
body.custom-cursor {
  cursor: none;
}

body.custom-cursor * {
  cursor: none;
}

/* ------------------- */
/* 3. GLASS PANELS     */
/* ------------------- */

.glass-panel {
  background: var(--glass-bg-light);
  backdrop-filter: var(--glass-blur-medium);
  -webkit-backdrop-filter: var(--glass-blur-medium);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  transition: var(--transition-medium);
}

.glass-panel:hover {
  background: var(--glass-bg-medium);
  border-color: var(--glass-border-hover);
  box-shadow: var(--shadow-float-hover);
}

.glass-panel-light {
  background: var(--glass-bg-light);
  backdrop-filter: var(--glass-blur-light);
  -webkit-backdrop-filter: var(--glass-blur-light);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
}

.glass-panel-heavy {
  background: var(--glass-bg-heavy);
  backdrop-filter: var(--glass-blur-heavy);
  -webkit-backdrop-filter: var(--glass-blur-heavy);
  border: 1px solid var(--glass-border-hover);
  border-radius: var(--radius-xl);
}

/* ------------------- */
/* 4. FLOATING CARDS   */
/* ------------------- */

.floating-card {
  background: linear-gradient(135deg, var(--glass-bg-medium) 0%, var(--glass-bg-light) 100%);
  backdrop-filter: var(--glass-blur-medium);
  -webkit-backdrop-filter: var(--glass-blur-medium);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  transition: var(--transition-bounce);
  transform-style: preserve-3d;
  perspective: 1000px;
  position: relative;
  overflow: hidden;
}

.floating-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
}

.floating-card:hover {
  transform: translateY(-8px) translateZ(20px);
  border-color: var(--glass-border-hover);
  box-shadow:
    var(--shadow-depth-3),
    0 0 60px rgba(63, 180, 255, 0.15);
}

.floating-card--glow-cyan:hover {
  box-shadow:
    var(--shadow-depth-3),
    0 0 60px var(--spatial-glow-cyan);
}

.floating-card--glow-purple:hover {
  box-shadow:
    var(--shadow-depth-3),
    0 0 60px var(--spatial-glow-teal);
}

.floating-card--glow-amber:hover {
  box-shadow:
    var(--shadow-depth-3),
    0 0 60px var(--spatial-glow-amber);
}

/* ------------------- */
/* 5. SPATIAL BUTTONS  */
/* ------------------- */

.spatial-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem 2rem;
  background: linear-gradient(135deg, var(--glass-bg-medium) 0%, var(--glass-bg-light) 100%);
  backdrop-filter: var(--glass-blur-light);
  -webkit-backdrop-filter: var(--glass-blur-light);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  transition: var(--transition-bounce);
  position: relative;
  overflow: hidden;
  transform-style: preserve-3d;
}

.spatial-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 0%, rgba(255, 255, 255, 0.1) 50%, transparent 100%);
  opacity: 0;
  transition: var(--transition-medium);
}

.spatial-btn:hover {
  transform: translateY(-3px) scale(1.02);
  border-color: var(--color-primary);
  box-shadow:
    0 10px 30px rgba(63, 180, 255, 0.2),
    0 0 20px rgba(63, 180, 255, 0.1);
}

.spatial-btn:hover::before {
  opacity: 1;
}

.spatial-btn:active {
  transform: translateY(-1px) scale(0.98);
}

.spatial-btn--primary {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
  border-color: transparent;
  color: #000;
}

.spatial-btn--primary:hover {
  box-shadow:
    0 10px 30px rgba(63, 180, 255, 0.4),
    0 0 40px rgba(63, 180, 255, 0.2);
}

.spatial-btn--glow {
  background: transparent;
  border-color: var(--color-primary);
  box-shadow:
    inset 0 0 20px rgba(63, 180, 255, 0.1),
    0 0 20px rgba(63, 180, 255, 0.1);
}

.spatial-btn--glow:hover {
  background: rgba(63, 180, 255, 0.1);
  box-shadow:
    inset 0 0 30px rgba(63, 180, 255, 0.2),
    0 0 40px rgba(63, 180, 255, 0.3);
}

/* ------------------- */
/* 6. SPATIAL INPUTS   */
/* ------------------- */

.spatial-input {
  width: 100%;
  padding: 1rem 1.5rem;
  background: var(--glass-bg-light);
  backdrop-filter: var(--glass-blur-light);
  -webkit-backdrop-filter: var(--glass-blur-light);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 1rem;
  transition: var(--transition-medium);
  outline: none;
}

.spatial-input::placeholder {
  color: var(--text-tertiary);
}

.spatial-input:focus {
  border-color: var(--color-primary);
  box-shadow:
    0 0 0 3px rgba(63, 180, 255, 0.1),
    0 0 20px rgba(63, 180, 255, 0.2);
  background: var(--glass-bg-medium);
}

/* ------------------- */
/* 7. SPATIAL NAVBAR   */
/* ------------------- */

.spatial-navbar {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: var(--z-close);
  width: calc(100% - 2rem);
  max-width: 1400px;
  padding: 0.75rem 1.5rem;
  background: var(--glass-bg-light);
  backdrop-filter: var(--glass-blur-heavy);
  -webkit-backdrop-filter: var(--glass-blur-heavy);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: var(--transition-medium);
}

.spatial-navbar:hover {
  background: var(--glass-bg-medium);
  border-color: var(--glass-border-hover);
}

.spatial-navbar--scrolled {
  top: 0.5rem;
  padding: 0.5rem 1.25rem;
  background: rgba(6, 9, 18, 0.9);
}

/* ------------------- */
/* 8. DEPTH LAYERS     */
/* ------------------- */

.depth-bg {
  position: fixed;
  inset: 0;
  z-index: var(--z-background);
  pointer-events: none;
}

.depth-far {
  position: relative;
  z-index: var(--z-far);
}

.depth-mid {
  position: relative;
  z-index: var(--z-mid);
}

.depth-near {
  position: relative;
  z-index: var(--z-near);
}

.depth-close {
  position: relative;
  z-index: var(--z-close);
}

/* ------------------- */
/* 9. GLOW EFFECTS     */
/* ------------------- */

.glow-cyan {
  box-shadow: 0 0 30px var(--spatial-glow-cyan);
}

.glow-purple {
  box-shadow: 0 0 30px var(--spatial-glow-teal);
}

.glow-amber {
  box-shadow: 0 0 30px var(--spatial-glow-amber);
}

.glow-text-cyan {
  text-shadow: 0 0 20px var(--spatial-glow-cyan);
}

.glow-text-purple {
  text-shadow: 0 0 20px var(--spatial-glow-teal);
}

/* ------------------- */
/* 10. ANIMATIONS      */
/* ------------------- */

@keyframes float {

  0%,
  100% {
    transform: translateY(0px);
  }

  50% {
    transform: translateY(-10px);
  }
}

@keyframes float-slow {

  0%,
  100% {
    transform: translateY(0px) rotate(0deg);
  }

  50% {
    transform: translateY(-15px) rotate(2deg);
  }
}

@keyframes pulse-glow {

  0%,
  100% {
    box-shadow: 0 0 20px rgba(63, 180, 255, 0.3);
  }

  50% {
    box-shadow: 0 0 40px rgba(63, 180, 255, 0.5);
  }
}

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

  100% {
    background-position: 200% 0;
  }
}

@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scale-in {
  from {
    opacity: 0;
    transform: scale(0.9);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes slide-in-left {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slide-in-right {
  from {
    opacity: 0;
    transform: translateX(50px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Utility Classes for Animations */
.animate-float {
  animation: float 6s ease-in-out infinite;
}

.animate-float-slow {
  animation: float-slow 8s ease-in-out infinite;
}

.animate-pulse-glow {
  animation: pulse-glow 3s ease-in-out infinite;
}

.animate-shimmer {
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  background-size: 200% 100%;
  animation: shimmer 2s linear infinite;
}

/* Staggered Entrance */
.entrance-fade-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Delay utilities */
.delay-100 {
  transition-delay: 0.1s;
}

.delay-200 {
  transition-delay: 0.2s;
}

.delay-300 {
  transition-delay: 0.3s;
}

.delay-400 {
  transition-delay: 0.4s;
}

.delay-500 {
  transition-delay: 0.5s;
}

.delay-600 {
  transition-delay: 0.6s;
}

/* ------------------- */
/* 11. SPATIAL GRID    */
/* ------------------- */

.spatial-container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
}

.spatial-grid {
  display: grid;
  gap: 2rem;
}

.spatial-grid--2 {
  grid-template-columns: repeat(2, 1fr);
}

.spatial-grid--3 {
  grid-template-columns: repeat(3, 1fr);
}

.spatial-grid--4 {
  grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 1024px) {
  .spatial-grid--4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {

  .spatial-grid--2,
  .spatial-grid--3,
  .spatial-grid--4 {
    grid-template-columns: 1fr;
  }

  .spatial-container {
    padding: 0 1rem;
  }

  .spatial-section {
    padding: 3rem 0;
  }

  .spatial-section--hero {
    min-height: auto;
    padding-top: 20px;
  }
}

@media (max-width: 480px) {
  .spatial-container {
    padding: 0 0.75rem;
  }

  .spatial-section {
    padding: 2rem 0;
  }

  .spatial-title {
    font-size: 1.5rem;
  }

  .spatial-subtitle {
    font-size: 0.95rem;
  }
}

/* ------------------- */
/* 12. SECTIONS        */
/* ------------------- */

.spatial-section {
  position: relative;
  padding: 6rem 0;
  overflow: hidden;
}

.spatial-section--hero {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 40px;
  padding-bottom: 2.5rem;
}

.spatial-section--hero .spatial-container {
  max-width: 95vw;
  padding: 0 1rem;
}

.hero-image-wrapper {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  aspect-ratio: 21/9;
  position: relative;
  z-index: 10;
}

@media (max-width: 768px) {
  .hero-image-wrapper {
    aspect-ratio: 16/9;
  }
}

@media (max-width: 480px) {
  .hero-image-wrapper {
    aspect-ratio: 4/3;
  }
}

.hero-image-card {
  padding: 0 !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: var(--radius-lg);
  position: relative;
  overflow: visible !important;
  box-shadow: var(--shadow-depth-2);
}

.hero-image-card::before {
  content: '';
  position: absolute;
  inset: -25px;
  z-index: -1;
  border-radius: inherit;
  background: linear-gradient(135deg,
      rgba(63, 180, 255, 0.5) 0%,
      rgba(139, 44, 255, 0.5) 100%);
  filter: blur(50px);
  opacity: 0.7;
  animation: glow-pulse-dual 4s ease-in-out infinite alternate;
}

@keyframes glow-pulse-dual {
  0% {
    opacity: 0.5;
    transform: scale(0.95);
  }

  100% {
    opacity: 0.8;
    transform: scale(1.05);
  }
}

.hero-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-lg);
  display: block;
}

.hero-image-card:hover {
  transform: translateY(-5px);
  box-shadow:
    var(--shadow-depth-3),
    0 0 30px rgba(63, 180, 255, 0.2);
}

/* ------------------- */
/* 13. TEXT STYLES     */
/* ------------------- */

.spatial-title {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #ffffff 0%, #a5b4fc 50%, #818cf8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.spatial-title--glow {
  text-shadow: 0 0 40px rgba(129, 140, 248, 0.3);
}

.spatial-subtitle {
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 600px;
}

/* ------------------- */
/* 14. BADGES & TAGS   */
/* ------------------- */

.spatial-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 2px 8px;
  background: linear-gradient(135deg, #10b981, #059669);
  border: none;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-left: 6px;
  vertical-align: middle;
  transition: var(--transition-fast);
  animation: badgePulseGreen 2s ease-in-out infinite;
}

.spatial-badge:hover {
  transform: scale(1.05);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.6);
}

.spatial-badge--blue {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  animation: badgePulseBlue 2s ease-in-out infinite;
}

.spatial-badge--blue:hover {
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.6);
}

@keyframes badgePulseGreen {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
  }

  50% {
    box-shadow: 0 0 8px 2px rgba(16, 185, 129, 0.3);
  }
}

@keyframes badgePulseBlue {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4);
  }

  50% {
    box-shadow: 0 0 8px 2px rgba(59, 130, 246, 0.3);
  }
}

.spatial-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.875rem;
  background: transparent;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-tertiary);
  transition: var(--transition-fast);
}

.spatial-tag:hover,
.spatial-tag.active {
  background: rgba(63, 180, 255, 0.1);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

/* ------------------- */
/* 15. UTILITIES       */
/* ------------------- */

.text-center {
  text-align: center;
}

.text-left {
  text-align: left;
}

.text-right {
  text-align: right;
}

.mx-auto {
  margin-left: auto;
  margin-right: auto;
}

.my-auto {
  margin-top: auto;
  margin-bottom: auto;
}

.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.gap-1 {
  gap: 0.5rem;
}

.gap-2 {
  gap: 1rem;
}

.gap-3 {
  gap: 1.5rem;
}

.gap-4 {
  gap: 2rem;
}

.relative {
  position: relative;
}

.absolute {
  position: absolute;
}

.fixed {
  position: fixed;
}

.hidden {
  display: none;
}

.block {
  display: block;
}

.inline-block {
  display: inline-block;
}

.w-full {
  width: 100%;
}

.h-full {
  height: 100%;
}

/* ------------------- */
/* 16. REDUCED MOTION  */
/* ------------------- */

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .animate-float,
  .animate-float-slow,
  .animate-pulse-glow,
  .animate-shimmer {
    animation: none;
  }
}

/* ------------------- */
/* 17. SCROLLBAR       */
/* ------------------- */

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

