:root {
  --eco-primary: #004d40;
  --eco-secondary: #26a69a;
  --eco-accent: #ffca28;
  --eco-accent-2: #00e676;
  --eco-bg: #0a1612;
  --eco-card-bg: rgba(255, 255, 255, 0.03);
  --text-primary: #e8f5f2;
  --text-secondary: #a5d6d0;
}

* {
  scroll-behavior: smooth;
}

body {
  font-family: "Montserrat", sans-serif;
  background: linear-gradient(135deg, #0a1612 0%, #001510 50%, #000000 100%);
  color: var(--text-primary);
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 20% 30%, rgba(38, 166, 154, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(0, 230, 118, 0.1) 0%, transparent 50%);
  pointer-events: none;
  z-index: -1;
}

/* Animaciones globales */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes glow {
  0%, 100% { box-shadow: 0 0 20px rgba(38, 166, 154, 0.5); }
  50% { box-shadow: 0 0 40px rgba(38, 166, 154, 0.8); }
}

@keyframes shimmer {
  0% { background-position: -1000px 0; }
  100% { background-position: 1000px 0; }
}

/* Navbar Mejorado */
.navbar {
  background: rgba(0, 21, 16, 0.85);
  backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(38, 166, 154, 0.2);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  transition: all 0.3s ease;
}

.navbar-brand {
  position: relative;
  overflow: hidden;
}

.navbar-brand span {
  font-weight: 700;
  letter-spacing: 2px;
  background: linear-gradient(135deg, #26a69a, #00e676);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  transition: all 0.3s ease;
}

.navbar-brand:hover span {
  letter-spacing: 3px;
}

.navbar-brand .material-icons {
  animation: float 3s ease-in-out infinite;
}

.nav-link {
  position: relative;
  color: var(--text-secondary) !important;
  transition: all 0.3s ease;
  font-weight: 500;
}

.nav-link::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--eco-secondary), var(--eco-accent));
  transform: translateX(-50%);
  transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.nav-link.active {
  color: var(--eco-accent) !important;
  font-weight: 600;
}

/* Hero Section Ultra Mejorado */
#hero {
  min-height: 100vh;
  background: 
    radial-gradient(circle at 20% 50%, rgba(0, 77, 64, 0.4) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(38, 166, 154, 0.3) 0%, transparent 50%),
    linear-gradient(135deg, #001510 0%, #000000 100%);
  color: #fff;
  padding-top: 100px;
  padding-bottom: 80px;
  position: relative;
  overflow: hidden;
}

#hero::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -10%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(38, 166, 154, 0.15) 0%, transparent 70%);
  border-radius: 50%;
  animation: float 6s ease-in-out infinite;
}

#hero::after {
  content: "";
  position: absolute;
  bottom: -30%;
  left: -5%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(0, 230, 118, 0.12) 0%, transparent 70%);
  border-radius: 50%;
  animation: float 8s ease-in-out infinite reverse;
}

#hero .container {
  position: relative;
  z-index: 2;
}

#hero .hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.2rem;
  border-radius: 50px;
  background: rgba(38, 166, 154, 0.15);
  border: 1px solid rgba(38, 166, 154, 0.3);
  backdrop-filter: blur(10px);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  animation: fadeInUp 0.8s ease;
  transition: all 0.3s ease;
}

#hero .hero-badge:hover {
  background: rgba(38, 166, 154, 0.25);
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(38, 166, 154, 0.3);
}

#hero h1 {
  font-weight: 800;
  font-size: clamp(2.5rem, 5vw, 4rem);
  line-height: 1.2;
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, #ffffff 0%, #a5d6d0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: fadeInUp 1s ease 0.2s both;
}

#hero p.lead {
  font-weight: 300;
  font-size: 1.1rem;
  line-height: 1.8;
  max-width: 600px;
  color: var(--text-secondary);
  animation: fadeInUp 1s ease 0.4s both;
}

.btn-eco-primary {
  background: linear-gradient(135deg, var(--eco-secondary), var(--eco-accent-2));
  border: none;
  color: #fff;
  border-radius: 50px;
  padding: 0.8rem 2rem;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.5px;
  box-shadow: 0 10px 30px rgba(38, 166, 154, 0.4);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

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

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

.btn-eco-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 40px rgba(38, 166, 154, 0.6);
  color: #fff;
}

.btn-ghost {
  border-radius: 50px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  padding: 0.7rem 2rem;
  font-weight: 600;
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(255, 255, 255, 0.2);
  color: #fff;
}

