:root {
    --primary: #2c3e50;
    --primary-light: #34495e;
    --secondary: #3498db;
    --accent: #e74c3c;
    --bg: #f8f9fa;
    --bg-light: #ffffff;
    --text: #2c3e50;
    --text-light: #7f8c8d;
    --border: #ecf0f1;
    --transition: all 0.3s ease;
    --shadow-sm: 0 2px 5px rgba(0,0,0,0.1);
    --shadow-md: 0 3px 10px rgba(0,0,0,0.1);
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 20px;
}

[data-theme="dark"] {
    --primary: #ecf0f1;
    --primary-light: #bdc3c7;
    --secondary: #3498db;
    --accent: #e74c3c;
    --bg: #1a1a1a;
    --bg-light: #2d3436;
    --text: #ecf0f1;
    --text-light: #bdc3c7;
    --border: #34495e;
    --shadow-sm: 0 2px 5px rgba(0,0,0,0.3);
    --shadow-md: 0 3px 10px rgba(0,0,0,0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Reset adicional para asegurar que la barra fija funcione */
html, body {
    margin: 0 !important;
    padding: 0 !important;
    overflow-x: hidden;
}

/* Forzar que la barra de navegación se mantenga fija */
header {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100vw !important;
    z-index: 9999 !important;
    background-color: var(--bg) !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1) !important;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text);
    background-color: var(--bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-top: 150px !important; /* Espacio para la barra fija */
    margin: 0 !important;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Estilos adicionales para el header */
header {
    backdrop-filter: blur(10px);
    transition: var(--transition);
}

header .container {
    padding: 1rem 0;
    text-align: center;
    max-width: 1200px;
    margin: 0 auto;
    padding-left: 1rem;
    padding-right: 1rem;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--primary);
}

.theme-toggle {
    position: absolute;
    top: 50%;
    right: 1rem;
    transform: translateY(-50%);
    background: var(--bg-light);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    color: var(--text);
    z-index: 1001;
    transition: var(--transition);
}

.theme-toggle:hover {
    transform: scale(1.1);
}

nav ul {
    display: flex;
    justify-content: center;
    list-style: none;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1.5rem;
}

nav a {
    text-decoration: none;
    color: var(--primary);
    font-weight: 500;
    padding: .5rem 1rem;
    transition: var(--transition);
    border-bottom: 2px solid transparent;
    border-radius: var(--radius-sm);
}

nav a:hover {
    color: var(--secondary);
    border-bottom-color: var(--secondary);
    background-color: rgba(52, 152, 219, 0.1);
}

section {
    padding: 4rem 1rem;
}

h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
    text-align: center;
    color: var(--primary);
    position: relative;
}

