/**
 * Stack Tecnológico Ultra Interactivo - Jorge Acuña Portfolio
 * Efectos: Partículas, campos magnéticos, animaciones 3D, glow neón
 */

/* =============================================
   VARIABLES CSS POR TECNOLOGÍA
   ============================================= */
:root {
    /* Colores de tecnologías */
    --n8n-color: #ff6d5a;
    --n8n-glow: rgba(255, 109, 90, 0.6);

    --nodejs-color: #68a063;
    --nodejs-glow: rgba(104, 160, 99, 0.6);

    --python-color: #3776ab;
    --python-glow: rgba(55, 118, 171, 0.6);

    --openai-color: #0066ff;
    --openai-glow: rgba(0, 102, 255, 0.6);

    --llama-color: #f77234;
    --llama-glow: rgba(247, 114, 52, 0.6);

    --gemini-color: #4285f4;
    --gemini-glow: rgba(66, 133, 244, 0.6);

    --ollama-color: #ffffff;
    --ollama-glow: rgba(255, 255, 255, 0.4);

    --evolution-color: #00d8ff;
    --evolution-glow: rgba(0, 216, 255, 0.6);

    --baileys-color: #25d366;
    --baileys-glow: rgba(37, 211, 102, 0.6);

    --mysql-color: #00758f;
    --mysql-glow: rgba(0, 117, 143, 0.6);

    --postgresql-color: #336791;
    --postgresql-glow: rgba(51, 103, 145, 0.6);

    --docker-color: #2496ed;
    --docker-glow: rgba(36, 150, 237, 0.6);

    /* Niveles de dominio (para barras de progreso) */
    --n8n-level: 95%;
    --nodejs-level: 90%;
    --python-level: 85%;
    --openai-level: 92%;
    --llama-level: 88%;
    --gemini-level: 85%;
    --ollama-level: 80%;
    --evolution-level: 93%;
    --baileys-level: 90%;
    --mysql-level: 87%;
    --postgresql-level: 82%;
    --docker-level: 88%;

    /* Configuraciones de animación */
    --transition-smooth: cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
    --transition-elastic: cubic-bezier(0.175, 0.885, 0.32, 1.275);

    /* Efectos de brillo */
    --glow-intensity: 0 0 20px;
    --glow-intensity-strong: 0 0 40px;
    --neon-intensity: 0 0 60px;
}

/* =============================================
   RESET Y BASE
   ============================================= */
.tech-stack-section {
    position: relative;
    padding: 100px 0;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 50%, #0a0a0a 100%);
    overflow: hidden;
}