.hero-video-wrapper {
  background: rgba(0, 0, 0, 0.4);
  border-radius: 2rem;
  padding: 1.5rem;
  box-shadow: 
    0 30px 60px rgba(0, 0, 0, 0.5),
    inset 0 0 40px rgba(38, 166, 154, 0.1);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(38, 166, 154, 0.2);
  animation: fadeInUp 1s ease 0.6s both;
  transition: all 0.3s ease;
}

.hero-video-wrapper:hover {
  transform: translateY(-10px);
  box-shadow: 
    0 40px 80px rgba(0, 0, 0, 0.6),
    inset 0 0 50px rgba(38, 166, 154, 0.2);
}

.hero-tagline {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.85rem;
  opacity: 0.9;
  animation: fadeInUp 1s ease 0.8s both;
}

/* Section Defaults Mejorados */
section {
  padding: 100px 0;
  position: relative;
}

.section-title {
  font-weight: 800;
  font-size: clamp(2rem, 4vw, 2.8rem);
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--eco-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1rem;
}

.section-subtitle {
  color: var(--eco-accent);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 3px;
  font-weight: 700;
  margin-bottom: 0.75rem;
  display: inline-block;
  position: relative;
}

.divider {
  width: 80px;
  height: 5px;
  border-radius: 10px;
  margin-top: 1rem;
  background: linear-gradient(
    90deg,
    var(--eco-secondary),
    var(--eco-accent),
    var(--eco-accent-2)
  );
  box-shadow: 0 5px 15px rgba(38, 166, 154, 0.4);
  animation: shimmer 2s infinite;
  background-size: 200% 100%;
}

/* Cards Glassmorphism Pro */
.eco-card {
  border: none;
  border-radius: 1.5rem;
  box-shadow: 
    0 20px 60px rgba(0, 0, 0, 0.4),
    inset 0 0 40px rgba(38, 166, 154, 0.05);
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.4s ease;
  position: relative;
  overflow: hidden;
}

.eco-card::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(38, 166, 154, 0.1) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.eco-card:hover::before {
  opacity: 1;
}

.eco-card:hover {
  transform: translateY(-10px);
  box-shadow: 
    0 30px 80px rgba(0, 0, 0, 0.5),
    inset 0 0 50px rgba(38, 166, 154, 0.1),
    0 0 50px rgba(38, 166, 154, 0.3);
  border-color: rgba(38, 166, 154, 0.4);
}

.eco-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.4rem 0.9rem;
  border-radius: 50px;
  font-size: 0.75rem;
  background: rgba(38, 166, 154, 0.15);
  border: 1px solid rgba(38, 166, 154, 0.3);
  color: var(--eco-accent-2);
  margin-right: 0.35rem;
  margin-bottom: 0.35rem;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.eco-chip:hover {
  background: rgba(38, 166, 154, 0.25);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(38, 166, 154, 0.3);
}

.eco-chip .material-icons {
  font-size: 16px;
}

.icon-circle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(38, 166, 154, 0.2), rgba(0, 230, 118, 0.2));
  color: var(--eco-accent-2);
  margin-bottom: 1rem;
  box-shadow: 0 10px 30px rgba(38, 166, 154, 0.3);
  transition: all 0.3s ease;
  border: 2px solid rgba(38, 166, 154, 0.3);
}

.icon-circle:hover {
  transform: scale(1.1) rotate(10deg);
  box-shadow: 0 15px 40px rgba(38, 166, 154, 0.5);
}

/* Tabs Mejorados */
.nav-pills .nav-link {
  border-radius: 50px;
  font-size: 0.9rem;
  padding: 0.6rem 1.5rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  transition: all 0.3s ease;
}

.nav-pills .nav-link:hover {
  background: rgba(38, 166, 154, 0.2);
  border-color: rgba(38, 166, 154, 0.4);
}

.nav-pills .nav-link.active {
  background: linear-gradient(135deg, var(--eco-secondary), var(--eco-accent-2));
  box-shadow: 0 10px 30px rgba(38, 166, 154, 0.4);
  border-color: transparent;
}

/* Timeline Mejorado */
.timeline {
  position: relative;
  padding-left: 40px;
  margin-top: 30px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 15px;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(
    to bottom,
    var(--eco-secondary),
    var(--eco-accent),
    var(--eco-accent-2)
  );
  box-shadow: 0 0 10px rgba(38, 166, 154, 0.5);
  border-radius: 10px;
}

.timeline-item {
  position: relative;
  margin-bottom: 30px;
  animation: fadeInUp 0.6s ease both;
}

