/* ================================
   ESTILOS SECCIÓN TECNOLOGÍAS MODERNO
   ================================ */

/* Animación de letras individuales para títulos */
.animated-heading {
  display: inline-block;
  position: relative;
}

.animated-heading .letter {
  display: inline-block;
  animation: floatLetter 2s ease-in-out infinite;
  transition: all 0.3s ease;
}

.animated-heading .letter:nth-child(1) { animation-delay: 0s; }
.animated-heading .letter:nth-child(2) { animation-delay: 0.1s; }
.animated-heading .letter:nth-child(3) { animation-delay: 0.2s; }
.animated-heading .letter:nth-child(4) { animation-delay: 0.3s; }
.animated-heading .letter:nth-child(5) { animation-delay: 0.4s; }
.animated-heading .letter:nth-child(6) { animation-delay: 0.5s; }
.animated-heading .letter:nth-child(7) { animation-delay: 0.6s; }
.animated-heading .letter:nth-child(8) { animation-delay: 0.7s; }
.animated-heading .letter:nth-child(9) { animation-delay: 0.8s; }
.animated-heading .letter:nth-child(10) { animation-delay: 0.9s; }
.animated-heading .letter:nth-child(11) { animation-delay: 1s; }
.animated-heading .letter:nth-child(12) { animation-delay: 1.1s; }
.animated-heading .letter:nth-child(13) { animation-delay: 1.2s; }
.animated-heading .letter:nth-child(14) { animation-delay: 1.3s; }
.animated-heading .letter:nth-child(15) { animation-delay: 1.4s; }
.animated-heading .letter:nth-child(16) { animation-delay: 1.5s; }
.animated-heading .letter:nth-child(17) { animation-delay: 1.6s; }
.animated-heading .letter:nth-child(18) { animation-delay: 1.7s; }

@keyframes floatLetter {
  0%, 100% {
    transform: translateY(0px);
    color: #ffffff;
    text-shadow: 0 0 5px rgba(13, 110, 253, 0.3);
  }
  50% {
    transform: translateY(-8px);
    color: #00d4ff;
    text-shadow: 0 0 15px rgba(0, 212, 255, 0.8);
  }
}

/* Mantener color de spans internos */
.animated-heading .letter.text-primary {
  color: #0d6efd;
}

.animated-heading .letter.text-primary:hover {
  color: #00d4ff;
}

/* Letras en categorías de tecnologías */
.tech-category-title .letter {
  color: #fff;
  text-shadow: 0 0 5px rgba(0, 212, 255, 0.3);
  font-weight: 700;
}

/* Títulos de categoría con animación moderna */
.tech-category-title {
  font-family: 'Syne', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
  animation: slideInLeft 0.8s ease-out, glowTitle 3s ease-in-out infinite;
  display: flex;
  align-items: center;
  position: relative;
  padding-bottom: 0.5rem;
  text-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
}

.tech-category-title i {
  animation: rotateIcon 3s ease-in-out infinite;
  margin-right: 0.8rem;
  color: #00d4ff;
}

@keyframes rotateIcon {
  0%, 100% {
    transform: rotate(0deg) scale(1);
  }
  50% {
    transform: rotate(10deg) scale(1.1);
  }
}

@keyframes glowTitle {
  0%, 100% {
    filter: drop-shadow(0 0 5px rgba(13, 110, 253, 0.3));
  }
  50% {
    filter: drop-shadow(0 0 15px rgba(0, 212, 255, 0.6));
  }
}

/* Cards de tecnologías principales con movimiento */
.tech-card-main {
  position: relative;
  height: 100%;
  overflow: hidden;
  border: 2px solid rgba(13, 110, 253, 0.3);
  border-radius: 15px;
  background: linear-gradient(135deg, rgba(13, 110, 253, 0.1) 0%, rgba(0, 212, 255, 0.05) 100%);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  animation: scaleIn 0.6s ease-out backwards;
}

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

.tech-card-main:hover {
  border-color: #00d4ff;
  background: linear-gradient(135deg, rgba(13, 110, 253, 0.2) 0%, rgba(0, 212, 255, 0.15) 100%);
  box-shadow: 0 0 30px rgba(0, 212, 255, 0.4), 0 10px 40px rgba(13, 110, 253, 0.2);
  transform: translateY(-15px);
}

.tech-card-body {
  padding: 2rem 1.5rem;
  text-align: center;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  animation: floatCard 3s ease-in-out infinite;
}

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

.tech-icon-main {
  width: 70px;
  height: 70px;
  object-fit: contain;
  margin-bottom: 1rem;
  filter: drop-shadow(0 0 10px rgba(13, 110, 253, 0.3));
  transition: all 0.3s ease;
  animation: rotateIcon 4s linear infinite;
}

.tech-card-main:hover .tech-icon-main {
  transform: scale(1.2) rotate(360deg);
  filter: drop-shadow(0 0 20px rgba(0, 212, 255, 0.6));
}

.tech-title {
  font-family: 'Syne', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.5rem;
  position: relative;
  display: inline-block;
}

