/* ===================================
   Technical Skills Mobile Fix
   Optimización de Technical Skills para móvil
   =================================== */

/* ===== TECHNICAL SKILLS MÓVIL ===== */
@media (max-width: 768px) {
    /* Sección principal */
    .technical-skills,
    #technical-skills,
    .skills-section {
        padding: 40px 15px !important;
        margin: 30px 0 !important;
        background: rgba(0, 0, 0, 0.4) !important;
        border-radius: 16px !important;
        overflow: visible !important;
    }

    /* Título de la sección */
    .technical-skills h3,
    .skills-section h3,
    .section-subtitle {
        font-size: 1.5rem !important;
        text-align: center !important;
        margin-bottom: 25px !important;
        font-weight: 700 !important;
        background: linear-gradient(135deg, #8b5cf6, #a78bfa) !important;
        -webkit-background-clip: text !important;
        -webkit-text-fill-color: transparent !important;
    }

    /* Contenedor de logos principal */
    .skills-logos,
    .tech-logos-grid {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 20px !important;
        padding: 10px !important;
        width: 100% !important;
        max-width: 350px !important;
        margin: 0 auto !important;
    }

    /* Items de skills individuales */
    .skill-logo,
    .tech-logo-item {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 15px 10px !important;
        background: rgba(139, 92, 246, 0.05) !important;
        border: 1px solid rgba(139, 92, 246, 0.2) !important;
        border-radius: 12px !important;
        transition: all 0.3s ease !important;
        min-height: 90px !important;
        position: relative !important;
        cursor: pointer !important;
    }

    /* Hover effect móvil (tap) */
    .skill-logo:active,
    .tech-logo-item:active {
        background: rgba(139, 92, 246, 0.15) !important;
        border-color: var(--accent) !important;
        transform: scale(0.95) !important;
    }

    /* Imágenes/Iconos */
    .skill-logo img,
    .tech-logo-item img,
    .skill-icon {
        width: 35px !important;
        height: 35px !important;
        object-fit: contain !important;
        margin-bottom: 8px !important;
        filter: brightness(0.9) !important;
    }

    /* Iconos usando emoji o símbolos */
    .skill-logo::before,
    .tech-logo-item::before {
        font-size: 2rem !important;
        margin-bottom: 8px !important;
        display: block !important;
    }

    /* Labels de skills */
    .skill-logo span,
    .tech-logo-item span,
    .skill-name {
        font-size: 0.7rem !important;
        text-align: center !important;
        color: var(--text-secondary) !important;
        font-weight: 500 !important;
        text-transform: capitalize !important;
        line-height: 1.2 !important;
    }

    /* Categorías de skills */
    .skills-category {
        margin-bottom: 30px !important;
    }

    .skills-category-title {
        font-size: 1.1rem !important;
        font-weight: 600 !important;
        color: var(--accent) !important;
        margin-bottom: 15px !important;
        text-align: center !important;
        padding-bottom: 10px !important;
        border-bottom: 1px solid rgba(139, 92, 246, 0.2) !important;
    }

    /* Grid alternativo para más items */
    .skills-logos.many-items {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 15px !important;
    }

    .skills-logos.many-items .skill-logo {
        padding: 12px 5px !important;
        min-height: 80px !important;
    }

    .skills-logos.many-items .skill-logo img {
        width: 30px !important;
        height: 30px !important;
    }

    .skills-logos.many-items .skill-logo span {
        font-size: 0.65rem !important;
    }

    /* Progress bars móvil */
    .skill-with-progress {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        margin-bottom: 20px !important;
    }

    .skill-header {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        margin-bottom: 8px !important;
    }

    .skill-progress-name {
        font-size: 0.9rem !important;
        font-weight: 600 !important;
        color: var(--text-primary) !important;
    }

    .skill-percentage {
        font-size: 0.85rem !important;
        color: var(--accent) !important;
        font-weight: 500 !important;
    }

    .skill-progress-bar {
        width: 100% !important;
        height: 8px !important;
        background: rgba(255, 255, 255, 0.1) !important;
        border-radius: 10px !important;
        overflow: hidden !important;
    }

    .skill-progress-fill {
        height: 100% !important;
        background: linear-gradient(90deg, var(--accent), #a78bfa) !important;
        border-radius: 10px !important;
        transition: width 1s ease !important;
        position: relative !important;
        overflow: hidden !important;
    }

    /* Animación de brillo */
    .skill-progress-fill::after {
        content: '' !important;
        position: absolute !important;
        top: 0 !important;
        left: -100% !important;
        width: 100% !important;
        height: 100% !important;
        background: linear-gradient(
            90deg,
            transparent,
            rgba(255, 255, 255, 0.3),
            transparent
        ) !important;
        animation: shimmer 2s infinite !important;
    }

    @keyframes shimmer {
        to {
            left: 100%;
        }
    }

    /* Tags de skills móvil */
    .skills-tags,
    .tech-tags {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
        justify-content: center !important;
        margin-top: 20px !important;
    }

    .skill-tag,
    .tech-tag {
        padding: 6px 12px !important;
        background: rgba(139, 92, 246, 0.1) !important;
        border: 1px solid rgba(139, 92, 246, 0.3) !important;
        border-radius: 20px !important;
        font-size: 0.75rem !important;
        color: var(--text-primary) !important;
        font-weight: 500 !important;
        transition: all 0.3s ease !important;
    }

    .skill-tag:active,
    .tech-tag:active {
        background: rgba(139, 92, 246, 0.2) !important;
        transform: scale(0.95) !important;
    }

    /* Lista de skills móvil */
    .skills-list {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 15px !important;
        margin-top: 20px !important;
    }

    .skill-list-item {
        display: flex !important;
        align-items: center !important;
        gap: 15px !important;
        padding: 15px !important;
        background: rgba(0, 0, 0, 0.3) !important;
        border-radius: 10px !important;
        border-left: 3px solid var(--accent) !important;
    }

    .skill-list-icon {
        width: 40px !important;
        height: 40px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        background: rgba(139, 92, 246, 0.1) !important;
        border-radius: 8px !important;
        font-size: 1.2rem !important;
    }

    .skill-list-content {
        flex: 1 !important;
    }

    .skill-list-title {
        font-size: 0.95rem !important;
        font-weight: 600 !important;
        color: var(--text-primary) !important;
        margin-bottom: 3px !important;
    }

    .skill-list-description {
        font-size: 0.8rem !important;
        color: var(--text-secondary) !important;
        line-height: 1.4 !important;
    }

    /* Versión compacta para muchos skills */
    .skills-compact {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }

    .skill-compact-item {
        display: flex !important;
        align-items: center !important;
        gap: 10px !important;
        padding: 10px !important;
        background: rgba(139, 92, 246, 0.05) !important;
        border-radius: 8px !important;
        font-size: 0.85rem !important;
    }

    .skill-compact-icon {
        width: 25px !important;
        height: 25px !important;
    }

    /* Animación de entrada */
    @keyframes fadeInUp {
        from {
            opacity: 0;
            transform: translateY(20px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .skill-logo,
    .tech-logo-item {
        animation: fadeInUp 0.5s ease !important;
        animation-fill-mode: both !important;
    }

    .skill-logo:nth-child(1) { animation-delay: 0.05s !important; }
    .skill-logo:nth-child(2) { animation-delay: 0.1s !important; }
    .skill-logo:nth-child(3) { animation-delay: 0.15s !important; }
    .skill-logo:nth-child(4) { animation-delay: 0.2s !important; }
    .skill-logo:nth-child(5) { animation-delay: 0.25s !important; }
    .skill-logo:nth-child(6) { animation-delay: 0.3s !important; }
    .skill-logo:nth-child(7) { animation-delay: 0.35s !important; }
    .skill-logo:nth-child(8) { animation-delay: 0.4s !important; }
    .skill-logo:nth-child(9) { animation-delay: 0.45s !important; }

    /* Tooltip móvil */
    .skill-tooltip {
        position: absolute !important;
        bottom: 100% !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        background: rgba(0, 0, 0, 0.9) !important;
        color: white !important;
        padding: 8px 12px !important;
        border-radius: 8px !important;
        font-size: 0.75rem !important;
        white-space: nowrap !important;
        pointer-events: none !important;
        opacity: 0 !important;
        transition: opacity 0.3s ease !important;
        margin-bottom: 5px !important;
        z-index: 10 !important;
    }

    .skill-logo:active .skill-tooltip {
        opacity: 1 !important;
    }

    /* Fix para overflow */
    .technical-skills {
        overflow-x: hidden !important;
        overflow-y: visible !important;
    }

    /* Asegurar que no se corten los elementos */
    .skills-container {
        width: 100% !important;
        overflow: visible !important;
    }
}

/* ===== LANDSCAPE MÓVIL ===== */
@media (max-width: 768px) and (orientation: landscape) {
    .skills-logos {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 15px !important;
        max-width: 500px !important;
    }

    .skill-logo {
        min-height: 70px !important;
        padding: 10px 5px !important;
    }

    .skill-logo img {
        width: 30px !important;
        height: 30px !important;
        margin-bottom: 5px !important;
    }

    .skill-logo span {
        font-size: 0.65rem !important;
    }

    .technical-skills {
        padding: 30px 20px !important;
    }
}

/* ===== PANTALLAS MUY PEQUEÑAS (< 360px) ===== */
@media (max-width: 360px) {
    .skills-logos {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px !important;
    }

    .skill-logo {
        min-height: 85px !important;
    }

    .technical-skills h3 {
        font-size: 1.3rem !important;
    }

    .skills-tags {
        gap: 6px !important;
    }

    .skill-tag {
        padding: 5px 10px !important;
        font-size: 0.7rem !important;
    }
}

/* ===== TEMA CLARO MÓVIL ===== */
@media (max-width: 768px) {
    [data-theme="light"] .technical-skills {
        background: rgba(255, 255, 255, 0.9) !important;
    }

    [data-theme="light"] .skill-logo {
        background: rgba(139, 92, 246, 0.05) !important;
        border-color: rgba(139, 92, 246, 0.3) !important;
    }

    [data-theme="light"] .skill-logo:active {
        background: rgba(139, 92, 246, 0.1) !important;
    }

    [data-theme="light"] .skill-logo span {
        color: #4a4a5e !important;
    }

    [data-theme="light"] .skill-progress-bar {
        background: rgba(0, 0, 0, 0.1) !important;
    }
}