/* Base Styles & Variables */
:root {
    --primary-color: #2563eb;
    /* Tono Azul profesional */
    --accent-color: #10b981;
    /* Tono Verde solicitado */
    --bg-light: #f8fafc;
    --bg-white: #ffffff;
    --text-dark: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --hover-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font-primary: 'Inter', sans-serif;
}

.dark-mode {
    --bg-light: #0f172a;
    --bg-white: #1e293b;
    --text-dark: #f1f5f9;
    --text-muted: #94a3b8;
    --text-muted-2: #cbd5e1;
    --border-color: #334155;
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
    --hover-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.6);
}

/* Reset & Global */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

img {
    max-width: 100%;
    display: block;
}

ul {
    list-style: none;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.section-padding {
    padding: 80px 0;
}

.bg-alt {
    background-color: var(--bg-light);
}

/* Typography */
h1,
h2,
h3,
h4 {
    color: var(--text-dark);
    font-weight: 700;
    line-height: 1.25;
}

.section-title {
    text-align: center;
    margin-bottom: 64px;
}

.section-title h2 {
    font-size: 2.25rem;
    margin-bottom: 16px;
}

.underline {
    width: 64px;
    height: 4px;
    background: linear-gradient(to right, var(--primary-color), var(--accent-color));
    margin: 0 auto;
    border-radius: 9999px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    font-size: 1rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -10px rgba(37, 99, 235, 0.5);
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

/* Header */
header {
    height: 72px;
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
}

.dark-mode header {
    background-color: rgba(15, 23, 42, 0.9);
}

header nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo {
    font-size: 1.25rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-dark);
}

.logo span span {
    color: var(--primary-color);
}

.logo i {
    color: var(--accent-color);
    font-size: 1.5rem;
}

.nav-links {
    display: flex;
    gap: 32px;
}

.nav-links a {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-muted);
}

.nav-links a:hover {
    color: var(--primary-color);
}

.mobile-menu {
    position: absolute;
    top: 72px;
    left: 0;
    width: 100%;
    background-color: var(--bg-white);
    padding: 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    display: none;
    flex-direction: column;
    gap: 16px;
    text-align: center;
}

.mobile-menu.active {
    display: flex;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Language Toggle Switch */
.lang-switch {
    display: flex;
    align-items: center;
    background-color: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2px;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

.lang-btn {
    background: transparent;
    border: none;
    padding: 5px 12px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 16px;
    transition: var(--transition);
    font-family: var(--font-primary);
}

.lang-btn.active {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

.dark-mode .lang-switch {
    background-color: #0f172a;
}

/* Language Visibility */
html[lang="en"] .lang-es {
    display: none !important;
}
html[lang="es"] .lang-en {
    display: none !important;
}

#theme-toggle {
    background: transparent;
    border: none;
    color: var(--text-dark);
    font-size: 1.25rem;
    cursor: pointer;
    transition: var(--transition);
    padding: 8px;
    border-radius: 50%;
}

#theme-toggle:hover {
    background-color: var(--bg-light);
}

/* Hero Section */
.hero {
    min-height: 100vh;
    padding-top: 100px;
    display: flex;
    align-items: center;
}

.hero-container {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 48px;
    align-items: center;
}

.badge-opener {
    display: inline-block;
    padding: 6px 12px;
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--accent-color);
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 9999px;
    margin-bottom: 16px;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 12px;
}

.hero h1 span {
    color: var(--primary-color);
}

.hero h2 {
    font-size: 1.5rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 24px;
}

.hero p {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 600px;
    margin-bottom: 32px;
}

.hero-btns {
    display: flex;
    gap: 16px;
    margin-bottom: 32px;
}

.image-wrapper {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    aspect-ratio: 1/1;
    max-width: 450px;
    margin: 0 auto;
}

.image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.floating-badge {
    position: absolute;
    bottom: -20px;
    right: -20px;
    background-color: var(--bg-white);
    padding: 12px 24px;
    border-radius: 12px;
    box-shadow: var(--hover-shadow);
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    color: var(--text-dark);
}

