/* ===================================
   About Section Profile & Layout Fix
   Arregla la foto de perfil, iOS Apps y añade animaciones
   =================================== */

/* ===== FOTO DE PERFIL FIX ===== */

/* Contenedor de la foto de perfil */
.profile-container,
.about-profile {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    margin: 30px auto !important;
    padding: 20px !important;
    animation: fadeInDown 0.8s ease-out !important;
}

/* Foto de perfil */
.profile-pic,
.profile-image,
.about-image img[alt*="Emilio"],
.about-image img[alt*="profile"] {
    width: 200px !important;
    height: 200px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    object-position: center !important;
    border: 4px solid var(--accent) !important;
    box-shadow: 0 10px 40px rgba(139, 92, 246, 0.3) !important;
    transition: all 0.3s ease !important;
    display: block !important;
    margin: 0 auto !important;
}

.profile-pic:hover,
.profile-image:hover {
    transform: scale(1.05) rotate(5deg) !important;
    box-shadow: 0 15px 50px rgba(139, 92, 246, 0.5) !important;
    border-width: 5px !important;
}

/* ===== iOS APPS SECTION FIX ===== */

/* Contenedor principal de apps */
.ios-apps-section,
.apps-showcase,
.projects-grid {
    width: 100% !important;
    max-width: 1400px !important;
    margin: 0 auto !important;
    padding: 40px 20px !important;
    overflow: visible !important; /* Permitir que el contenido sea visible */
}

/* Grid de apps */
.apps-grid,
.ios-apps-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)) !important;
    gap: 30px !important;
    padding: 20px !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* Cards de apps individuales */
.app-card,
.ios-app-card,
.project-card {
    background: rgba(0, 0, 0, 0.5) !important;
    border-radius: 16px !important;
    padding: 25px !important;
    border: 1px solid rgba(139, 92, 246, 0.2) !important;
    transition: all 0.3s ease !important;
    overflow: hidden !important;
    height: auto !important;
    min-height: 350px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
}

.app-card:hover,
.ios-app-card:hover {
    transform: translateY(-10px) !important;
    box-shadow: 0 20px 50px rgba(139, 92, 246, 0.3) !important;
    border-color: var(--accent) !important;
}

/* App icons */
.app-icon,
.project-icon {
    width: 80px !important;
    height: 80px !important;
    margin: 0 auto 20px !important;
    border-radius: 18px !important;
    object-fit: cover !important;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3) !important;
}

/* App titles */
.app-title,
.project-title {
    font-size: 1.4rem !important;
    font-weight: 600 !important;
    margin-bottom: 10px !important;
    color: var(--text-primary) !important;
}

/* App descriptions */
.app-description,
.project-description {
    font-size: 0.95rem !important;
    line-height: 1.6 !important;
    color: var(--text-secondary) !important;
    margin-bottom: 20px !important;
    flex-grow: 1 !important;
}

/* Tech stack tags */
.tech-stack,
.app-tags {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    margin-top: auto !important;
}

.tech-tag,
.app-tag {
    padding: 5px 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.8rem !important;
    color: var(--accent) !important;
    transition: all 0.2s ease !important;
}

.tech-tag:hover,
.app-tag:hover {
    background: rgba(139, 92, 246, 0.2) !important;
    transform: scale(1.05) !important;
}

/* ===== ANIMACIONES DE DESPLAZAMIENTO ===== */

/* Animación de entrada desde arriba */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Animación de entrada con escala */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Animación de deslizamiento lateral */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Aplicar animaciones a elementos */
.about-header,
.section-title {
    animation: fadeInDown 0.8s ease-out !important;
}

.about-content {
    animation: fadeInUp 1s ease-out !important;
    animation-delay: 0.2s !important;
    animation-fill-mode: both !important;
}

.bio-section,
.about-description {
    animation: slideInLeft 0.8s ease-out !important;
    animation-delay: 0.3s !important;
    animation-fill-mode: both !important;
}

