/* Variables CSS */
:root {
    --primary-color: #3b82f6;
    --primary-dark: #2563eb;
    --secondary-color: #64748b;
    --accent-color: #F93E05;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-light: #9ca3af;
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-dark: #1f2937;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --border-radius: 0.5rem;
    --transition: all 0.3s ease;
}

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    width: 100%;
}

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    overflow-x: hidden;
    width: 100%;
    margin: 0;
    padding: 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    width: 100%;
    box-sizing: border-box;
}

/* Navegación */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    padding: 1rem 0;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

.nav-logo .logo-image {
    height: 32px;
    width: auto;
    object-fit: contain;
}

.nav-logo .logo-text {
    color: var(--text-secondary);
    font-family: 'Montserrat', sans-serif;
    font-weight: 400;
}

.nav-logo:hover {
    color: var(--primary-dark);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.nav-link:hover {
    color: var(--primary-color);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: var(--transition);
}

.nav-link:hover::after {
    width: 100%;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0.5rem;
}

.nav-toggle.active .bar:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active .bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.nav-toggle.active .bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

.bar {
    width: 25px;
    height: 3px;
    background: var(--text-primary);
    margin: 3px 0;
    transition: var(--transition);
}

/* Sección Hero */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    padding: 8rem 0 4rem;
    position: relative;
}