.timeline-item:nth-child(1) { animation-delay: 0.1s; }
.timeline-item:nth-child(2) { animation-delay: 0.2s; }
.timeline-item:nth-child(3) { animation-delay: 0.3s; }
.timeline-item:nth-child(4) { animation-delay: 0.4s; }

.timeline-marker {
  position: absolute;
  left: 7px;
  top: 5px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 3px solid rgba(0, 21, 16, 0.9);
  background: linear-gradient(135deg, var(--eco-secondary), var(--eco-accent-2));
  box-shadow: 
    0 0 0 6px rgba(38, 166, 154, 0.3),
    0 0 20px rgba(38, 166, 154, 0.6);
  animation: glow 2s infinite;
}

.timeline-item h6 {
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--eco-accent-2);
  font-size: 1.1rem;
}

.timeline-item p {
  margin-bottom: 0;
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Impact Badges Mejorados */
.impact-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border-radius: 50px;
  padding: 0.4rem 1rem;
  font-size: 0.8rem;
  background: rgba(38, 166, 154, 0.15);
  border: 1px solid rgba(38, 166, 154, 0.3);
  color: var(--eco-accent-2);
  margin: 0.25rem;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.impact-badge:hover {
  background: rgba(38, 166, 154, 0.25);
  transform: translateY(-2px);
  box-shadow: 0 5px 20px rgba(38, 166, 154, 0.4);
}

/* Game Section Ultra Pro */
#juego {
  background: 
    radial-gradient(circle at 30% 40%, rgba(0, 77, 64, 0.4) 0%, transparent 60%),
    radial-gradient(circle at 70% 70%, rgba(38, 166, 154, 0.3) 0%, transparent 60%),
    linear-gradient(135deg, #0a1612 0%, #000000 100%);
  color: #e0f2f1;
  position: relative;
  overflow: hidden;
}

#juego::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(135deg, rgba(38, 166, 154, 0.1) 0%, transparent 40%, transparent 60%, rgba(0, 230, 118, 0.08) 100%);
  opacity: 0.8;
  pointer-events: none;
}

#juego .section-title,
#juego .section-subtitle {
  color: #e0f2f1;
}

.game-card {
  border-radius: 1.5rem;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(25px) saturate(180%);
  border: 1px solid rgba(38, 166, 154, 0.3);
  box-shadow: 
    0 30px 60px rgba(0, 0, 0, 0.7),
    inset 0 0 40px rgba(38, 166, 154, 0.1),
    0 0 40px rgba(38, 166, 154, 0.2);
  transition: all 0.4s ease;
}

.game-card:hover {
  transform: translateY(-10px);
  box-shadow: 
    0 40px 80px rgba(0, 0, 0, 0.8),
    inset 0 0 50px rgba(38, 166, 154, 0.15),
    0 0 60px rgba(38, 166, 154, 0.4);
}

#gameViewport {
  border-radius: 1rem;
  border: 2px solid rgba(38, 166, 154, 0.4);
  height: 280px;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(4, 1fr);
  gap: 8px;
  padding: 15px;
  background: 
    radial-gradient(circle at top, rgba(38, 166, 154, 0.2), transparent 70%),
    rgba(0, 0, 0, 0.4);
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.5);
}

.tile {
  border-radius: 8px;
  background: rgba(0, 77, 64, 0.6);
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.tile:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 25px rgba(38, 166, 154, 0.4);
}

/* Cursor de maquinaria para árboles */
.tile.tree {
  cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"><text y="28" font-size="28">🚜</text></svg>'), auto;
}

.tile.tree::before {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 12px;
  height: 18px;
  border-radius: 4px;
  background: #4e342e;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
}

.tile.tree::after {
  content: "";
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2e7d32, #4caf50);
  box-shadow: 
    0 0 0 5px rgba(56, 142, 60, 0.4),
    0 5px 15px rgba(46, 125, 50, 0.6);
  transition: all 0.3s ease;
}

/* Animación de corte del árbol */
@keyframes treeCutting {
  0% { transform: translateX(-50%) rotate(0deg); }
  25% { transform: translateX(-50%) rotate(-5deg); }
  50% { transform: translateX(-50%) rotate(5deg); }
  75% { transform: translateX(-50%) rotate(-3deg); }
  100% { transform: translateX(-50%) rotate(0deg); }
}

.tile.tree.cutting::before,
.tile.tree.cutting::after {
  animation: treeCutting 0.3s ease-in-out 3;
}