.tech-title::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #0d6efd, #00d4ff);
  transition: width 0.3s ease;
}

.tech-card-main:hover .tech-title::after {
  width: 100%;
}

.tech-description {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.7);
  transition: all 0.3s ease;
}

.tech-card-main:hover .tech-description {
  color: #00d4ff;
}

/* Cards de categoría con mejor movimiento */
.tech-category-card {
  background: linear-gradient(135deg, rgba(13, 110, 253, 0.1) 0%, rgba(0, 212, 255, 0.05) 100%);
  border: 2px solid rgba(13, 110, 253, 0.2);
  border-radius: 12px;
  padding: 2rem;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  animation: slideUp 0.8s ease-out backwards;
}

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

.tech-category-card:hover {
  border-color: #00d4ff;
  background: linear-gradient(135deg, rgba(13, 110, 253, 0.15) 0%, rgba(0, 212, 255, 0.1) 100%);
  box-shadow: 0 0 30px rgba(0, 212, 255, 0.3);
  transform: translateY(-10px);
}

/* Grid de tecnologías */
.tech-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

/* Ítem individual de tecnología */
.tech-item-modern {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem;
  border-radius: 10px;
  background: rgba(13, 110, 253, 0.05);
  border: 1px solid rgba(13, 110, 253, 0.1);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  animation: fadeInUp 0.6s ease-out backwards;
  position: relative;
  overflow: hidden;
}

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

.tech-item-modern:nth-child(1) { animation-delay: 0.1s; }
.tech-item-modern:nth-child(2) { animation-delay: 0.2s; }
.tech-item-modern:nth-child(3) { animation-delay: 0.3s; }
.tech-item-modern:nth-child(4) { animation-delay: 0.4s; }
.tech-item-modern:nth-child(5) { animation-delay: 0.5s; }
.tech-item-modern:nth-child(6) { animation-delay: 0.6s; }
.tech-item-modern:nth-child(7) { animation-delay: 0.7s; }
.tech-item-modern:nth-child(8) { animation-delay: 0.8s; }

.tech-item-modern::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(0, 212, 255, 0.3), transparent);
  transition: left 0.5s ease;
}

.tech-item-modern:hover::before {
  left: 100%;
}

.tech-item-modern:hover {
  background: rgba(0, 212, 255, 0.15);
  border-color: #00d4ff;
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
  transform: scale(1.1) translateY(-5px);
}

.tech-item-modern img {
  width: 45px;
  height: 45px;
  object-fit: contain;
  filter: drop-shadow(0 0 5px rgba(13, 110, 253, 0.3));
  transition: all 0.3s ease;
}

.tech-item-modern:hover img {
  transform: rotate(360deg) scale(1.2);
  filter: drop-shadow(0 0 15px rgba(0, 212, 255, 0.6));
}

.tech-item-modern span {
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);
  text-align: center;
  transition: all 0.3s ease;
  font-family: 'Poppins', sans-serif;
}

.tech-item-modern:hover span {
  color: #00d4ff;
  text-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

/* Stack Principal con animación de entrada */
#tecnologias h3.fs-2 {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  color: #fff;
  font-size: 2.5rem;
  animation: slideDown 0.8s ease-out, pulseGlow 2s ease-in-out infinite;
  position: relative;
  display: inline-block;
  background: linear-gradient(135deg, #00d4ff 0%, #0d6efd 100%);
  -webkit-background-clip: text;
  background-clip: text;
  filter: drop-shadow(0 0 10px rgba(0, 212, 255, 0.3));
}

#tecnologias h3.fs-2.animated-heading .letter {
  background: inherit;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulseGlow {
  0%, 100% {
    filter: drop-shadow(0 0 5px rgba(13, 110, 253, 0.3));
  }
  50% {
    filter: drop-shadow(0 0 15px rgba(0, 212, 255, 0.6));
  }
}

/* Mis Tecnologías H2 */
#tecnologias h2.display-5.animated-heading {
  font-family: 'Syne', sans-serif;
  font-weight: 900;
  font-size: 3rem;
  color: #fff;
  animation: slideDown 0.8s ease-out, pulseGlow 2s ease-in-out infinite;
}

#tecnologias h2.display-5.animated-heading .letter {
  color: #fff;
  text-shadow: 0 0 5px rgba(13, 110, 253, 0.3);
  font-weight: 900;
}

#tecnologias h2.display-5.animated-heading .letter.text-primary {
  color: #0d6efd;
  font-weight: 900;
}

/* Divisor personalizado */
.divider-custom {
  width: 60px;
  height: 4px;
  background: linear-gradient(90deg, #0d6efd, #00d4ff);
  border-radius: 2px;
  animation: expandWidth 0.8s ease-out, shimmer 2s ease-in-out infinite;
  position: relative;
}

@keyframes expandWidth {
  from {
    width: 0;
  }
  to {
    width: 60px;
  }
}

@keyframes shimmer {
  0%, 100% {
    box-shadow: 0 0 5px rgba(13, 110, 253, 0.3);
  }
  50% {
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.6);
  }
}