.floating-badge i {
    color: var(--accent-color);
    font-size: 1.5rem;
}

.social-hero {
    display: flex;
    gap: 20px;
}

.social-hero a {
    font-size: 1.5rem;
    color: var(--text-muted);
}

.social-hero a:hover {
    color: var(--primary-color);
    transform: translateY(-3px);
}

/* Stack Section */
.stack-section {
    padding: 60px 0;
}

.stack-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 32px;
    margin-top: 24px;
}

.stack-category {
    background-color: var(--bg-white);
    padding: 32px;
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.stack-category:hover {
    transform: translateY(-3px);
    box-shadow: var(--hover-shadow);
    border-color: var(--primary-color);
}

.stack-category h3 {
    font-size: 1.25rem;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-dark);
}

.stack-category h3 i {
    color: var(--primary-color);
}

.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.tech-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: var(--bg-light);
    color: var(--text-dark);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.tech-tag:hover {
    background-color: rgba(37, 99, 235, 0.05);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.tech-tag i {
    font-size: 1.1rem;
    color: var(--text-muted);
    transition: var(--transition);
}

.tech-tag:hover i {
    color: var(--primary-color);
    transform: scale(1.1);
}

/* Competencies Section */
.competencies-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
    max-width: 900px;
    margin: 0 auto;
}

.skill-tag {
    background-color: var(--bg-white);
    color: var(--text-dark);
    padding: 10px 20px;
    border-radius: 50px;
    font-weight: 500;
    font-size: 0.95rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
    transition: var(--transition);
    cursor: default;
}

.skill-tag:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Certifications Section */
.certs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 32px;
}

.cert-card {
    background-color: var(--bg-white);
    border-radius: 16px;
    padding: 32px;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.cert-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background-color: var(--accent-color);
    transition: var(--transition);
}

.cert-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--hover-shadow);
}

.cert-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.cert-icon {
    width: 48px;
    height: 48px;
    background-color: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 1.5rem;
}

.cert-year {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    background-color: var(--bg-light);
    padding: 4px 10px;
    border-radius: 6px;
}

.cert-card h3 {
    font-size: 1.25rem;
    margin-bottom: 4px;
}

.cert-card h4 {
    font-size: 1rem;
    color: var(--primary-color);
    margin-bottom: 8px;
    font-weight: 600;
}

.institution {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 16px;
}

.cert-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Projects Section */
/* Project Filters */
.project-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-bottom: 48px;
}

.filter-btn {
    background-color: var(--bg-white);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    padding: 10px 20px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.filter-btn:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.filter-btn.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.dark-mode .filter-btn {
    background-color: var(--bg-white);
    border-color: var(--border-color);
}

.dark-mode .filter-btn:hover {
    color: var(--text-dark);
    border-color: var(--primary-color);
}

.dark-mode .filter-btn.active {
    color: white;
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.project-category-group {
    margin-bottom: 64px;
    transition: var(--transition);
}

.project-category-group.hide {
    display: none;
}

.category-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 32px;
}

.category-header h3 {
    font-size: 1.4rem;
    font-weight: 700;
    white-space: nowrap;
    color: var(--text-dark);
}

.category-divider {
    flex: 1;
    height: 2px;
    background: linear-gradient(to right, var(--border-color), transparent);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 32px;
}

.project-card {
    background-color: var(--bg-white);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.4s ease-out forwards;
}

.project-card.hide {
    display: none;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--hover-shadow);
}