/* Árbol cayendo */
@keyframes treeFalling {
  0% {
    transform: translateX(-50%) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateX(-50%) rotate(90deg) translateY(20px);
    opacity: 0;
  }
}

.tile.tree.falling::before,
.tile.tree.falling::after {
  animation: treeFalling 0.8s ease-in forwards;
}

/* Trozos de madera */
.tile.wood-logs {
  background: rgba(78, 52, 46, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  cursor: default;
}

.tile.wood-logs::before {
  content: "🪵";
  animation: woodAppear 0.5s ease-out;
}

@keyframes woodAppear {
  0% {
    transform: scale(0) rotate(0deg);
    opacity: 0;
  }
  50% {
    transform: scale(1.2) rotate(180deg);
  }
  100% {
    transform: scale(1) rotate(360deg);
    opacity: 1;
  }
}

/* Árbol protegido */
.tile.tree.protected {
  cursor: not-allowed;
}

.tile.tree.protected::after {
  background: linear-gradient(135deg, #2e7d32, #4caf50);
  box-shadow: 
    0 0 0 5px rgba(0, 230, 118, 0.6),
    0 0 25px rgba(0, 230, 118, 0.8),
    0 5px 15px rgba(46, 125, 50, 0.6);
  animation: protectedGlow 1.5s ease-in-out;
}

@keyframes protectedGlow {
  0%, 100% {
    box-shadow: 
      0 0 0 5px rgba(0, 230, 118, 0.6),
      0 0 25px rgba(0, 230, 118, 0.8);
  }
  50% {
    box-shadow: 
      0 0 0 8px rgba(0, 230, 118, 0.8),
      0 0 40px rgba(0, 230, 118, 1);
  }
}

/* Escudo de protección */
.tile.tree.protected .shield {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2.5rem;
  z-index: 10;
  animation: shieldAppear 0.6s ease-out;
}

@keyframes shieldAppear {
  0% {
    transform: translate(-50%, -50%) scale(0) rotate(0deg);
    opacity: 0;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.3) rotate(180deg);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) scale(1) rotate(360deg);
    opacity: 1;
  }
}

/* Efecto de sierra sobre árbol */
.tile.tree:hover::after {
  transform: translateX(-50%) scale(1.05);
}

.tile.tree:active::after {
  transform: translateX(-50%) scale(0.95);
}

.tile.robot {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  background: rgba(38, 166, 154, 0.3);
  animation: glow 2s infinite;
}

.tile.machine::before {
  content: "⚙️";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  animation: float 2s ease-in-out infinite;
}

.glow-alert {
  box-shadow: 
    0 0 0 3px rgba(255, 82, 82, 0.8),
    0 0 25px rgba(255, 138, 128, 1),
    inset 0 0 20px rgba(255, 82, 82, 0.5);
  animation: pulseAlert 0.8s infinite alternate;
  background: rgba(255, 82, 82, 0.3) !important;
}

@keyframes pulseAlert {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(255, 138, 128, 1);
  }
  100% {
    transform: scale(1.08);
    box-shadow: 0 0 0 10px rgba(255, 82, 82, 0);
  }
}

/* Footer Mejorado */
footer {
  background: linear-gradient(135deg, #001510 0%, #000000 100%);
  color: #b2dfdb;
  padding: 40px 0 20px;
  font-size: 0.9rem;
  border-top: 1px solid rgba(38, 166, 154, 0.2);
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.5);
}

footer a {
  color: var(--eco-accent-2);
  text-decoration: none;
  transition: all 0.3s ease;
}

footer a:hover {
  color: var(--eco-accent);
  text-decoration: underline;
}

/* Backgrounds de Secciones Alternadas */
section:nth-child(even) {
  background: rgba(0, 0, 0, 0.2);
}

section.bg-light {
  background: rgba(255, 255, 255, 0.02) !important;
}

/* Responsive Mejorado */
@media (max-width: 992px) {
  #hero {
    text-align: center;
    padding-top: 120px;
  }

  #hero h1 {
    font-size: 2.5rem;
  }

  .hero-video-wrapper {
    margin-top: 3rem;
  }

  #gameViewport {
    height: 240px;
  }

  section {
    padding: 60px 0;
  }

  .section-title {
    font-size: 2rem;
  }
}

@media (max-width: 576px) {
  #hero h1 {
    font-size: 2rem;
  }

  .btn-eco-primary,
  .btn-ghost {
    padding: 0.6rem 1.5rem;
    font-size: 0.9rem;
  }

  #gameViewport {
    height: 200px;
    gap: 5px;
    padding: 10px;
  }
}