
/* --- Variables y Estilos Globales --- */
:root {
    --bg-color: #f4f4f9;
    --primary-color: #ffffff;
    --secondary-color: #e0e0e0;
    --font-color: #333333;
    --accent-color: #007BFF;
    --font-family: 'Poppins', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--font-color);
    line-height: 1.6;
}

h1, h2, h3 {
    line-height: 1.2;
    font-weight: 600;
}

a {
    color: var(--accent-color);
    text-decoration: none;
}

/* Estilo inicial para los elementos que se animarán al hacer scroll */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

section {
    padding: 80px 5%;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 50px;
    font-weight: 700;
}

/* --- Barra de Navegación --- */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid #dddddd;
}

.nav-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--font-color);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    color: var(--font-color);
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: var(--accent-color);
}

/* --- Botón de cambio de tema --- */
.theme-toggle-btn {
    background: none;
    border: none;
    color: var(--font-color);
    font-size: 1.2rem;
    cursor: pointer;
    transition: color 0.3s ease;
}


/* --- Sección Hero --- */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.hero-content h1 {
    font-size: 4rem;
    margin-bottom: 0.5rem;
}

.hero-content > p {
    font-size: 1.5rem;
    color: #555555;
    margin-bottom: 2rem;
}

.hero-skills {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-bottom: 2.5rem;
}

.skill h3 {
    font-size: 1.2rem;
    color: var(--accent-color);
}

.skill p {
    color: #666666;
    max-width: 300px;
}

.cta-button {
    display: inline-block;
    background-color: var(--accent-color);
    color: #fff;
    padding: 12px 24px;
    border-radius: 5px;
    font-weight: 600;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

/* --- Animaciones de entrada --- */
.fade-in { opacity: 0; animation: fadeIn 0.8s ease-out forwards; }
.delay-1 { animation-delay: 0.2s; }
.delay-2 { animation-delay: 0.4s; }
.delay-3 { animation-delay: 0.6s; }

@keyframes fadeIn {
    to { opacity: 1; }
}

/* --- Sección de Proyectos --- */
.projects-section {
    min-height: 100vh;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

.project-card {
    background-color: var(--primary-color);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--secondary-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.project-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.project-info {
    padding: 1.5rem;
}

.project-info h3 {
    margin-bottom: 0.5rem;
}

.project-info p {
    color: #666666;
    margin-bottom: 1rem;
}

.project-link {
    font-weight: 600;
}

.project-link i {
    margin-left: 5px;
}

/* --- Sección de Contacto --- */
.contact-section {
    text-align: center;
    min-height: 80vh;
}

.contact-section > p {
    max-width: 600px;
    margin: 0 auto 40px;
    color: #555555;
}

.contact-form {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 12px;
    border-radius: 5px;
    border: 1px solid #d1d5db;
    background-color: #ffffff;
    color: var(--font-color);
    font-family: var(--font-family);
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--accent-color);
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
    color: #999999;
    opacity: 1;
}

#form-status {
    margin-top: 1rem;
    font-weight: 600;
}

/* --- Footer --- */
footer {
    text-align: center;
    padding: 40px 5%;
    border-top: 1px solid var(--secondary-color);
}

.social-links {
    margin-bottom: 1rem;
}

.social-links a {
    font-size: 1.8rem;
    margin: 0 15px;
    color: #555555;
    transition: color 0.3s ease;
}

.social-links a:hover {
    color: var(--accent-color);
}

footer p {
    font-size: 0.9rem;
    color: #777777;
}

/* --- Dark Theme --- */
.dark-theme {
    --bg-color: #121212;
    --primary-color: #1e1e1e;
    --secondary-color: #333333;
    --font-color: #ffffff;
}

.dark-theme .navbar {
    background-color: rgba(30, 30, 30, 0.8);
    border-bottom: 1px solid #555555;
}

.dark-theme .project-card {
    border-color: var(--secondary-color);
}

.dark-theme .project-info p,
.dark-theme .hero-content > p,
.dark-theme .skill p,
.dark-theme .contact-section > p {
    color: #bbbbbb;
}

.dark-theme .contact-form input,
.dark-theme .contact-form textarea {
    background-color: var(--secondary-color);
    border-color: #555555;
}

.dark-theme .social-links a,
.dark-theme footer p {
    color: #bbbbbb;
}


/* --- Responsividad --- */
@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 2.8rem;
    }
    .hero-content > p {
        font-size: 1.2rem;
    }
    .hero-skills {
        flex-direction: column;
        gap: 1.5rem;
        align-items: center;
    }
    .section-title {
        font-size: 2rem;
    }
    .nav-menu {
        gap: 1.5rem;
    }
}
