/* Tierra de Mitos 3.0 - CSS Ultra-Moderno con Efectos 3D */

/* Reset y Variables CSS */
:root {
  --primary-green: #22c55e;
  --secondary-green: #16a34a;
  --accent-gold: #fbbf24;
  --earth-brown: #92400e;
  --text-dark: #1f2937;
  --text-light: #f8fafc;
  --bg-light: #ffffff;
  --bg-dark: #0f172a;
  --gradient-nature: linear-gradient(135deg, #22c55e, #16a34a, #fbbf24);
  --gradient-earth: linear-gradient(135deg, #92400e, #a16207, #d97706);
  --shadow-3d: 0 20px 40px rgba(0,0,0,0.1);
  --transition-smooth: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  line-height: 1.6;
  color: var(--text-dark);
  overflow-x: hidden;
  transition: var(--transition-smooth);
}

/* Modo Oscuro */
body.dark-mode {
  background: var(--bg-dark);
  color: var(--text-light);
}

/* Loading Screen 3D */
.loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--gradient-nature);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.loading-screen.hide {
  opacity: 0;
  transform: scale(0.8);
  pointer-events: none;
}

.loading-animation {
  text-align: center;
  animation: plantGrow 2s infinite ease-in-out;
}

.loading-plant {
  font-size: 4rem;
  margin-bottom: 1rem;
  transform-origin: bottom;
  animation: seedGrow 1.5s infinite alternate;
}

@keyframes plantGrow {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

@keyframes seedGrow {
  0% { transform: scaleY(0.5); }
  100% { transform: scaleY(1.2); }
}

/* Header Moderno */
header {
  position: fixed;
  top: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  z-index: 1000;
  transition: var(--transition-smooth);
}

body.dark-mode header {
  background: rgba(15, 23, 42, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

.logo img {
  height: 50px;
  transition: var(--transition-smooth);
}

.logo img:hover {
  transform: scale(1.05) rotate(5deg);
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 2rem;
  align-items: center;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-dark);
  font-weight: 500;
  position: relative;
  padding: 0.5rem 1rem;
  border-radius: 50px;
  transition: var(--transition-smooth);
}

body.dark-mode .nav-links a {
  color: var(--text-light);
}

.nav-links a:hover {
  background: var(--gradient-nature);
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow-3d);
}

/* Theme Toggle Button */
.theme-toggle {
  background: none;
  border: 2px solid var(--primary-green);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  cursor: pointer;
  font-size: 1.5rem;
  transition: var(--transition-smooth);
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle:hover {
  transform: rotate(180deg) scale(1.1);
  background: var(--primary-green);
  color: white;
}

/* Hero Section con Partículas 3D */
.hero-3d {
  height: 100vh;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--gradient-nature);
}

.hero-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.3);
  z-index: 2;
}

.hero-content {
  position: relative;
  z-index: 3;
  text-align: center;
  color: white;
  max-width: 800px;
  padding: 2rem;
}

.hero-title {
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 800;
  margin-bottom: 1rem;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
  animation: titleFloat 4s ease-in-out infinite;
}

@keyframes titleFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.hero-subtitle {
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  margin-bottom: 2rem;
  opacity: 0.9;
  animation: fadeInUp 1s ease-out 0.5s both;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 0.9;
    transform: translateY(0);
  }
}

.btn-hero {
  display: inline-block;
  background: var(--accent-gold);
  color: var(--text-dark);
  padding: 1rem 2rem;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1.1rem;
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
  animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 20px rgba(251, 191, 36, 0.5); }
  50% { box-shadow: 0 0 40px rgba(251, 191, 36, 0.8); }
}

.btn-hero:hover {
  transform: translateY(-5px) scale(1.05);
  box-shadow: 0 20px 40px rgba(251, 191, 36, 0.4);
}

/* Calculadora Revolucionaria */
.calculator-3d {
  background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0.05));
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 30px;
  padding: 3rem;
  margin: 2rem 0;
  box-shadow: var(--shadow-3d);
  transform-style: preserve-3d;
  transition: var(--transition-smooth);
}

.calculator-3d:hover {
  transform: rotateX(5deg) rotateY(5deg) translateZ(20px);
  box-shadow: 0 30px 60px rgba(0,0,0,0.2);
}

.form-group-3d {
  margin-bottom: 2rem;
  position: relative;
}