.tech-stack-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 80%, rgba(102, 126, 234, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(118, 75, 162, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.section-subtitle {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.1rem;
    margin-top: 0.5rem;
    margin-bottom: 3rem;
}

/* =============================================
   TARJETAS TECH-CARD (ESTRUCTURA HTML)
   ============================================= */
.tech-card {
    position: relative;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 30px;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
    opacity: 0;
    transform: translateY(30px);
}

.tech-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.tech-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, var(--tech-glow, rgba(102, 126, 234, 0.3)) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.5s ease;
    animation: particleFloat 8s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

.tech-card:hover {
    border-color: var(--tech-color, #667eea);
    box-shadow:
        0 25px 50px rgba(0, 0, 0, 0.3),
        0 0 40px var(--tech-glow, rgba(102, 126, 234, 0.4));
    transform: translateY(-10px) scale(1.02);
}

.tech-card:hover::before {
    opacity: 0.6;
}

.tech-card.selected {
    border-color: var(--tech-color, #667eea);
    background: rgba(255, 255, 255, 0.08);
    box-shadow:
        0 0 30px var(--tech-glow, rgba(102, 126, 234, 0.6)),
        inset 0 0 30px rgba(255, 255, 255, 0.05);
}

.tech-card-inner {
    position: relative;
    z-index: 2;
    transform-style: preserve-3d;
    transition: transform 0.3s ease;
}

/* Contenedor de partículas */
.tech-card-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.tech-particle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

/* Icono */
.tech-icon-wrapper {
    position: relative;
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
}

.tech-icon {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    border-radius: 20px;
    font-size: 2.5rem;
    z-index: 2;
    overflow: hidden;
}

.tech-icon svg {
    width: 40px;
    height: 40px;
    stroke: var(--tech-color, #fff);
    transition: stroke 0.3s ease;
}

.tech-card:hover .tech-icon svg {
    stroke: var(--tech-color, #667eea);
}

.tech-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, var(--tech-color, #667eea) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.5s ease;
    animation: rotateGlow 4s linear infinite;
}

.tech-card:hover .tech-glow {
    opacity: 0.4;
}

/* Información de la tecnología */
.tech-info {
    position: relative;
    z-index: 2;
}

.tech-info .tech-name {
    font-size: 1.8rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 5px;
    transition: all 0.3s ease;
}

.tech-card:hover .tech-name {
    color: var(--tech-color, #667eea);
    text-shadow: 0 0 20px var(--tech-glow, rgba(102, 126, 234, 0.5));
}

.tech-category {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    margin-bottom: 15px;
}

/* Barra de nivel */
.tech-level {
    margin-top: 20px;
}

.level-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.level-fill {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--tech-color, #667eea) 0%, var(--tech-glow, rgba(102, 126, 234, 0.6)) 100%);
    border-radius: 10px;
    transition: width 1.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.level-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: progressShine 2s ease-in-out infinite;
}

.level-percent {
    display: block;
    margin-top: 8px;
    text-align: right;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--tech-color, #667eea);
}

/* Experiencia */
.tech-experience {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.experience-years {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
}

.experience-badge {
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    font-size: 0.75rem;
    color: var(--tech-color, #667eea);
    font-weight: 600;
}

/* Campo magnético */
.tech-magnetic-field {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 20px;
    background: radial-gradient(circle at center, var(--tech-glow, rgba(102, 126, 234, 0.2)) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 0;
}

/* =============================================
   GRID DEL STACK TECNOLÓGICO
   ============================================= */
.tech-stack-grid {
    position: relative;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    z-index: 1;
    perspective: 1000px;
}

/* =============================================
   TARJETA DE TECNOLOGÍA
   ============================================= */
.tech-item {
    position: relative;
    padding: 2rem 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: all 0.5s var(--transition-smooth);
    transform-style: preserve-3d;
    opacity: 0;
    transform: translateY(30px) rotateX(10deg);
    overflow: hidden;
}

/* Animación de entrada escalonada */
.tech-item:nth-child(1) { animation-delay: 0.1s; }
.tech-item:nth-child(2) { animation-delay: 0.2s; }
.tech-item:nth-child(3) { animation-delay: 0.3s; }
.tech-item:nth-child(4) { animation-delay: 0.4s; }
.tech-item:nth-child(5) { animation-delay: 0.5s; }
.tech-item:nth-child(6) { animation-delay: 0.6s; }
.tech-item:nth-child(7) { animation-delay: 0.7s; }
.tech-item:nth-child(8) { animation-delay: 0.8s; }
.tech-item:nth-child(9) { animation-delay: 0.9s; }
.tech-item:nth-child(10) { animation-delay: 1s; }
.tech-item:nth-child(11) { animation-delay: 1.1s; }
.tech-item:nth-child(12) { animation-delay: 1.2s; }

.tech-item.visible {
    opacity: 1;
    transform: translateY(0) rotateX(0);
}

/* =============================================
   EFECTO DE PARTÍCULAS (CAMPO DE FUERZA)
   ============================================= */
.tech-item::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, var(--tech-glow) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.5s ease;
    animation: particleFloat 8s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

/* Anillo de partículas orbitando */
.tech-item::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 120%;
    height: 120%;
    border: 1px dashed rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    animation: orbitRotate 20s linear infinite;
    pointer-events: none;
    z-index: 0;
}

/* =============================================
   EFECTO HOVER 3D
   ============================================= */
.tech-item:hover {
    transform: translateY(-10px) rotateX(5deg) rotateY(-5deg) scale(1.05);
    box-shadow:
        0 25px 50px rgba(0, 0, 0, 0.3),
        var(--glow-intensity-strong) var(--tech-glow);
    border-color: var(--tech-color);
}

.tech-item:hover::before {
    opacity: 0.6;
}

.tech-item:hover::after {
    opacity: 1;
    border-color: var(--tech-glow);
}

/* =============================================
   CAMPO MAGNÉTICO (MOUSE PROXIMITY)
   ============================================= */
.tech-item.magnetic-active {
    transform: scale(1.02);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.2);
}

.tech-item.magnetic-active::before {
    opacity: 0.3;
    animation-duration: 4s;
}

/* =============================================
   CONTENIDO DE LA TARJETA
   ============================================= */
.tech-name {
    position: relative;
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    text-align: center;
    z-index: 2;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.tech-item:hover .tech-name {
    color: var(--tech-color);
    text-shadow:
        0 0 10px var(--tech-glow),
        0 0 20px var(--tech-glow),
        0 0 30px var(--tech-glow);
    transform: scale(1.1);
}

/* =============================================
   BARRA DE PROGRESO DE DOMINIO
   ============================================= */
.tech-item .progress-container {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    overflow: hidden;
    opacity: 0;
    transform: scaleX(0);
    transform-origin: left;
    transition: all 0.5s var(--transition-smooth);
}

.tech-item:hover .progress-container {
    opacity: 1;
    transform: scaleX(1);
}

.tech-item .progress-bar {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--tech-color), var(--tech-glow));
    box-shadow: 0 0 10px var(--tech-glow);
    transition: width 1s var(--transition-elastic);
    position: relative;
    overflow: hidden;
}

.tech-item:hover .progress-bar {
    width: var(--tech-level);
}

/* Efecto de brillo en la barra */
.tech-item .progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: progressShine 2s ease-in-out infinite;
}

/* =============================================
   INDICADOR DE NIVEL DE DOMINIO
   ============================================= */
.tech-item .level-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s ease;
}

.tech-item:hover .level-indicator {
    opacity: 1;
    transform: translateX(0);
}

.tech-item .level-dots {
    display: flex;
    gap: 3px;
}

.tech-item .level-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.tech-item:hover .level-dot.active {
    background: var(--tech-color);
    box-shadow: 0 0 5px var(--tech-glow);
    animation: dotPulse 1s ease-in-out infinite;
}

/* =============================================
   COLORES ESPECÍFICOS POR TECNOLOGÍA
   ============================================= */
.tech-item[data-tech="n8n"] {
    --tech-color: var(--n8n-color);
    --tech-glow: var(--n8n-glow);
    --tech-level: var(--n8n-level);
}

.tech-item[data-tech="nodejs"] {
    --tech-color: var(--nodejs-color);
    --tech-glow: var(--nodejs-glow);
    --tech-level: var(--nodejs-level);
}

.tech-item[data-tech="python"] {
    --tech-color: var(--python-color);
    --tech-glow: var(--python-glow);
    --tech-level: var(--python-level);
}

.tech-item[data-tech="openai"] {
    --tech-color: var(--openai-color);
    --tech-glow: var(--openai-glow);
    --tech-level: var(--openai-level);
}

.tech-item[data-tech="llama"] {
    --tech-color: var(--llama-color);
    --tech-glow: var(--llama-glow);
    --tech-level: var(--llama-level);
}

.tech-item[data-tech="gemini"] {
    --tech-color: var(--gemini-color);
    --tech-glow: var(--gemini-glow);
    --tech-level: var(--gemini-level);
}

.tech-item[data-tech="ollama"] {
    --tech-color: var(--ollama-color);
    --tech-glow: var(--ollama-glow);
    --tech-level: var(--ollama-level);
}

.tech-item[data-tech="evolution"] {
    --tech-color: var(--evolution-color);
    --tech-glow: var(--evolution-glow);
    --tech-level: var(--evolution-level);
}

.tech-item[data-tech="baileys"] {
    --tech-color: var(--baileys-color);
    --tech-glow: var(--baileys-glow);
    --tech-level: var(--baileys-level);
}

.tech-item[data-tech="mysql"] {
    --tech-color: var(--mysql-color);
    --tech-glow: var(--mysql-glow);
    --tech-level: var(--mysql-level);
}

.tech-item[data-tech="postgresql"] {
    --tech-color: var(--postgresql-color);
    --tech-glow: var(--postgresql-glow);
    --tech-level: var(--postgresql-level);
}

.tech-item[data-tech="docker"] {
    --tech-color: var(--docker-color);
    --tech-glow: var(--docker-glow);
    --tech-level: var(--docker-level);
}

/* =============================================
   KEYFRAMES - ANIMACIONES COMPLEJAS
   ============================================= */

/* Flotación de partículas */
@keyframes particleFloat {
    0%, 100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.4;
    }
    25% {
        transform: translate(10px, -10px) scale(1.1);
        opacity: 0.6;
    }
    50% {
        transform: translate(-5px, 5px) scale(0.9);
        opacity: 0.3;
    }
    75% {
        transform: translate(-10px, -5px) scale(1.05);
        opacity: 0.5;
    }
}

/* Rotación orbital */
@keyframes orbitRotate {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Brillo en barra de progreso */
@keyframes progressShine {
    0% {
        left: -100%;
    }
    50% {
        left: 100%;
    }
    100% {
        left: 100%;
    }
}

/* Pulsación de puntos de nivel */
@keyframes dotPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 5px var(--tech-glow);
    }
    50% {
        transform: scale(1.3);
        box-shadow: 0 0 15px var(--tech-glow);
    }
}

/* Entrada escalonada */
@keyframes staggerIn {
    0% {
        opacity: 0;
        transform: translateY(30px) rotateX(10deg) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translateY(0) rotateX(0) scale(1);
    }
}

/* Efecto neón pulsante */
@keyframes neonPulse {
    0%, 100% {
        box-shadow:
            0 0 20px var(--tech-glow),
            0 0 40px var(--tech-glow),
            0 0 60px var(--tech-glow);
    }
    50% {
        box-shadow:
            0 0 30px var(--tech-glow),
            0 0 60px var(--tech-glow),
            0 0 90px var(--tech-glow);
    }
}

/* Rotación 3D en hover */
@keyframes rotate3D {
    0% {
        transform: translateY(0) rotateX(0) rotateY(0) scale(1);
    }
    25% {
        transform: translateY(-5px) rotateX(5deg) rotateY(-5deg) scale(1.05);
    }
    50% {
        transform: translateY(-10px) rotateX(-5deg) rotateY(5deg) scale(1.08);
    }
    75% {
        transform: translateY(-5px) rotateX(3deg) rotateY(-3deg) scale(1.05);
    }
    100% {
        transform: translateY(0) rotateX(0) rotateY(0) scale(1);
    }
}

/* Campo magnético */
@keyframes magneticField {
    0%, 100% {
        border-color: rgba(255, 255, 255, 0.1);
    }
    50% {
        border-color: var(--tech-glow);
    }
}

/* Partículas emergentes */
@keyframes particleEmerge {
    0% {
        transform: scale(0) translateY(20px);
        opacity: 0;
    }
    50% {
        transform: scale(1.2) translateY(-5px);
        opacity: 1;
    }
    100% {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

/* =============================================
   EFECTOS ADICIONALES
   ============================================= */

/* Brillo de neón en tarjetas activas */
.tech-item.neon-effect {
    animation: neonPulse 2s ease-in-out infinite;
}

/* Efecto de onda expansiva al click */
.tech-item.click-wave::before {
    animation: waveExpand 0.6s ease-out;
}

@keyframes waveExpand {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(2);
        opacity: 0;
    }
}

/* Efecto de glitch aleatorio */
.tech-item.glitch-effect {
    animation: glitch 0.3s ease-in-out;
}

@keyframes glitch {
    0%, 100% {
        transform: translate(0);
    }
    20% {
        transform: translate(-2px, 2px);
    }
    40% {
        transform: translate(-2px, -2px);
    }
    60% {
        transform: translate(2px, 2px);
    }
    80% {
        transform: translate(2px, -2px);
    }
}

/* =============================================
   RESPONSIVE DESIGN
   ============================================= */

/* Tablet */
@media (max-width: 1024px) {
    .tech-stack-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 1.5rem;
    }

    .tech-item {
        padding: 1.5rem 1rem;
    }

    .tech-name {
        font-size: 1.1rem;
    }
}

/* Mobile Large */
@media (max-width: 768px) {
    .tech-stack-section {
        padding: 60px 0;
    }

    .tech-stack-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 1rem;
    }

    .tech-item {
        padding: 1.25rem 0.75rem;
        transform: translateY(20px);
    }

    .tech-item:hover {
        transform: translateY(-5px) scale(1.03);
    }

    .tech-name {
        font-size: 1rem;
    }

    .tech-item .level-indicator {
        display: none;
    }
}

/* Mobile Small */
@media (max-width: 480px) {
    .tech-stack-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .tech-item {
        padding: 1rem 0.5rem;
        border-radius: 15px;
    }

    .tech-item:hover {
        transform: translateY(-3px) scale(1.02);
    }

    .tech-name {
        font-size: 0.9rem;
    }

    .section-subtitle {
        font-size: 1rem;
    }
}

/* Reducir animaciones para usuarios con preferencia de movimiento reducido */
@media (prefers-reduced-motion: reduce) {
    .tech-item,
    .tech-item::before,
    .tech-item::after,
    .tech-item:hover {
        animation: none !important;
        transition: none !important;
        transform: none !important;
    }

    .tech-item {
        opacity: 1;
        transform: none;
    }
}

/* =============================================
   DARK MODE OPTIMIZATIONS
   ============================================= */
@media (prefers-color-scheme: dark) {
    .tech-item {
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.15);
    }

    .tech-item:hover {
        background: rgba(255, 255, 255, 0.08);
    }
}

/* =============================================
   HIGH CONTRAST MODE
   ============================================= */
@media (prefers-contrast: high) {
    .tech-item {
        border-width: 2px;
        border-color: rgba(255, 255, 255, 0.3);
    }

    .tech-name {
        font-weight: 800;
    }

    .tech-item .progress-bar {
        background: var(--tech-color);
    }
}

/* =============================================
   UTILIDADES
   ============================================= */

/* Clase para animación personalizada */
.tech-item.animate-custom {
    animation: rotate3D 0.6s ease-in-out;
}

/* Clase para efecto magnético activo */
.tech-item.magnetic-pull {
    transition: transform 0.1s ease-out;
}

/* Clase para efecto de brillo intensificado */
.tech-item.intense-glow {
    box-shadow:
        0 0 30px var(--tech-glow),
        0 0 60px var(--tech-glow),
        0 0 90px var(--tech-glow);
}

/* Cursor personalizado para tarjetas */
.tech-item {
    cursor: pointer;
}

.tech-item:active {
    transform: scale(0.98);
}

/* Focus states para accesibilidad */
.tech-item:focus {
    outline: 2px solid var(--tech-color);
    outline-offset: 4px;
}

.tech-item:focus:not(:focus-visible) {
    outline: none;
}

.tech-item:focus-visible {
    outline: 2px solid var(--tech-color);
    outline-offset: 4px;
}

/* =============================================
   EFECTOS DE FONDO ANIMADO
   ============================================= */

/* Partículas flotantes de fondo */
.tech-stack-section .background-particles {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.tech-stack-section .particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    animation: floatParticle 15s linear infinite;
}

@keyframes floatParticle {
    0% {
        transform: translateY(100vh) scale(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) scale(1);
        opacity: 0;
    }
}

/* Grid de fondo */
.tech-stack-section::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    opacity: 0.5;
    pointer-events: none;
    z-index: 0;
}

