:root {
    /* Paleta de colores inspirada en DevFit90 */
    --background-dark: #0a0a0a;
    --background-gradient: linear-gradient(135deg, #161628 0%, #040b1f 50%, #000000 100%);
    --card-bg-light: #1a1a2e;
    --card-bg-gradient: linear-gradient(135deg, #2a2a3e 0%, #1e1e2f 100%);
    
    /* Gradientes principales inspirados en DevFit90 */
    --primary-gradient: linear-gradient(135deg, #ffffff 0%, #ffffff 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --accent-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --success-gradient: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    --warning-gradient: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    
    /* Colores de texto */
    --text-primary: #000000; /* Asegúrate de que esto no afecte a los emojis de imagen si no son transparentes */
    --text-secondary: #b0b0b0;
    --text-accent: #00f2fe;
    
    /* Efectos y sombras */
    --shadow-primary: 0 10px 30px rgba(133, 152, 235, 0.3);
    --shadow-secondary: 0 10px 30px rgba(245, 87, 108, 0.3);
    --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 20px rgba(102, 126, 234, 0.5);
    
    /* Bordes */
    --border-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --border-subtle: #2a2a3e;
    
    /* Colores específicos */
    --whatsapp-green: #25D366;
    --whatsapp-green-hover: #1ebd5a;
}

/* Base global */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--background-dark);
    background-image: var(--background-gradient);
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 20%, rgba(102, 126, 234, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(245, 87, 108, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 60%, rgba(0, 242, 254, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Encabezado */
header {
    text-align: center;
    padding: 4rem 1rem 3rem;
    position: relative;
    overflow: hidden;
    margin-bottom: 3rem;
}

header::before {
    content: '';
    position: absolute;
    top: -100%;
    left: -100%;
    width: 300%;
    height: 300%;
    z-index: -1;
    animation: pulse 20s infinite alternate;
}

@keyframes pulse {
    0% { transform: scale(1) rotate(0deg); opacity: 0.3; }
    100% { transform: scale(1.3) rotate(10deg); opacity: 0.1; }
}

.intro {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
}

.profile-pic {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    object-fit: cover;
    border: 0.5px solid transparent;
    background: var(--primary-gradient);
    padding: 3px;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-primary);
    transition: all 0.4s ease;
    position: relative;
}

.profile-pic:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-glow);
}

.profile-pic::before {
    content: '';
    position: absolute;
    inset: -3px;
    background: var(--primary-gradient);
    border-radius: 50%;
    z-index: -1;
    animation: rotate 4s linear infinite;
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* --- AJUSTE PARA EL EMOJI --- */
.emoji-img {
    height: 1.5em; /* Buen tamaño para el emoji */
    width: auto;
    vertical-align: -0.15em; /* Ajuste para subir el emoji. Puedes probar con valores como -0.1em, -2px, -3px */
    margin-left: 8px; /* Mantén el espacio entre el texto y el emoji */
    display: inline-block;
}

header h2 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
    text-shadow: 0 0 30px rgba(102, 126, 234, 0.5);
}

header h3 {
    font-size: 1.3rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 32px;
    border-radius: 50px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.4s ease;
    margin: 0.5rem;
    font-size: 1rem;
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 1px;
}

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

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: #1a1a2e;
    color: white;
    border: none;
    box-shadow: var(--shadow-primary);
}

.btn-primary:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.4);
}

/* Enlaces sociales */
.social-links {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 2rem;
    padding-top: 2rem;
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--card-bg-gradient);
    color: #ffffff;
    transition: all 0.4s ease;
    font-size: 20px;
    text-decoration: none;
    border: 1px solid var(--border-subtle);
    position: relative;
    overflow: hidden;
}

.social-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #161628;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.social-btn:hover::before {
    opacity: 1;
}

.social-btn:hover {
    color: white;
    transform: translateY(-5px) scale(1.1);
    box-shadow: var(--shadow-primary);
}

.social-btn i {
    position: relative;
    z-index: 1;
}

/* Secciones */
section {
    padding: 0.1rem 0;
    position: relative;
}