.form-group-3d label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--primary-green);
  font-size: 1.1rem;
}

.input-3d {
  width: 100%;
  padding: 1rem 1.5rem;
  border: 2px solid rgba(34, 197, 94, 0.3);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.9);
  font-size: 1rem;
  transition: var(--transition-smooth);
  backdrop-filter: blur(10px);
}

.input-3d:focus {
  outline: none;
  border-color: var(--primary-green);
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(34, 197, 94, 0.2);
}

body.dark-mode .input-3d {
  background: rgba(15, 23, 42, 0.8);
  color: var(--text-light);
  border-color: rgba(34, 197, 94, 0.5);
}

.btn-calculate {
  background: var(--gradient-nature);
  color: white;
  border: none;
  padding: 1.2rem 3rem;
  border-radius: 50px;
  font-size: 1.2rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

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

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

.btn-calculate:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 15px 30px rgba(34, 197, 94, 0.4);
}

/* Resultados con Animaciones */
.result-card {
  background: white;
  border-radius: 20px;
  padding: 2rem;
  margin: 1rem 0;
  box-shadow: var(--shadow-3d);
  border-left: 5px solid var(--primary-green);
  transform: translateX(-20px);
  opacity: 0;
  animation: slideInLeft 0.6s ease-out forwards;
}

body.dark-mode .result-card {
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(20px);
}

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

.result-card:nth-child(2) { animation-delay: 0.2s; }
.result-card:nth-child(3) { animation-delay: 0.4s; }
.result-card:nth-child(4) { animation-delay: 0.6s; }

/* Cards de Servicios 3D */
.service-card-3d {
  background: white;
  border-radius: 20px;
  padding: 2rem;
  text-align: center;
  transition: var(--transition-smooth);
  transform-style: preserve-3d;
  perspective: 1000px;
  cursor: pointer;
  border: 1px solid rgba(34, 197, 94, 0.1);
}

.service-card-3d:hover {
  transform: rotateY(10deg) rotateX(10deg) translateZ(30px);
  box-shadow: 0 25px 50px rgba(0,0,0,0.2);
}

body.dark-mode .service-card-3d {
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(20px);
  border-color: rgba(34, 197, 94, 0.3);
}

.service-icon-3d {
  font-size: 3rem;
  color: var(--primary-green);
  margin-bottom: 1rem;
  transition: var(--transition-smooth);
}

.service-card-3d:hover .service-icon-3d {
  transform: rotateY(360deg) scale(1.2);
}

/* Grid Responsivo */
.grid-modern {
  display: grid;
  gap: 2rem;
  padding: 2rem;
}

.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

/* Partículas Flotantes */
.floating-particles {
  position: absolute;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 1;
}

.particle {
  position: absolute;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  animation: float infinite linear;
}

@keyframes float {
  0% {
    transform: translateY(100vh) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateY(-100px) rotate(360deg);
    opacity: 0;
  }
}

/* Efectos de Scroll */
.scroll-reveal {
  opacity: 0;
  transform: translateY(50px);
  transition: all 0.8s ease-out;
}

.scroll-reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Secciones Modernas */
.section-modern {
  padding: 5rem 2rem;
  max-width: 1400px;
  margin: 0 auto;
  position: relative;
}

.section-title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  text-align: center;
  margin-bottom: 3rem;
  background: var(--gradient-nature);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Footer Futurista */
footer {
  background: var(--gradient-earth);
  color: white;
  padding: 3rem 2rem 1rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-nature);
}

/* Responsive Design */
@media (max-width: 768px) {
  .nav-links {
    display: none;
  }
  
  .mobile-menu-btn {
    display: block;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-dark);
  }
  
  body.dark-mode .mobile-menu-btn {
    color: var(--text-light);
  }
  
  .calculator-3d {
    padding: 2rem 1rem;
    margin: 1rem;
  }
  
  .hero-content {
    padding: 1rem;
  }
  
  .section-modern {
    padding: 3rem 1rem;
  }
}

/* Animación de Carga de Página */
@keyframes pageLoad {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

body {
  animation: pageLoad 0.8s ease-out;
}

/* Efectos de Hover Globales */
.interactive:hover {
  transform: translateY(-5px);
  transition: var(--transition-smooth);
}

/* Estados de Carga */
.loading {
  position: relative;
  overflow: hidden;
}

.loading::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  100% {
    left: 100%;
  }
}