

/* Variables CSS */
:root {
    --primary-color: #4776E6;
    --secondary-color: #8E54E9;
    --accent-color: #ff7846;
    --background-color: #f9f9f9;
    --text-color: #333;
    --light-grey: #f5f5f5;
    --medium-grey: #e0e0e0;
    --dark-grey: #666;
    --white: #fff;
    --shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

/* Estilos Globales */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 62.5%; /* 1rem = 10px */
}

body {
    font-family: 'Poppins', sans-serif;
    font-size: 1.6rem;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
    overflow-x: hidden;
}

.container {
    width: 100%;
    max-width: 120rem;
    margin: 0 auto;
    padding: 0 2rem;
}

section {
    padding: 8rem 0;
}

/* Animaciones */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.8s ease forwards;
    opacity: 0;
}

.delay-1 {
    animation-delay: 0.2s;
}

.delay-2 {
    animation-delay: 0.4s;
}

.delay-3 {
    animation-delay: 0.6s;
}

/* Navegación */
header {
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 100;
    background: var(--white);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

#navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    max-width: 120rem;
    margin: 0 auto;
}

.logo a {
    font-size: 2.4rem;
    font-weight: 700;
    color: var(--text-color);
    text-decoration: none;
}

.logo span {
    color: var(--primary-color);
}

.nav-links {
    display: flex;
    list-style: none;
}

.nav-links li {
    margin-left: 3rem;
}

.nav-link {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.nav-link:hover {
    color: var(--primary-color);
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: var(--primary-color);
    transition: var(--transition);
}

.nav-link:hover::after {
    width: 100%;
}

.menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.bar {
    width: 25px;
    height: 3px;
    background-color: var(--text-color);
    margin: 3px 0;
    transition: var(--transition);
}

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    max-width: 120rem;
    margin: 0 auto;
    padding-top: 8rem;
}

.hero-content {
    flex: 1;
    max-width: 60rem;
}

