/* ============================================== */
/* SECCIÓN HERRAMIENTAS - ESTILO ESPACIAL MEJORADO */
/* ============================================== */

.tools-section {
    margin-top: 60px;
    padding: 3rem 0 3.5rem 0;
    border-top: 1px solid #30363d;
    position: relative;
    overflow: hidden;
}

/* Fondo de estrellas animadas */
.tools-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(2px 2px at 15px 25px, #58a6ff, transparent),
        radial-gradient(2px 2px at 75px 60px, #8957e5, transparent),
        radial-gradient(1px 1px at 130px 35px, #b15bff, transparent),
        radial-gradient(2px 2px at 200px 90px, #3b82f6, transparent),
        radial-gradient(1px 1px at 280px 45px, #8b5cf6, transparent),
        radial-gradient(2px 2px at 350px 110px, #58a6ff, transparent),
        radial-gradient(1px 1px at 420px 30px, #8957e5, transparent),
        radial-gradient(2px 2px at 500px 80px, #b15bff, transparent),
        radial-gradient(1px 1px at 580px 50px, #3b82f6, transparent),
        radial-gradient(2px 2px at 650px 120px, #8b5cf6, transparent),
        radial-gradient(1px 1px at 730px 40px, #58a6ff, transparent),
        radial-gradient(2px 2px at 810px 95px, #8957e5, transparent),
        radial-gradient(1px 1px at 880px 55px, #b15bff, transparent);
    background-size: 900px 200px;
    background-repeat: repeat;
    opacity: 0.25;
    pointer-events: none;
    animation: twinkle 4s ease-in-out infinite alternate;
}

/* Nebulosa sutil en el fondo */
.tools-section::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(
        ellipse at 30% 40%,
        rgba(88, 166, 255, 0.04) 0%,
        transparent 50%
    ),
    radial-gradient(
        ellipse at 70% 60%,
        rgba(137, 87, 229, 0.04) 0%,
        transparent 50%
    );
    pointer-events: none;
}

/* Animación de parpadeo estelar */
@keyframes twinkle {
    0% { opacity: 0.15; }
    50% { opacity: 0.35; }
    100% { opacity: 0.15; }
}

/* Título de la sección con efecto gradiente */
.tools-section h2 {
    font-size: 2rem;
    margin-bottom: 40px;
    color: #e6edf3;
    text-align: center;
    position: relative;
    display: inline-block;
    left: 50%;
    transform: translateX(-50%);
    padding-bottom: 12px;
    text-shadow: 0 0 20px rgba(88, 166, 255, 0.4);
    letter-spacing: 1px;
}

/* Línea decorativa animada bajo el título */
.tools-section h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 20%;
    width: 60%;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent, 
        #58a6ff, 
        #8957e5, 
        #b15bff, 
        #8957e5, 
        #58a6ff, 
        transparent
    );
    background-size: 200% 100%;
    animation: shimmer 3s linear infinite;
    border-radius: 2px;
}

/* Animación de brillo para la línea */
@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ============================================== */
/* GRID DE HERRAMIENTAS                           */
/* ============================================== */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
    margin-top: 20px;
    padding: 15px 10px;
    position: relative;
    z-index: 2;
}

/* ============================================== */
/* TARJETAS - ESTILO ESPACIAL MEJORADO            */
/* ============================================== */
.tool-card {
    background: linear-gradient(145deg, 
        rgba(22, 27, 34, 0.95), 
        rgba(13, 17, 23, 0.98)
    );
    border: 1px solid rgba(88, 166, 255, 0.15);
    border-radius: 16px;
    padding: 28px 18px;
    text-align: center;
    
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    
    /* Efecto de vidrio */
    backdrop-filter: blur(8px);
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 0 0 1px rgba(88, 166, 255, 0.08);
    
    /* Animación de flotación con delay individual */
    animation: orbital-float 3.5s ease-in-out infinite;
    animation-delay: var(--delay, 0s);
    
    /* Transición suave */
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    
    will-change: transform, box-shadow, border-color;
    position: relative;
    overflow: hidden;
}

/* Delays individuales para efecto de ola */
.tool-card:nth-child(1) { --delay: 0s; }
.tool-card:nth-child(2) { --delay: 0.4s; }
.tool-card:nth-child(3) { --delay: 0.8s; }
.tool-card:nth-child(4) { --delay: 1.2s; }

/* Brillo en borde superior */
.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 10%;
    width: 80%;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(88, 166, 255, 0.6), 
        rgba(137, 87, 229, 0.6), 
        rgba(88, 166, 255, 0.6), 
        transparent
    );
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

/* Brillo interno en hover */
.tool-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(
        circle at 50% 0%,
        rgba(88, 166, 255, 0.1),
        transparent 70%
    );
    border-radius: 16px;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

/* Hover - Activación completa */
.tool-card:hover {
    transform: scale(1.05) translateY(-8px);
    border-color: #58a6ff;
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.7),
        0 0 30px rgba(88, 166, 255, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 0 0 1px #58a6ff;
    animation-play-state: paused;
}

.tool-card:hover::before {
    opacity: 1;
    animation: border-shine 2s linear infinite;
}

.tool-card:hover::after {
    opacity: 1;
}

/* Animación de brillo en borde */
@keyframes border-shine {
    0%, 100% {
        background: linear-gradient(90deg, 
            transparent, 
            rgba(88, 166, 255, 0.8), 
            rgba(137, 87, 229, 0.8), 
            rgba(88, 166, 255, 0.8), 
            transparent
        );
    }
    50% {
        background: linear-gradient(90deg, 
            transparent, 
            rgba(177, 91, 255, 0.8), 
            rgba(59, 130, 246, 0.8), 
            rgba(177, 91, 255, 0.8), 
            transparent
        );
    }
}

/* Animación de flotación orbital */
@keyframes orbital-float {
    0% {
        transform: translateY(0px);
    }
    30% {
        transform: translateY(-6px);
    }
    50% {
        transform: translateY(-10px);
    }
    70% {
        transform: translateY(-6px);
    }
    100% {
        transform: translateY(0px);
    }
}

/* ============================================== */
/* IMAGEN DE HERRAMIENTA                          */
/* ============================================== */
.tool-card img {
    width: 65px;
    height: 65px;
    object-fit: contain;
    filter: drop-shadow(0 0 12px rgba(88, 166, 255, 0.3));
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
}

.tool-card:hover img {
    transform: scale(1.1);
    filter: drop-shadow(0 0 20px rgba(88, 166, 255, 0.6));
}

/* ============================================== */
/* TÍTULO DE HERRAMIENTA                          */
/* ============================================== */
.tool-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    background: linear-gradient(135deg, #e6edf3 0%, #b0c4de 100%);
    background-size: 200% 200%;
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    transition: all 0.3s ease;
    letter-spacing: 0.3px;
}

.tool-card:hover h3 {
    background: linear-gradient(135deg, #58a6ff 0%, #b15bff 100%);
    background-size: 200% 200%;
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    text-shadow: 0 0 15px rgba(88, 166, 255, 0.4);
}

/* ============================================== */
/* DESCRIPCIÓN                                    */
/* ============================================== */
.tool-card p {
    font-size: 0.85rem;
    color: #8b949e;
    margin: 0;
    line-height: 1.5;
    transition: color 0.3s ease;
}

.tool-card:hover p {
    color: #c9d1d9;
}

/* ============================================== */
/* EFECTO DE CONSTELACIÓN EN HOVER GRUPAL         */
/* ============================================== */
.tools-grid:hover .tool-card:not(:hover) {
    opacity: 0.75;
    transform: scale(0.98);
    filter: blur(0.3px);
    transition: all 0.3s ease;
}

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

/* Tablets */
@media (max-width: 900px) {
    .tools-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .tools-section h2 {
        font-size: 1.8rem;
    }
    
    .tool-card {
        padding: 22px 15px;
    }
    
    .tool-card img {
        width: 55px;
        height: 55px;
    }
    
    .tool-card h3 {
        font-size: 1.15rem;
    }
}

/* Móviles */
@media (max-width: 600px) {
    .tools-section {
        margin-top: 40px;
        padding: 2rem 0 2.5rem 0;
    }
    
    .tools-section h2 {
        font-size: 1.5rem;
        margin-bottom: 25px;
    }
    
    .tools-grid {
        grid-template-columns: 1fr;
        gap: 18px;
        max-width: 320px;
        margin-left: auto;
        margin-right: auto;
    }
    
    .tool-card {
        padding: 20px 15px;
        width: 100%;
    }
    
    .tool-card img {
        width: 50px;
        height: 50px;
    }
    
    .tool-card h3 {
        font-size: 1.1rem;
    }
    
    .tool-card p {
        font-size: 0.8rem;
    }
    
    /* Ajustar animación para móviles */
    @keyframes orbital-float {
        0% { transform: translateY(0px); }
        50% { transform: translateY(-6px); }
        100% { transform: translateY(0px); }
    }
}

/* Pantallas muy pequeñas */
@media (max-width: 400px) {
    .tools-section h2 {
        font-size: 1.3rem;
    }
    
    .tool-card {
        padding: 18px 12px;
    }
}

/* ============================================== */
/* ACCESIBILIDAD - REDUCCIÓN DE MOVIMIENTO        */
/* ============================================== */
@media (prefers-reduced-motion: reduce) {
    .tool-card,
    .tools-section::before,
    .tools-section h2::after,
    .tool-card::before {
        animation: none;
        transition: none;
    }
    
    .tool-card:hover {
        transform: scale(1.02);
    }
}