.hero-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.hero-content h1 {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.text-gradient {
    font-family: 'Montserrat', sans-serif;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.hero-description {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    position: relative;
    z-index: 10;
}

.btn {
    padding: 0.875rem 2rem;
    border: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    z-index: 10;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-linkedin {
    background: #0077b5;
    color: white;
    border: 2px solid #0077b5;
}

.btn-linkedin:hover {
    background: #005885;
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.hero-image {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
    position: relative;
}

.hero-image::before,
.hero-image::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: rgba(59, 130, 246, 0.3);
    animation: float-bubble 6s ease-in-out infinite;
}

.profile-image {
    width: 250px;
    height: 250px;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid #3b82f6;
    box-shadow: 0 10px 30px rgba(59, 130, 246, 0.5);
    transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.2s ease;
    cursor: pointer;
    user-select: none;
}

.profile-image:hover {
    transform: scale(1.08);
    box-shadow: 0 20px 50px rgba(59, 130, 246, 0.6);
}

.hero-placeholder {
    width: 250px;
    height: 250px;
    background: linear-gradient(135deg, var(--accent-color), var(--primary-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 6rem;
    box-shadow: var(--shadow-lg);
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    color: var(--text-light);
    font-size: 1.5rem;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateX(-50%) translateY(0); }
    40% { transform: translateX(-50%) translateY(-10px); }
    60% { transform: translateX(-50%) translateY(-5px); }
}

/* Secciones Generales */
.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.section-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* Sección Sobre Mí */
.about {
    padding: 6rem 0;
    background: var(--bg-secondary);
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.about-text h3 {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

.about-text p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.about-stats {
    display: flex;
    gap: 2rem;
    margin-top: 2rem;
}

.stat-item {
    text-align: center;
}

.stat-item h4 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.stat-item p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.about-image {
    display: flex;
    justify-content: center;
    align-items: center;
}

.about-profile-image {
    width: 200px;
    height: 200px;
    border-radius: 20px;
    object-fit: cover;
    border: 3px solid #e5e7eb;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    transform: rotate(5deg);
}

.about-profile-image:hover {
    transform: rotate(0deg) translateY(-5px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.15);
}

.about-placeholder {
    width: 250px;
    height: 250px;
    background: linear-gradient(135deg, var(--accent-color), var(--primary-color));
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 6rem;
    box-shadow: var(--shadow-lg);
    transform: rotate(10deg);
    transition: var(--transition);
    position: relative;
    z-index: 1;
    overflow: hidden; /* Prevenir overflow */
}

.about-placeholder:hover {
    transform: rotate(0deg);
}

.about-placeholder i {
    animation: rotate-icon 10s linear infinite;
}

@keyframes rotate-icon {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Responsive para sección Sobre Mí */
@media (max-width: 768px) {
    .about {
        padding: 8rem 0 4rem; /* Aumentar padding superior para evitar que la navbar cubra el título */
        overflow: visible; /* Asegurar visibilidad */
    }
    
    .about-content {
        grid-template-columns: 1fr;
        gap: 3rem;
        text-align: center;
    }
    
    .about-text {
        order: 1;
    }
    
    .about-image {
        order: 2;
        margin-top: 2rem;
        display: flex;
        justify-content: center;
        align-items: center;
        min-height: 200px; /* Asegurar altura mínima */
    }
    
    .about-placeholder {
        width: 180px !important;
        height: 180px !important;
        font-size: 4rem !important;
        margin: 0 auto;
        transform: none !important; /* Eliminar todas las transformaciones */
        position: relative !important; /* Cambio de static a relative para mejor control */
        z-index: 1 !important; /* Z-index más bajo que los botones */
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        opacity: 1 !important; /* Forzar visibilidad */
        visibility: visible !important;
    }
    
    .about-placeholder i {
        animation: rotate-icon 10s linear infinite;
        display: block;
        opacity: 1 !important;
        visibility: visible !important;
    }
    
    /* Asegurar que los botones de proyectos tengan mayor z-index */
    .project-card,
    .btn,
    .hero-buttons,
    .project-overlay,
    .project-links {
        position: relative;
        z-index: 10;
    }
}

@media (max-width: 480px) {
    .about {
        padding: 7rem 0 3rem; /* Padding superior generoso para móviles pequeños */
        overflow: visible;
    }
    
    .about-image {
        margin-top: 3rem;
        display: flex;
        justify-content: center;
        align-items: center;
        min-height: 170px;
    }
    
    .about-placeholder {
        width: 150px !important;
        height: 150px !important;
        font-size: 3rem !important;
        transform: none !important;
        position: relative !important; /* Mantener relative para control */
        z-index: 1 !important; /* Z-index bajo */
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        opacity: 1 !important;
        visibility: visible !important;
        margin: 0 auto;
    }
    
    .about-placeholder i {
        animation: rotate-icon 10s linear infinite;
        display: block;
        opacity: 1 !important;
        visibility: visible !important;
    }
    
    .about-text h3 {
        font-size: 1.5rem;
    }
    
    .about-text p {
        font-size: 1rem;
    }
    
    /* Asegurar que todos los elementos clickeables tengan mayor z-index en móvil */
    .btn,
    .project-link,
    .project-overlay,
    .hero-buttons a,
    .nav-link {
        position: relative;
        z-index: 15 !important;
    }
}

/* Sección Habilidades */
.skills {
    padding: 6rem 0;
}

/* Responsive para sección Habilidades */
@media (max-width: 768px) {
    .skills {
        padding: 8rem 0 4rem; /* Padding superior aumentado para evitar superposición con navbar */
    }
}

@media (max-width: 480px) {
    .skills {
        padding: 7rem 0 3rem; /* Padding optimizado para móviles pequeños */
    }
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.skill-category {
    background: var(--bg-primary);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.skill-category:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.skill-category h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.skill-items {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.skill-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-secondary);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    color: var(--text-secondary);
    transition: var(--transition);
}

.skill-item:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.skill-item i {
    font-size: 1.2rem;
}

/* Sección Proyectos */
.projects {
    padding: 6rem 0;
    background: var(--bg-secondary);
}

/* Responsive para sección Proyectos */
@media (max-width: 768px) {
    .projects {
        padding: 8rem 0 4rem; /* Padding superior aumentado para evitar superposición con navbar */
    }
}

@media (max-width: 480px) {
    .projects {
        padding: 7rem 0 3rem; /* Padding optimizado para móviles pequeños */
    }
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.project-card {
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
}

.project-image {
    height: 200px;
    background: var(--bg-secondary);
    position: relative;
    overflow: hidden;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.project-card:hover .project-image img {
    transform: scale(1.05);
}

.project-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3rem;
}

.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
}

.project-card:hover .project-overlay {
    opacity: 1;
}

.project-links {
    display: flex;
    gap: 1rem;
}

.project-link {
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    transition: var(--transition);
}

.project-link:hover {
    background: var(--accent-color);
    transform: scale(1.1);
}

.project-content {
    padding: 1.5rem;
}

.project-content h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.project-content p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.project-tech span {
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Botón Ver Más Proyectos */
.projects-load-more {
    text-align: center;
    margin-top: 3rem;
}

.more-projects {
    animation: fadeInUp 0.8s ease-out;
}

/* Animación para proyectos que aparecen */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive para imágenes */
@media (max-width: 768px) {
    .project-image {
        height: 180px;
    }
    
    .project-placeholder {
        font-size: 2rem;
    }
    
    .project-link {
        width: 40px;
        height: 40px;
        font-size: 0.9rem;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

/* Sección Contacto */
.contact {
    padding: 6rem 0;
}

/* Responsive para sección Contacto */
@media (max-width: 768px) {
    .contact {
        padding: 8rem 0 4rem; /* Padding superior aumentado para evitar superposición con navbar */
    }
}

@media (max-width: 480px) {
    .contact {
        padding: 7rem 0 3rem; /* Padding optimizado para móviles pequeños */
    }
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
}

.contact-info h3 {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.contact-info p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.contact-items {
    margin-bottom: 2rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.contact-item i {
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
}

.contact-item h4 {
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.contact-item p {
    color: var(--text-secondary);
    margin: 0;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-link {
    width: 45px;
    height: 45px;
    background: var(--bg-secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
}

.social-link:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-3px);
}

/* Formulario de Contacto */
.contact-form h3 {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 2rem;
    color: var(--primary-color);
}

/* Nuevo contenedor para formulario de ancho completo */
.contact-form-only {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.contact-form-only h3 {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 2rem;
    color: var(--primary-color);
}

.google-form-container-full {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    background: var(--bg-primary);
}

.google-form-container-full iframe {
    width: 100%;
    min-height: 800px;
    border: none;
    border-radius: var(--border-radius);
    overflow: hidden;
}

.google-form-container {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    background: var(--bg-primary);
}

.google-form-container iframe {
    width: 100%;
    min-height: 688px;
    border: none;
    border-radius: var(--border-radius);
    overflow: hidden;
}

/* Responsive para el formulario */
@media (max-width: 768px) {
    .contact-content {
        grid-template-columns: 1fr;
    }
    
    .google-form-container iframe {
        min-height: 900px;
    }
    
    .google-form-container-full iframe {
        min-height: 950px;
    }
    
    .contact-form-only {
        max-width: 100%;
        padding: 0 1rem;
    }
}

@media (max-width: 480px) {
    .google-form-container iframe {
        min-height: 850px;
    }
    
    .google-form-container-full iframe {
        min-height: 900px;
    }
    
    .contact-form h3,
    .contact-form-only h3 {
        font-size: 1.5rem;
    }
}

/* Responsive para dispositivos extra pequeños */
@media (max-width: 360px) {
    .google-form-container iframe {
        min-height: 800px;
    }
    
    .google-form-container-full iframe {
        min-height: 850px;
    }
    
    .contact-form-only {
        padding: 0 0.5rem;
    }
    
    .contact-form h3,
    .contact-form-only h3 {
        font-size: 1.3rem;
    }
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.875rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

/* Footer */
.footer {
    background: var(--bg-dark);
    color: white;
    padding: 2rem 0;
    text-align: center;
    width: 100%;
    overflow-x: hidden;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    width: 100%;
}

.footer-links {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-links a {
    color: white;
    text-decoration: none;
    transition: var(--transition);
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: var(--primary-color);
}

/* Efecto Typewriter */
.typewriter {
    position: relative;
    display: inline-block;
    min-width: 2px;
}

.typewriter::after {
    content: '';
    position: absolute;
    right: -3px;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: #3b82f6;
    animation: blink 1s infinite;
}

.typewriter.typing::after {
    display: block;
}

.typewriter.finished::after {
    display: none;
}

@keyframes blink {
    0%, 50% { 
        opacity: 1; 
    }
    51%, 100% { 
        opacity: 0; 
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero {
        min-height: 85vh; /* Reducir altura mínima en tablet */
        padding: 6rem 0 2rem; /* Reducir padding superior e inferior */
    }
    
    .hero-container {
        flex-direction: column;
        text-align: center;
        gap: 2rem; /* Reducir gap entre elementos */
    }
    
    .hero-content {
        order: 2;
    }
    
    .hero-image {
        order: 1;
        margin-bottom: 2rem;
    }
    
    .profile-image {
        width: 180px;
        height: 180px;
    }
    
    .about-content {
        flex-direction: column;
        text-align: center;
    }
    
    .about-image {
        order: 1;
        margin-bottom: 2rem;
    }
    
    .about-text {
        order: 2;
    }
    
    .about-profile-image {
        width: 160px;
        height: 160px;
    }
    
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(10px);
        width: 100%;
        text-align: center;
        transition: var(--transition);
        box-shadow: var(--shadow-lg);
        padding: 2rem 0;
        z-index: 999;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-menu li {
        margin: 0.5rem 0;
    }

    .nav-menu .nav-link {
        display: block;
        padding: 1rem;
        font-size: 1.1rem;
        color: var(--text-primary);
        border-radius: var(--border-radius);
        margin: 0 2rem;
        transition: var(--transition);
    }

    .nav-menu .nav-link:hover {
        background: var(--bg-secondary);
        color: var(--primary-color);
    }

    .nav-toggle {
        display: flex;
    }

    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-content h1 {
        font-size: 2.5rem;
    }

    .hero-placeholder {
        width: 200px;
        height: 200px;
        font-size: 5rem;
    }

    .about-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .about-stats {
        justify-content: center;
    }

    .contact-content {
        grid-template-columns: 1fr;
    }

    .footer-content {
        flex-direction: column;
        gap: 1.5rem;
        text-align: center;
    }

    .footer-links {
        gap: 1.5rem;
        justify-content: center;
        flex-wrap: wrap;
    }

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

    .container {
        padding: 0 1rem;
    }
}

@media (max-width: 480px) {
    .hero {
        min-height: 80vh; /* Altura mínima aún más pequeña en móvil */
        padding: 4rem 0 1.5rem; /* Reducir significativamente el padding */
    }
    
    .hero-container {
        gap: 1.5rem; /* Gap más pequeño entre elementos */
        padding: 0 1rem; /* Mantener padding lateral */
    }
    
    .hero-content h1 {
        font-size: 2rem;
        margin-bottom: 0.5rem; /* Reducir margen inferior del título */
    }

    .hero-subtitle {
        font-size: 1.2rem;
        margin-bottom: 0.5rem; /* Reducir margen del subtítulo */
    }
    
    .hero-description {
        font-size: 1rem;
        margin-bottom: 1.5rem; /* Reducir margen de la descripción */
        line-height: 1.5;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
        gap: 0.75rem; /* Reducir espacio entre botones */
    }

    .btn {
        width: 100%;
        max-width: 300px;
        justify-content: center;
        padding: 0.75rem 1.5rem; /* Reducir padding de los botones */
    }

    .about-stats {
        flex-direction: column;
        gap: 1rem;
    }

    /* Footer responsive para móvil */
    .footer {
        padding: 1.5rem 0;
    }

    .footer-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
        padding: 0 1rem;
    }

    .footer-links {
        gap: 1rem;
        justify-content: center;
        flex-wrap: wrap;
    }

    .footer-links a {
        font-size: 0.85rem;
        padding: 0.25rem;
    }
}

/* Extra small mobile devices */
@media (max-width: 360px) {
    .hero {
        min-height: 75vh; /* Altura mínima muy reducida para móviles pequeños */
        padding: 3rem 0 1rem; /* Padding mínimo */
    }
    
    .hero-container {
        gap: 1rem; /* Gap mínimo entre elementos */
        padding: 0 0.75rem;
    }
    
    .hero-content h1 {
        font-size: 1.75rem;
        margin-bottom: 0.5rem;
        line-height: 1.1;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
        margin-bottom: 0.5rem;
    }
    
    .hero-description {
        font-size: 0.95rem;
        margin-bottom: 1rem;
        line-height: 1.4;
    }
    
    .hero-buttons {
        gap: 0.5rem; /* Gap mínimo entre botones */
    }
    
    .btn {
        padding: 0.6rem 1.2rem; /* Botones más compactos */
        font-size: 0.9rem;
    }

    .skills-grid {
        grid-template-columns: 1fr;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }

    /* Footer para dispositivos extra pequeños */
    .footer {
        padding: 1rem 0;
    }

    .footer-content {
        gap: 0.75rem;
        padding: 0 0.75rem;
    }

    .footer-links {
        gap: 0.75rem;
        flex-direction: column;
        align-items: center;
    }

    .footer-links a {
        font-size: 0.8rem;
        padding: 0.5rem;
        display: block;
        width: auto;
    }
}

/* Animaciones adicionales */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.8s ease-out;
}

/* Estilos para página de créditos */
.credits-section {
    padding: 8rem 0 4rem;
    background-color: var(--bg-secondary);
}

.credits-header {
    text-align: center;
    margin-bottom: 4rem;
}

.credits-header h1 {
    font-size: 3rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.credits-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.credits-content {
    max-width: 1000px;
    margin: 0 auto;
}

.credit-section {
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
}

.credit-section h2 {
    color: var(--primary-color);
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
}

.credit-section h2 i {
    margin-right: 0.5rem;
}

.credit-item {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    border-left: 4px solid var(--primary-color);
}

.credit-item:last-child {
    margin-bottom: 0;
}

.credit-item h3 {
    color: var(--text-primary);
    font-size: 1.3rem;
    margin-bottom: 1rem;
}

.credit-item p {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.credit-item p strong {
    color: var(--text-primary);
}

.credit-item a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

.credit-item a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Responsive para créditos */
@media (max-width: 768px) {
    .credits-section {
        padding: 6rem 0 2rem;
    }
    
    .credits-header h1 {
        font-size: 2rem;
    }
    
    .credit-section {
        padding: 1.5rem;
    }
    
    .credit-item {
        padding: 1rem;
    }
}

/* Smooth scrolling para navegadores que no lo soportan */
@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

/* Reglas de z-index para evitar superposiciones en móvil */
@media (max-width: 768px) {
    /* Desactivar transforms problemáticos en móvil */
    .about-placeholder {
        transform: none !important;
        animation: none !important;
    }
    
    .about-placeholder i {
        animation: rotate-icon-mobile 15s linear infinite !important;
    }
    
    /* Elementos con prioridad alta (clickeables/interactivos) */
    .btn,
    .project-link,
    .project-overlay,
    .hero-buttons a,
    .nav-link,
    .project-card:hover .project-overlay,
    .social-link,
    .contact-item,
    .navbar {
        z-index: 20 !important;
    }
    
    /* Elementos decorativos con prioridad baja */
    .about-placeholder,
    .hero-placeholder,
    .scroll-indicator {
        z-index: 1 !important;
    }
    
    /* Contenedores de contenido con prioridad media */
    .project-card,
    .skill-category,
    .contact-form {
        z-index: 5 !important;
    }
    
    /* Optimizaciones de rendimiento para móvil */
    .hero {
        will-change: transform;
        backface-visibility: hidden;
        perspective: 1000px;
    }
    
    /* Reducir animaciones complejas en móvil */
    .hero-placeholder {
        animation: none !important;
    }
}

/* Animación más sencilla para el icono en móvil */
@keyframes rotate-icon-mobile {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Optimizaciones específicas para dispositivos táctiles */
@media (hover: none) and (pointer: coarse) {
    /* Dispositivos táctiles - desactivar efectos complejos */
    .hero {
        transform: none !important;
    }
    
    .about-placeholder {
        transform: none !important;
        animation: none !important;
    }
    
    .about-placeholder i {
        animation: rotate-icon-mobile 20s linear infinite;
    }
    
    /* Reducir animaciones de hover problemáticas */
    .project-card:hover {
        transform: none !important;
    }
    
    .profile-image:hover {
        transform: scale(1.02) !important;
    }
    
    /* Mejorar rendimiento eliminando animaciones complejas */
    .hero-placeholder {
        animation: none !important;
    }
}

/* Estilos para partículas optimizados */
.particle {
    position: absolute;
    width: 3px;
    height: 3px;
    background: rgba(59, 130, 246, 0.7);
    border-radius: 50%;
    pointer-events: none;
    animation: float-particle 3s linear infinite;
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.4);
    z-index: 1;
}

@keyframes float-particle {
    0% { 
        transform: translateY(0px) translateX(0px) rotate(0deg);
        opacity: 0.8;
    }
    25% {
        transform: translateY(-30px) translateX(15px) rotate(90deg);
        opacity: 1;
    }
    50% { 
        transform: translateY(-60px) translateX(-10px) rotate(180deg);
        opacity: 0.6;
    }
    75% {
        transform: translateY(-30px) translateX(-15px) rotate(270deg);
        opacity: 0.9;
    }
    100% {
        transform: translateY(0px) translateX(0px) rotate(360deg);
        opacity: 0.8;
    }
}

/* Accesibilidad - reducir animaciones si el usuario lo prefiere */
@media (prefers-reduced-motion: reduce) {
    .particle {
        animation: none;
    }
    
    /* Mantener animaciones esenciales pero reducidas */
    .typewriter::after {
        animation: blink 0.5s infinite;
    }
    
    .hero-placeholder,
    .about-placeholder {
        animation: none;
    }
}