/* =============================================
   EFECTOS DE INTERFAZ AVANZADOS
   ============================================= */

/* Tooltip personalizado */
.tech-item .tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: rgba(0, 0, 0, 0.9);
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 100;
}

.tech-item:hover .tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-5px);
}

.tech-item .tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.9);
}

/* Badge de estado */
.tech-item .status-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.7);
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.3s ease;
}

.tech-item:hover .status-badge {
    opacity: 1;
    transform: scale(1);
}

.tech-item .status-badge .status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #4ade80;
    animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* =============================================
   ANIMACIONES DE CARGA
   ============================================= */

.tech-item.loading {
    pointer-events: none;
}

.tech-item.loading::before {
    animation: loadingPulse 1.5s ease-in-out infinite;
}

@keyframes loadingPulse {
    0%, 100% {
        opacity: 0.3;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(1.1);
    }
}

/* =============================================
   EFECTOS DE SELECCIÓN
   ============================================= */

.tech-item.selected {
    border-color: var(--tech-color);
    background: rgba(255, 255, 255, 0.08);
    box-shadow:
        0 0 30px var(--tech-glow),
        inset 0 0 30px rgba(255, 255, 255, 0.05);
}

.tech-item.selected .tech-name {
    color: var(--tech-color);
}

/* Marca de verificación */
.tech-item.selected::after {
    content: '✓';
    position: absolute;
    top: 10px;
    right: 10px;
    color: var(--tech-color);
    font-size: 1.2rem;
    font-weight: bold;
    animation: checkmark 0.3s ease-out;
}