.skills-container {
    animation: slideInRight 0.8s ease-out !important;
    animation-delay: 0.4s !important;
    animation-fill-mode: both !important;
}

/* Animación escalonada para apps/projects */
.app-card:nth-child(1),
.project-card:nth-child(1) {
    animation: scaleIn 0.6s ease-out !important;
    animation-delay: 0.1s !important;
    animation-fill-mode: both !important;
}

.app-card:nth-child(2),
.project-card:nth-child(2) {
    animation: scaleIn 0.6s ease-out !important;
    animation-delay: 0.2s !important;
    animation-fill-mode: both !important;
}

.app-card:nth-child(3),
.project-card:nth-child(3) {
    animation: scaleIn 0.6s ease-out !important;
    animation-delay: 0.3s !important;
    animation-fill-mode: both !important;
}

.app-card:nth-child(4),
.project-card:nth-child(4) {
    animation: scaleIn 0.6s ease-out !important;
    animation-delay: 0.4s !important;
    animation-fill-mode: both !important;
}

/* ===== SCROLL-TRIGGERED ANIMATIONS ===== */

/* Clase para elementos que aparecen al hacer scroll */
.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

.scroll-reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* ===== AJUSTES DE LAYOUT ===== */

/* Sección About completa */
.unified-about-section {
    padding: 60px 40px !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
    overflow-y: visible !important;
}

/* Grid principal */
.about-grid {
    display: grid !important;
    grid-template-columns: 1fr 2fr !important;
    gap: 40px !important;
    align-items: start !important;
    max-width: 1400px !important;
    margin: 0 auto !important;
}

/* Columna izquierda - Perfil */
.about-left {
    position: sticky !important;
    top: 100px !important;
    animation: slideInLeft 0.8s ease-out !important;
}

/* Columna derecha - Contenido */
.about-right {
    animation: slideInRight 0.8s ease-out !important;
}

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

@media (max-width: 968px) {
    /* Grid responsive */
    .about-grid {
        grid-template-columns: 1fr !important;
        gap: 30px !important;
    }

    .about-left {
        position: relative !important;
        top: 0 !important;
    }

    /* Foto de perfil más pequeña en tablet */
    .profile-pic,
    .profile-image {
        width: 150px !important;
        height: 150px !important;
    }

    /* Grid de apps */
    .apps-grid,
    .ios-apps-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)) !important;
        gap: 20px !important;
    }
}

@media (max-width: 768px) {
    /* Foto de perfil móvil */
    .profile-pic,
    .profile-image {
        width: 120px !important;
        height: 120px !important;
    }

    /* Sección About móvil */
    .unified-about-section {
        padding: 40px 20px !important;
    }

    /* Grid de apps móvil */
    .apps-grid,
    .ios-apps-grid {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
        padding: 10px !important;
    }

    /* Cards más compactas */
    .app-card,
    .ios-app-card {
        min-height: 280px !important;
        padding: 20px !important;
    }

    /* App icons más pequeños */
    .app-icon {
        width: 60px !important;
        height: 60px !important;
    }

    /* Animaciones más sutiles en móvil */
    @keyframes fadeInDown {
        from {
            opacity: 0;
            transform: translateY(-15px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

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

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

/* Parallax effect suave */
.parallax-element {
    transition: transform 0.3s ease-out;
}

/* Glow effect para elementos destacados */
.featured-app {
    position: relative;
}

.featured-app::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(45deg, var(--accent), #a78bfa, var(--accent));
    border-radius: inherit;
    opacity: 0.3;
    z-index: -1;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.3;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.02);
    }
}

/* ===== THEME ADJUSTMENTS ===== */

[data-theme="light"] .app-card,
[data-theme="light"] .ios-app-card {
    background: rgba(255, 255, 255, 0.9) !important;
    border-color: rgba(139, 92, 246, 0.3) !important;
}

[data-theme="light"] .profile-pic,
[data-theme="light"] .profile-image {
    border-color: var(--accent) !important;
    box-shadow: 0 10px 40px rgba(139, 92, 246, 0.2) !important;
}