@import url("https://fonts.googleapis.com/css2?family=Orbitron:wght@600&display=swap");

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

body {
  background: #000;
  color: #fff;
  font-family: "Orbitron", sans-serif;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.stack-wrapper {
  padding: 4rem 2rem;
  flex-grow: 1;
  text-align: center;
}

.stack-title {
  font-size: 3rem;
  color: #5b913b;
  margin-bottom: 2rem;
  font-family: "Orbitron", sans-serif;
}

/* === FILTER BUTTONS === */
.filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.filter-btn,
.reroll-btn {
  padding: 0.4rem 1rem;
  background: #1a1a1a;
  border: 1px solid #444;
  border-radius: 20px;
  color: #fff;
  cursor: pointer;
  font-weight: bold;
  transition: background 0.2s ease;
}

.filter-btn.active,
.filter-btn:hover,
.reroll-btn:hover {
  background: #5b913b;
}

/* === CLOUD === */
.cloud {
  position: relative;
  width: 100%;
  max-width: 1000px;
  height: 600px;
  margin: 0 auto;
}

/* === BUBBLE BASE === */
.bubble {
  position: absolute;
  padding: 0.6rem 1.4rem 0.6rem 2.2rem;
  border-radius: 30px;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.5px;
  color: white;
  cursor: pointer;
  white-space: nowrap;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
  transform: scale(1);
  animation: fadeInPop 0.4s ease;
  transition: top 0.5s ease, left 0.5s ease, transform 0.3s ease, opacity 0.4s;
  z-index: 1;
}

/* === ICONOS POR CATEGORÍA === */
.bubble.core::before {
  content: "🧱";
  position: absolute;
  left: 0.8rem;
}
.bubble.frontend::before {
  content: "🎨";
  position: absolute;
  left: 0.8rem;
}
.bubble.backend::before {
  content: "⚙️";
  position: absolute;
  left: 0.8rem;
}
.bubble.devops::before {
  content: "☁️";
  position: absolute;
  left: 0.8rem;
}
.bubble.tools::before {
  content: "🛠️";
  position: absolute;
  left: 0.8rem;
}
.bubble.creative::before {
  content: "🎮";
  position: absolute;
  left: 0.8rem;
}
.bubble.maker::before {
  content: "🔧";
  position: absolute;
  left: 0.8rem;
}

/* === FAVORITAS === */
.bubble.favorite {
  border: 2px solid gold;
}
.bubble.favorite::after {
  content: "⭐";
  position: absolute;
  top: -12px;
  right: -12px;
  font-size: 1rem;
}

/* === ANIMACIONES === */
.bubble.show {
  opacity: 1;
}
.bubble.filtered {
  animation: zoomToCenter 0.5s ease;
}
.bubble.rerolling {
  animation: rerollPop 0.4s ease;
}

@keyframes fadeInPop {
  0% {
    opacity: 0;
    transform: scale(0.5);
  }
  60% {
    opacity: 1;
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes zoomToCenter {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes rerollPop {
  0% {
    opacity: 0.5;
    transform: scale(0.7);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* === TOOLTIP === */
.tooltip {
  position: absolute;
  background: rgba(30, 30, 30, 0.95);
  color: white;
  padding: 1rem 1.2rem;
  border-radius: 12px;
  max-width: 240px;
  font-size: 0.9rem;
  box-shadow: 0 0 15px rgba(123, 228, 62, 0.4);
  display: none;
  z-index: 999;
  animation: fadeIn 0.2s ease-out;
  font-family: "Orbitron", sans-serif;
}
.tooltip .arrow {
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 10px solid rgba(30, 30, 30, 0.95);
  position: absolute;
  top: -10px;
  left: 20px;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* === GRADIENTS DE CRISTAL POR CATEGORÍA === */
.core {
  background: linear-gradient(
    145deg,
    rgba(47, 97, 47, 0.2),
    rgba(47, 97, 47, 0.05)
  );
}
.frontend {
  background: linear-gradient(
    145deg,
    rgba(91, 145, 59, 0.2),
    rgba(91, 145, 59, 0.05)
  );
}
.backend {
  background: linear-gradient(
    145deg,
    rgba(46, 112, 161, 0.2),
    rgba(46, 112, 161, 0.05)
  );
}
.devops {
  background: linear-gradient(
    145deg,
    rgba(161, 121, 46, 0.2),
    rgba(161, 121, 46, 0.05)
  );
}
.tools {
  background: linear-gradient(
    145deg,
    rgba(114, 59, 161, 0.2),
    rgba(114, 59, 161, 0.05)
  );
}
.creative {
  background: linear-gradient(
    145deg,
    rgba(59, 124, 145, 0.2),
    rgba(59, 124, 145, 0.05)
  );
}
.maker {
  background: linear-gradient(
    145deg,
    rgba(145, 59, 59, 0.2),
    rgba(145, 59, 59, 0.05)
  );
}

/* === FOOTER === */
.footer {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  background: transparent;
  padding: 2rem 1rem;
  font-size: 1rem;
  gap: 1rem;
}
.footer .social {
  text-decoration: none;
  color: white;
  font-weight: 600;
  transition: color 0.3s;
}
.footer .social:hover {
  color: #7be43e;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .cloud {
    height: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .bubble {
    position: static;
    margin: 0.5rem;
    display: inline-block;
    transform: none !important;
    opacity: 1 !important;
  }
}
.btn {
  display: inline-block;
  margin-top: 1.5rem;
  background: #5b913b;
  color: white;
  padding: 0.6rem 1.2rem;
  border-radius: 30px;
  text-decoration: none;
  font-weight: 500;
  transition: 0.3s ease;
}

.btn:hover {
  background: #77b254;
  transform: translateY(-2px);
}
.lang-switch-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 999;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid #7be43e;
  padding: 0.3rem 0.8rem;
  border-radius: 30px;
  backdrop-filter: blur(10px);
}

.flag {
  font-size: 0.9rem;
  color: white;
  font-weight: bold;
}

.lang-toggle {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
}

.lang-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.4s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: #7be43e;
}

input:checked + .slider:before {
  transform: translateX(22px);
}