.hero h1 {
    font-size: 4.8rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero h2 {
    font-size: 2.8rem;
    font-weight: 600;
    margin-bottom: 2rem;
    color: var(--dark-grey);
}

.hero p {
    font-size: 1.8rem;
    margin-bottom: 3rem;
}

.highlight {
    color: var(--primary-color);
    position: relative;
    display: inline-block;
}

.highlight::after {
    content: '';
    position: absolute;
    height: 40%;
    width: 100%;
    bottom: 0;
    left: 0;
    background-color: rgba(71, 118, 230, 0.2);
    z-index: -1;
}

.hero-buttons {
    display: flex;
    gap: 1.5rem;
}

.hero-image {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-image img {
    max-width: 100%;
    height: auto;
    border-radius: 50%;
    box-shadow: var(--shadow);
    border: 5px solid var(--white);
}

/* Botones */
.btn {
    display: inline-block;
    padding: 1.2rem 2.5rem;
    border-radius: 5rem;
    font-weight: 500;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
}

.btn-secondary {
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.btn-secondary:hover {
    background-color: var(--primary-color);
    color: var(--white);
}

.btn-small {
    padding: 0.8rem 1.5rem;
    font-size: 1.4rem;
}

/* Secciones */
.section {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.section.active {
    opacity: 1;
    transform: translateY(0);
}

.section-title {
    font-size: 3.6rem;
    text-align: center;
    margin-bottom: 5rem;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    width: 50px;
    height: 3px;
    background: var(--primary-color);
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
}

/* Sobre Mí */
.sobre-mi-content {
    display: flex;
    flex-wrap: wrap;
    gap: 4rem;
}

.sobre-mi-texto {
    flex: 1;
    min-width: 30rem;
}

.sobre-mi-texto p {
    margin-bottom: 2rem;
}

.sobre-mi-datos {
    flex: 1;
    min-width: 30rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(25rem, 1fr));
    gap: 2rem;
}

.dato {
    display: flex;
    align-items: flex-start;
    background-color: var(--white);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.dato:hover {
    transform: translateY(-5px);
}

.dato i {
    font-size: 2.4rem;
    color: var(--primary-color);
    margin-right: 1.5rem;
}

.dato h3 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

/* Estructura principal */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
  }
  
  .skill-item {
    background: #fff;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  }
  
  /* Barras de progreso */
  .progress-bar {
    height: 8px;
    background: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 0.5rem;
  }
  
  .progress-fill {
    height: 100%;
    width: 0;
    border-radius: 4px;
    transition: width 1.2s ease-out;
  }
  
  /* Colores específicos */
  .html-fill {
    background: linear-gradient(90deg, #e44d26, #f16529);
  }
  
  .js-fill {
    background: linear-gradient(90deg, #f0db4f, #f7df1e);
  }
  
  .bootstrap-fill {
    background: linear-gradient(90deg, #563d7c, #7952b3);
  }
  
  .css-fill {
    background: linear-gradient(90deg, #264de4, #2965f1);
  }

  .python-fill {
    background: linear-gradient(90deg, #264de4, #2965f1);
  }
  
  /* Iconos */
  .skill-icon {
    font-size: 2.2rem;
    margin-right: 0.8rem;
  }
  
  .html-icon { color: #e44d26; }
  .js-icon { color: #f0db4f; }
  .bootstrap-icon { color: #563d7c; }
  .css-icon { color: #264de4; }
  .python-icon{ color:#306998 }
  /* Texto porcentaje */
  .skill-percent {
    font-weight: 600;
    font-size: 0.9rem;
    color: #333;
  }
/* Proyectos */
.projects-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(35rem, 1fr));
    gap: 3rem;
}

.project-card {
    background-color: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.project-card:hover {
    transform: translateY(-5px);
}

.project-image {
    overflow: hidden;
    height: 20rem;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.project-card:hover .project-image img {
    transform: scale(1.05);
}

.project-info {
    padding: 2rem;
}

.project-info h3 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.project-info p {
    color: var(--dark-grey);
    margin-bottom: 1.5rem;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-bottom: 1.5rem;
}

.project-tags span {
    background-color: rgba(71, 118, 230, 0.1);
    color: var(--primary-color);
    padding: 0.4rem 1rem;
    border-radius: 2rem;
    font-size: 1.2rem;
    font-weight: 500;
}

.project-links {
    display: flex;
    gap: 1rem;
}

/* Contacto */
.contacto-container {
    display: flex;
    flex-wrap: wrap;
    gap: 4rem;
}

.contacto-info {
    flex: 1;
    min-width: 30rem;
}

.contacto-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 3rem;
}

.contacto-item i {
    font-size: 2.4rem;
    color: var(--primary-color);
    margin-right: 1.5rem;
}

.contacto-item h3 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.redes-sociales {
    display: flex;
    gap: 1.5rem;
    margin-top: 3rem;
}

.redes-sociales a {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 4.5rem;
    height: 4.5rem;
    background-color: var(--white);
    color: var(--primary-color);
    border-radius: 50%;
    font-size: 2rem;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.redes-sociales a:hover {
    background-color: var(--primary-color);
    color: var(--white);
    transform: translateY(-3px);
}

.contacto-form {
    flex: 1;
    min-width: 30rem;
    background-color: var(--white);
    padding: 3rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.form-group {
    margin-bottom: 2rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.8rem;
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 1.2rem;
    border: 1px solid var(--medium-grey);
    border-radius: 8px;
    font-family: 'Poppins', sans-serif;
    font-size: 1.6rem;
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(71, 118, 230, 0.2);
}

.form-group textarea {
    min-height: 15rem;
    resize: vertical;
}

.error-message {
    color: #dc3545;
    font-size: 0.8rem;
    margin-top: 5px;
}

.global-error {
    background-color: #f8d7da;
    color: #721c24;
    padding: 10px;
    border-radius: 4px;
    margin: 15px 0;
    border: 1px solid #f5c6cb;
}

/* Estilo para el honeypot */
.hp-field {
    position: absolute;
    left: -9999px;
}



.spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    margin-right: 8px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Estilo para el botón durante el envío */
button[type="submit"] {
    transition: all 0.3s ease;
    position: relative;
}

button[type="submit"] .spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Footer */
footer {
    background-color: #222;
    color: var(--white);
    padding: 3rem 0;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 2rem;
}

.footer-links {
    display: flex;
    gap: 2rem;
}

.footer-links a {
    color: var(--white);
    text-decoration: none;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--primary-color);
}

/* Media Queries */
@media (max-width: 992px) {
    html {
        font-size: 55%;
    }
    
    .hero {
        flex-direction: column;
        text-align: center;
        gap: 4rem;
        padding-top: 12rem;
        height: auto;
        min-height: 100vh;
    }
    
    .hero-buttons {
        justify-content: center;
    }
    
    .hero-image {
        max-width: 30rem;
    }
}

@media (max-width: 768px) {
    html {
        font-size: 50%;
    }
    
    .menu-toggle {
        display: flex;
    }
    
    .nav-links {
        position: absolute;
        top: 7rem;
        left: 0;
        width: 100%;
        background-color: var(--white);
        flex-direction: column;
        align-items: center;
        padding: 2rem 0;
        gap: 2rem;
        box-shadow: var(--shadow);
        clip-path: polygon(0 0, 100% 0, 100% 0, 0 0);
        transition: clip-path 0.4s ease;
    }
    
    .nav-links.active {
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    }
    
    .nav-links li {
        margin-left: 0;
    }
    
    .sobre-mi-content,
    .contacto-container {
        flex-direction: column;
    }
    
    .dato {
        padding: 1.5rem;
    }
    
    .skills-container {
        grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr));
        gap: 2rem;
    }
    
    .projects-container {
        grid-template-columns: repeat(auto-fill, minmax(28rem, 1fr));
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
}

/* Accesibilidad */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    
    .fade-in, 
    .delay-1, 
    .delay-2, 
    .delay-3 {
        animation: none !important;
        opacity: 1 !important;
    }
    
    .section {
        opacity: 1;
        transform: none;
        transition: none;
    }
    
    .skill-level {
        transition: none;
    }
}

/* Enfoque con teclado */
.nav-link:focus-visible,
.btn:focus-visible,
.redes-sociales a:focus-visible,
.form-group input:focus-visible,
.form-group textarea:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 3px;
}

/* Estado activo de la navegación */
.nav-link.active {
    color: var(--primary-color);
}

.nav-link.active::after {
    width: 100%;
}


/* Estilos para los mensajes de estado */
.status-message {
    padding: 15px;
    border-radius: 5px;
    margin: 15px 0;
    display: flex;
    align-items: center;
    font-weight: 500;
    animation: fadeIn 0.3s ease;
}

.status-message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.status-message.loading {
    background-color: #e2e3e5;
    color: #383d41;
    border: 1px solid #d6d8db;
}

/* Estilos para el spinner */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(0,0,0,0.2);
    border-radius: 50%;
    border-top-color: #383d41;
    animation: spin 1s ease-in-out infinite;
    margin-right: 10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Errores en los campos */
.error-field {
    border-color: #f5c6cb !important;
    background-color: #fff8f8;
}

.form-group .error-text {
    color: #dc3545;
    font-size: 1.2rem;
    margin-top: 5px;
    display: none;
}

/* Honeypot (ya existe en tu CSS pero asegurándonos) */
.hp-field {
    position: absolute;
    left: -9999px;
}