@keyframes checkmark {
    0% {
        transform: scale(0) rotate(-180deg);
        opacity: 0;
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

/* =============================================
   HEADER DEL STACK
   ============================================= */
.tech-stack-header {
    text-align: center;
    margin-bottom: 60px;
    position: relative;
    z-index: 2;
}

.tech-title-animated {
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 20px;
    display: inline-block;
}

.title-letter {
    display: inline-block;
    transition: all 0.3s ease;
}

.tech-subtitle {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 40px;
}

/* Contador de experiencia */
.experience-counter {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.counter-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.counter-value {
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.counter-label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* =============================================
   FILTROS
   ============================================= */
.tech-filters {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 50px;
    flex-wrap: wrap;
    position: relative;
    z-index: 2;
}

.filter-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    color: #fff;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}

.filter-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.2);
}

.filter-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: transparent;
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
    transform: translateY(-2px);
}

.filter-icon {
    font-size: 1.2rem;
}

/* =============================================
   GRID DEL STACK
   ============================================= */
.tech-stack-grid {
    position: relative;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    z-index: 1;
    perspective: 1000px;
}

/* =============================================
   KEYFRAMES ADICIONALES
   ============================================= */
@keyframes rotateGlow {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes letterBounce {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.8);
    }
    50% {
        transform: translateY(-5px) scale(1.1);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes floatParticle {
    0%, 100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.4;
    }
    25% {
        transform: translate(10px, -10px) scale(1.1);
        opacity: 0.6;
    }
    50% {
        transform: translate(-5px, 5px) scale(0.9);
        opacity: 0.3;
    }
    75% {
        transform: translate(-10px, -5px) scale(1.05);
        opacity: 0.5;
    }
}