h2::after {
    content: '';
    display: block;
    width: 80px;
    height: 3px;
    background: var(--secondary);
    margin: .5rem auto;
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    font-size: 1.1rem;
    line-height: 1.8;
    padding: 2rem;
    background-color: var(--bg-light);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.skills-container {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.toggle-btn {
    padding: .8rem 1.5rem;
    background: var(--secondary);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    margin-bottom: 1.5rem;
    font-weight: 500;
    transition: var(--transition);
}

.toggle-btn:hover {
    background: var(--accent);
    transform: translateY(-2px);
}

.skill-tag {
    background-color: var(--bg-light);
    padding: .5rem 1.2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    font-weight: 500;
    transition: var(--transition);
}

.skill-tag:nth-child(even) {
    background-color: var(--accent);
    color: #fff;
}

.skills-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
}

.skill-tag:nth-child(even):hover {
    background-color: var(--accent);
    color: #fff;
    transform: scale(1.05);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.project-card {
    background: var(--bg-light);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: transform 0.3s ease;
}

.project-card:hover {
    transform: translateY(-5px);
}

.project-image {
    height: 200px;
    overflow: hidden;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.project-card:hover .project-image img {
    transform: scale(1.05);
}

.project-info {
    padding: 1.5rem;
}

.project-info h3 {
    margin-bottom: .8rem;
    color: var(--primary);
}

.project-info p {
    color: var(--text-light);
    margin-bottom: 1.2rem;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: 1.2rem;
}

.tech-tag {
    background-color: rgba(52, 152, 219, 0.1);
    color: var(--secondary);
    padding: .3rem .8rem;
    border-radius: var(--radius-sm);
    font-size: .8rem;
    font-weight: 600;
}

.project-links {
    display: flex;
    gap: 1rem;
}

.project-links a {
    display: inline-flex;
    align-items: center;
    color: var(--secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.project-links a:hover {
    color: var(--accent);
}

.project-links i {
    margin-right: .5rem;
}

/* Sección de contacto */
.contact-intro {
    text-align: center;
    max-width: 600px;
    margin: 0 auto 2rem;
}

.contact-intro h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--primary);
}

.contact-intro p {
    color: var(--text-light);
    font-size: 1.1rem;
    line-height: 1.6;
}

.contact-info h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

.contact-info p {
    color: var(--text-light);
    margin-bottom: 2rem;
    line-height: 1.7;
}

.contact-methods {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.contact-item {
    display: flex;
    align-items: center;
}

.contact-icon {
    width: 50px;
    height: 50px;
    background-color: rgba(52, 152, 219, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    color: var(--secondary);
    font-size: 1.2rem;
}

.contact-text h4 {
    font-size: 1rem;
    margin-bottom: .3rem;
}

.contact-text a {
    color: var(--text-light);
    text-decoration: none;
    transition: color 0.3s ease;
}

.contact-text a:hover {
    color: var(--secondary);
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.social-link {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(52, 152, 219, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    transition: var(--transition);
}

.social-link:hover {
    background-color: var(--secondary);
    color: #fff;
    transform: scale(1.1);
}

/* SECCIÓN DE CONTACTO */
.contact-actions {
    max-width: 600px;
    margin: 0 auto;
}

.contact-card {
    background: linear-gradient(135deg, var(--bg-light) 0%, rgba(52, 152, 219, 0.05) 100%);
    padding: 3rem 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    text-align: center;
    border: 1px solid rgba(52, 152, 219, 0.1);
    position: relative;
    overflow: hidden;
    margin-bottom: 2rem;
}

.contact-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--secondary), var(--accent));
}

.contact-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--secondary), #2980b9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    color: white;
    font-size: 2rem;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.contact-card h3 {
    color: var(--primary);
    margin-bottom: 1rem;
    font-size: 1.5rem;
    font-weight: 600;
}

.contact-card p {
    color: var(--text-light);
    margin-bottom: 2rem;
    font-size: 1.1rem;
    line-height: 1.6;
}

.contact-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, var(--secondary), #2980b9);
    color: white;
    text-decoration: none;
    padding: 1rem 2rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.contact-btn:hover {
    background: linear-gradient(135deg, #2980b9, var(--secondary));
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
    color: white;
}

.contact-btn i {
    font-size: 1.2rem;
}

.contact-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background-color: var(--bg-light);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.info-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.info-item i {
    color: var(--secondary);
    font-size: 1.2rem;
    width: 20px;
}

.info-item span {
    color: var(--text);
    font-weight: 500;
    font-size: 0.9rem;
}

footer {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: var(--bg-light);
    padding: 3rem 0 1rem;
    margin-top: auto;
    border-top: 1px solid var(--border);
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 3rem;
    align-items: start;
    margin-bottom: 2rem;
}

.footer-brand {
    text-align: left;
}

.footer-logo {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.footer-logo i {
    margin-right: 0.5rem;
    color: var(--secondary);
    font-size: 1.8rem;
}

.footer-brand p {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
    font-size: 0.95rem;
}

.footer-links h4,
.footer-contact h4 {
    color: var(--bg-light);
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.footer-links ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.3s ease;
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: var(--secondary);
}

.footer-contact .contact-item {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    color: rgba(255, 255, 255, 0.8);
}

.footer-contact .contact-item i {
    margin-right: 0.5rem;
    color: var(--secondary);
    width: 16px;
}

.footer-contact .contact-item a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.3s ease;
    font-size: 0.9rem;
}

.footer-contact .contact-item a:hover {
    color: var(--secondary);
}

.footer-contact .social-links {
    display: flex;
    gap: 1rem;
}

.footer-contact .social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: var(--bg-light);
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 1.1rem;
}

.footer-contact .social-links a:hover {
    background-color: var(--secondary);
    color: white;
    transform: translateY(-2px);
}

.footer-bottom {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom p {
    margin: 0;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

/* RESPONSIVE DESIGN */
@media (max-width: 768px) {
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    section {
        padding: 3rem 1rem;
    }
    
    body {
        padding-top: 160px; /* Más espacio en móviles */
    }
    
    header .container {
        padding: 0.5rem 0;
    }
    
    /* Formulario responsive */
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .contact-card {
        padding: 2rem 1.5rem;
    }
    
    .contact-info {
        grid-template-columns: 1fr;
    }
    
    /* Footer responsive */
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    .footer-brand {
        text-align: center;
    }
    
    .footer-contact .social-links {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    nav ul {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    .theme-toggle {
        position: static;
        margin: 1rem auto;
        transform: none;
    }
    
    body {
        padding-top: 180px; /* Aún más espacio en móviles pequeños */
    }
    
    header .container {
        padding: 0.5rem 0;
    }
}