.section-title {
    font-size: 2.8rem;
    margin-bottom: 3rem;
    position: relative;
    display: block;
    text-align: center;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: var(--primary-gradient);
    border-radius: 2px;
}

/* Tarjetas (Cards) */
.card {
    background: #1a1a2e;
    border-radius: 20px;
    padding: 2.5rem;
    margin-bottom: 2rem;
    transition: all 0.4s ease;
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-card);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(245, 87, 108, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.card:hover::before {
    opacity: 1;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border-color: rgba(102, 126, 234, 0.5);
}

.card h3 {
    font-size: 1.6rem;
    margin-bottom: 1rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 600;
    position: relative;
    z-index: 1;
}

.card p {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.7;
    position: relative;
    z-index: 1;
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 1.5rem;
    position: relative;
    z-index: 1;
}

.tech-item {
    background: #1a1a2e;
    color: white;
    padding: 8px 16px;
    border-radius: 25px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
}

.tech-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.project-link {
    display: inline-block;
    margin-top: 1.5rem;
    padding: 12px 24px;
    background: #25D366; /* Corregido de #43e97b a var(--whatsapp-green) si es para consistencia */
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.4s ease;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 8px 25px rgba(67, 233, 123, 0.3);
    position: relative;
    z-index: 1;
}

.project-link:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(67, 233, 123, 0.4);
}

/* Carrusel de Certificaciones */
.cert-carousel {
    overflow: hidden;
    width: 100%;
    margin-top: 2rem;
    position: relative;
    padding: 15px 0;
}

.cert-track {
    display: flex;
    gap: 20px;
    animation: scroll-certs 25s linear infinite;
    width: max-content;
    padding-bottom: 10px;
}

.cert-thumb {
    height: 250px;
    border-radius: 15px;
    cursor: pointer;
    box-shadow: var(--shadow-card);
    transition: all 0.4s ease;
    border: 2px solid transparent;
    background: var(--card-bg-gradient);
    padding: 2px;
}

.cert-thumb:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-primary);
    border-color: rgba(102, 126, 234, 0.5);
}

@keyframes scroll-certs {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    padding-top: 60px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
}

.modal-content {
    display: block;
    margin: auto;
    max-width: 90%;
    max-height: 85%;
    border-radius: 15px;
    box-shadow: var(--shadow-primary);
}

.close {
    position: absolute;
    top: 25px;
    right: 35px;
    color: #fff;
    font-size: 3rem;
    font-weight: normal;
    cursor: pointer;
    transition: all 0.3s ease;
}

.close:hover {
    color: var(--text-accent);
    transform: rotate(90deg) scale(1.2);
}

/* Sección de Contacto */
#contact {
    margin-top: 3rem;
    padding-top: 3rem;
    border-top: 1px solid var(--border-subtle);
    position: relative; /* ¡Añadido! Crea un nuevo contexto de apilamiento */
    z-index: 1; /* ¡Añadido! Asegura que la sección esté por encima de fondos con z-index: -1 */
}

#contact .card {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 10;
    text-align: center;
}

.contact-info {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.1rem;
    color: var(--text-secondary);
    padding: 15px 25px;
    border-radius: 15px;
    transition: all 0.3s ease;
    border: 1px solid var(--border-subtle);
    position: relative; /* ¡Añadido! Necesario para que z-index funcione */
    z-index: 2; /* ¡Añadido! Asegura que sea clicable */
}

.contact-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-card);
}

.contact-item a {
    color: var(--text-accent);
    text-decoration: none;
    transition: color 0.3s ease;
    /* Los enlaces dentro del item ya tienen z-index por su padre si este tiene z-index,
       pero si el problema persiste específicamente en el texto del enlace,
       podrías añadir aquí: position: relative; z-index: 3; */
}

.contact-item a:hover {
    color: #ffffff;
}

.contact-icon {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.3rem;
}