.project-img {
    height: 180px;
    background-color: var(--bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.img-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: white;
}

/* Gradients for project types */
.auditoria-bg {
    background: linear-gradient(135deg, #a855f7 0%, #6366f1 100%);
}

.automation-bg {
    background: linear-gradient(135deg, #3b82f6 0%, #06b6d4 100%);
}

.backend-bg {
    background: linear-gradient(135deg, #f97316 0%, #ef4444 100%);
}

.mobile-bg {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.manual-bg {
    background: linear-gradient(135deg, #64748b 0%, #475569 100%);
}

.project-content {
    padding: 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.project-header {
    margin-bottom: 16px;
}

.project-header h3 {
    font-size: 1.25rem;
    margin-bottom: 12px;
    line-height: 1.4;
}

.tech-badge-container {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.tech-badge {
    font-size: 0.7rem;
    background-color: var(--bg-light);
    color: var(--text-dark);
    padding: 3px 8px;
    border-radius: 6px;
    font-weight: 600;
    border: 1px solid var(--border-color);
}

.project-content p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 20px;
    line-height: 1.5;
    flex: 1;
}

.project-cta {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.btn-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.9rem;
}

.btn-link:hover {
    color: var(--accent-color);
}

.lang-badge {
    font-size: 0.75rem;
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--accent-color);
    border: 1px solid rgba(16, 185, 129, 0.2);
    padding: 3px 8px;
    border-radius: 6px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.dark-mode .lang-badge {
    background-color: rgba(16, 185, 129, 0.15);
}

/* Contact Section */
.contact-wrapper {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 64px;
    background-color: var(--bg-white);
    padding: 48px;
    border-radius: 20px;
    box-shadow: var(--card-shadow);
}

.contact-info h3 {
    font-size: 1.75rem;
    margin-bottom: 16px;
}

.contact-info p {
    color: var(--text-muted);
    margin-bottom: 32px;
}

.contact-item {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
}

.icon-box {
    width: 48px;
    height: 48px;
    background-color: var(--bg-light);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 1.25rem;
}

.info-content span {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: block;
    margin-bottom: 4px;
}

.info-content a,
.info-content p {
    color: var(--text-dark);
    font-weight: 600;
    margin: 0;
}

.social-links-big {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 32px;
}

.social-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    background-color: var(--bg-light);
    color: var(--text-dark);
    transition: var(--transition);
}

.social-btn:hover {
    background-color: var(--primary-color);
    color: white;
}

.social-btn.linkedin:hover {
    background-color: #0077b5;
}

.social-btn.github:hover {
    background-color: #333;
}

.social-btn.whatsapp:hover {
    background-color: #25d366;
}

.contact-form .form-group {
    margin-bottom: 20px;
}

.contact-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-dark);
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 14px 16px;
    background-color: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
    color: var(--text-dark);
    transition: var(--transition);
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.full-width {
    width: 100%;
    justify-content: center;
}

/* Footer */
footer {
    padding: 48px 0;
    background-color: var(--bg-white);
    border-top: 1px solid var(--border-color);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.footer-brand {
    font-size: 1.5rem;
    font-weight: 800;
}

.footer-brand span {
    color: var(--primary-color);
}

.footer-brand span span {
    color: var(--accent-color);
}

.footer-nav {
    display: flex;
    gap: 24px;
}

.footer-nav a {
    color: var(--text-muted);
    font-weight: 500;
}

.footer-nav a:hover {
    color: var(--primary-color);
}

.copyright {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Utilities: Reveal Animation */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.delay-100 {
    transition-delay: 0.1s;
}

.delay-200 {
    transition-delay: 0.2s;
}

.delay-300 {
    transition-delay: 0.3s;
}

.delay-400 {
    transition-delay: 0.4s;
}

/* Responsive */
@media (max-width: 992px) {
    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-content h1 {
        font-size: 2.5rem;
    }

    .hero p {
        margin: 0 auto 32px;
    }

    .hero-btns,
    .social-hero {
        justify-content: center;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }

    .contact-wrapper {
        grid-template-columns: 1fr;
    }

    .stack-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .hamburger {
        display: flex;
        flex-direction: column;
        gap: 6px;
        cursor: pointer;
    }

    .hamburger span {
        width: 24px;
        height: 2px;
        background-color: var(--text-dark);
        transition: var(--transition);
    }

    .hero {
        padding-top: 140px;
    }
}