/* Responsive */
@media (max-width: 768px) {
  .tech-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  #tecnologias h3.fs-2 {
    font-size: 1.8rem;
  }

  .tech-category-title {
    font-size: 1.2rem;
  }

  .tech-card-body {
    padding: 1.5rem 1rem;
  }

  .tech-icon-main {
    width: 50px;
    height: 50px;
  }
}

@media (max-width: 576px) {
  .tech-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .tech-category-card {
    padding: 1.5rem 1rem;
  }

  .tech-item-modern {
    padding: 0.8rem;
  }

  .tech-item-modern img {
    width: 35px;
    height: 35px;
  }

  .tech-item-modern span {
    font-size: 0.7rem;
  }
}

/* Efecto de brillo inicial en sección */
#tecnologias {
  animation: sectionGlow 2s ease-out;
}

@keyframes sectionGlow {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
    box-shadow: inset 0 0 30px rgba(0, 212, 255, 0.1);
  }
}

/* Efecto de entrada en cascada para las cards */
.tech-card-main {
  opacity: 0;
  animation: scaleIn 0.6s ease-out forwards;
}

.col-lg-3:nth-child(1) .tech-card-main { animation-delay: 0.1s; }
.col-lg-3:nth-child(2) .tech-card-main { animation-delay: 0.2s; }
.col-lg-3:nth-child(3) .tech-card-main { animation-delay: 0.3s; }
.col-lg-3:nth-child(4) .tech-card-main { animation-delay: 0.4s; }

/* Efecto de línea que recorre los títulos */
.tech-category-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #00d4ff, transparent);
  animation: slideLineIn 0.8s ease-out;
}

@keyframes slideLineIn {
  from {
    width: 0;
    left: 0;
  }
  to {
    width: 100%;
    left: 0;
  }
}

/* ================================
   ESTILOS PARA TEMA CLARO
   ================================ */

body.light-theme .animated-heading .letter {
  color: #1a1a1a;
  text-shadow: 0 0 5px rgba(13, 110, 253, 0.2);
}

body.light-theme .animated-heading .letter:nth-child(1),
body.light-theme .animated-heading .letter:nth-child(2),
body.light-theme .animated-heading .letter:nth-child(3),
body.light-theme .animated-heading .letter:nth-child(4),
body.light-theme .animated-heading .letter:nth-child(5),
body.light-theme .animated-heading .letter:nth-child(6),
body.light-theme .animated-heading .letter:nth-child(7),
body.light-theme .animated-heading .letter:nth-child(8),
body.light-theme .animated-heading .letter:nth-child(9),
body.light-theme .animated-heading .letter:nth-child(10),
body.light-theme .animated-heading .letter:nth-child(11),
body.light-theme .animated-heading .letter:nth-child(12),
body.light-theme .animated-heading .letter:nth-child(13),
body.light-theme .animated-heading .letter:nth-child(14),
body.light-theme .animated-heading .letter:nth-child(15),
body.light-theme .animated-heading .letter:nth-child(16),
body.light-theme .animated-heading .letter:nth-child(17),
body.light-theme .animated-heading .letter:nth-child(18) {
  color: #1a1a1a;
}

body.light-theme .animated-heading .letter.text-primary {
  color: #0d6efd;
}

body.light-theme .tech-category-title .letter {
  color: #1a1a1a;
  text-shadow: 0 0 5px rgba(13, 110, 253, 0.2);
}

body.light-theme .tech-category-title {
  color: #1a1a1a;
  text-shadow: 0 0 5px rgba(13, 110, 253, 0.2);
}

body.light-theme .tech-category-title i {
  color: #0d6efd;
}

body.light-theme .tech-card-main {
  border-color: rgba(13, 110, 253, 0.4);
  background: linear-gradient(135deg, rgba(13, 110, 253, 0.08) 0%, rgba(13, 110, 253, 0.05) 100%);
}

body.light-theme .tech-card-main:hover {
  border-color: #0d6efd;
  background: linear-gradient(135deg, rgba(13, 110, 253, 0.15) 0%, rgba(13, 110, 253, 0.1) 100%);
  box-shadow: 0 0 30px rgba(13, 110, 253, 0.3), 0 10px 40px rgba(13, 110, 253, 0.15);
}

body.light-theme .tech-icon-main {
  filter: drop-shadow(0 0 10px rgba(13, 110, 253, 0.2));
}

body.light-theme .tech-card-main:hover .tech-icon-main {
  filter: drop-shadow(0 0 20px rgba(13, 110, 253, 0.4));
}

body.light-theme .tech-title {
  color: #1a1a1a;
}

body.light-theme .tech-description {
  color: rgba(0, 0, 0, 0.7);
}

body.light-theme .tech-item-modern {
  background: rgba(13, 110, 253, 0.05);
  border-color: rgba(13, 110, 253, 0.2);
}

body.light-theme .tech-item-modern span {
  color: #1a1a1a;
}