/* Botón de WhatsApp */
.whatsapp-button {
    display: inline-flex;
    align-items: center;
    gap: 15px;
    padding: 20px 40px;
    background: var(--whatsapp-green);
    color: white !important;
    text-decoration: none;
    border-radius: 20px;
    font-weight: 600;
    transition: all 0.4s ease;
    font-size: 2rem;
    box-shadow: 0 8px 25px rgb(36, 208, 99);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative; /* ¡Añadido! Necesario para que z-index funcione */
    z-index: 2; /* ¡Añadido! Asegura que sea clicable */
}

.whatsapp-button:hover {
    background-color: var(--whatsapp-green-hover);
    transform: translateY(-4px);
    box-shadow: 0 12px 35px rgba(37, 211, 102, 0.4);
}

/* Responsive Dashboards */
.dashboard-responsive {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    margin-top: 2rem;
    border-radius: 15px;
    border: 2px solid var(--border-subtle);
    box-shadow: var(--shadow-card);
}

.dashboard-responsive iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Centrado general para tarjetas de proyectos */
.card.centered {
    text-align: center;
}

.card.centered .tech-stack {
    justify-content: center;
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
    border-top: 1px solid var(--border-subtle);
    margin-top: 3rem;
}

/* Media Queries para adaptabilidad */
@media (max-width: 768px) {
    header {
        padding: 3rem 1rem 2rem;
    }

    header h2 {
        font-size: 2.5rem;
    }

    header h3 {
        font-size: 1.1rem;
    }

    .profile-pic {
        width: 140px;
        height: 140px;
    }

    .social-links {
        padding-top: 1.5rem;
        margin-bottom: 2rem;
    }

    .section-title {
        font-size: 2rem;
        margin-bottom: 2rem;
    }

    .card {
        padding: 2rem;
        margin-bottom: 1.5rem;
    }

    .card h3 {
        font-size: 1.3rem;
    }

    .cert-thumb {
        height: 200px;
    }

    .modal-content {
        max-width: 95%;
        max-height: 80%;
    }

    .close {
        font-size: 2.5rem;
        top: 20px;
        right: 20px;
    }

    #contact {
        margin-top: 2rem;
        padding-top: 2rem;
    }

    .contact-item {
        font-size: 1rem;
    }

    .contact-icon {
        font-size: 1.1rem;
    }

    footer {
        padding: 1.5rem 0;
        margin-top: 2.5rem;
    }
}

@media (max-width: 480px) {
    header {
        padding: 2.5rem 1rem 1.5rem;
    }

    header h2 {
        font-size: 2rem;
    }

    header h3 {
        font-size: 1rem;
    }

    .profile-pic {
        width: 120px;
        height: 120px;
    }

    .social-links {
        gap: 10px;
        padding-top: 1rem;
        margin-bottom: 1.5rem;
    }

    .social-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }

    .section-title {
        font-size: 1.8rem;
        margin-bottom: 1.5rem;
    }

    .card {
        padding: 1.5rem;
        margin-bottom: 1rem;
    }

    .card h3 {
        font-size: 1.2rem;
    }

    .tech-item {
        font-size: 0.7rem;
        padding: 6px 12px;
    }

    .project-link {
        padding: 10px 20px;
        font-size: 0.8rem;
    }

    .contact-item {
        font-size: 0.9rem;
        padding: 12px 20px;
    }

    .whatsapp-button {
        padding: 15px 25px;
        font-size: 1rem;
    }

    .dashboard-responsive {
        margin-top: 1.5rem;
    }

    footer {
        padding: 1rem 0;
        margin-top: 2rem;
        font-size: 0.8rem;
    }
}

/* Animaciones adicionales */
@keyframes glow {
    0% { box-shadow: 0 0 5px rgba(102, 126, 234, 0.5); }
    50% { box-shadow: 0 0 20px rgba(102, 126, 234, 0.8); }
    100% { box-shadow: 0 0 5px rgba(102, 126, 234, 0.5); }
}

.glow-on-hover:hover {
    animation: glow 2s infinite;
}

/* Efectos de parallax suaves */
.parallax-element {
    transform: translateZ(0);
    will-change: transform;
}

/* Mejoras en la accesibilidad */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}