/* --- VARIABLES --- */
:root {
    /* Variables por defecto (MODO OSCURO) */
    --bg-color: #0a0a0a;
    --surface-color: #161616;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --border-color: #222;
    --accent: #00f0ff;
    --accent-glow: rgba(0, 240, 255, 0.2);
    --font-main: 'Inter', sans-serif;
    --nav-height: 70px;
}

/* CLASE PARA MODO CLARO (Activada por JS) */
body.light-mode {
    --bg-color: #f4f4f4;
    --surface-color: #ffffff;
    --text-primary: #1a1a1a;
    --text-secondary: #555555;
    --border-color: #e0e0e0;
    --accent: #0070f3;
    --accent-glow: rgba(0, 112, 243, 0.2);
}

/* --- RESET BÁSICO --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-main);
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* --- CONTENEDORES Y SECCIONES --- */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

.section {
    display: block;
    width: 100%;
    padding: 100px 0;
    border-bottom: 1px solid var(--border-color);
}

.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    justify-content: center;
}

.section-title span {
    color: var(--accent);
    font-family: monospace;
    font-size: 12px;
}

.section-title-left {
    justify-content: flex-start;
    color: var(--accent);
    font-family: monospace;
    font-size: 12px;
    margin-bottom: 20px;
}

.text-gradient,
.text-highlight {
    color: var(--accent);
}

.center-heading {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
}

/* --- NAVBAR --- */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    height: var(--nav-height);
    padding: 0 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--bg-color);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #222;
    z-index: 1000;
    transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Modo oscuro explícito para navbar */
body:not(.light-mode) .navbar {
    background-color: rgba(10, 10, 10, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Modo claro para navbar */
body.light-mode .navbar {
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.navbar nav {
    margin-left: auto;
    margin-right: 2rem;
}

.logo {
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--text-primary);
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    list-style: none;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.3s;
}

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

/* --- BOTONES DE LA BARRA DE NAVEGACIÓN --- */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.icon-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--accent);
    border-color: var(--accent);
}

/* Ajustes de icon-btn en modo claro */
body.light-mode .icon-btn {
    border-color: rgba(0, 0, 0, 0.1);
}

body.light-mode .icon-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

/* --- BOTONES GENERALES --- */
.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgb(34, 34, 34);
}

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

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.2);
}

.btn-outline:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.2);
}

/* --- HERO SECTION --- */
.hero-section {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding-top: var(--nav-height);
}

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

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

.hero-buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

/* Iconos Sociales Circulares */
.social-icons {
    display: flex;
    gap: 15px;
}

.social-link {
    width: 45px;
    height: 45px;
    border: 1px solid #333;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all 0.3s;
    font-size: 1.2rem;
}

.social-link:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* --- SECCIÓN SOBRE MI --- */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    padding-bottom: 100px;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.stat-card {
    background: var(--surface-color);
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    border: 1px solid #222;
}

.stat-card i {
    font-size: 2rem;
    color: var(--accent);
    margin-bottom: 10px;
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.2);
}

/* --- SKILLS --- */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.skill-card {
    background: var(--surface-color);
    padding: 30px;
    border-radius: 12px;
    border: 1px solid #222;
}

.skill-card h3 {
    margin-bottom: 20px;
}

.skill-bar-wrapper {
    margin-bottom: 15px;
}

.skill-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    margin-bottom: 5px;
    color: var(--text-secondary);
}

/* Estilos preparados para barras de progreso (uso futuro) */
.progress-bar {
    width: 100%;
    height: 6px;
    background: #333;
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar .fill {
    height: 100%;
    background: var(--accent);
    border-radius: 3px;
}

.skill-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.2);
}

/* --- PROJECTS CARDS --- */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.project-card {
    background: var(--surface-color);
    border-radius: 12px;
    padding: 30px;
    border: 1px solid #222;
    transition: transform 0.3s;
}

.project-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.2);
}

.card-header {
    margin-bottom: 20px;
}

.tags {
    display: block;
    gap: 10px;
}

.tag {
    font-size: 0.8rem;
    color: var(--accent);
    background: rgba(0, 240, 255, 0.1);
    padding: 4px 12px;
    border-radius: 20px;
}

.card-body h3 {
    margin-bottom: 10px;
    font-size: 1.4rem;
}

.card-body p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 20px;
}

.card-links {
    display: flex;
    gap: 20px;
}

.card-links a {
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
}

.card-links a:hover {
    color: var(--accent);
}

/* --- CONTACTO --- */
.contact-wrapper {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 50px;
}

.info-item {
    display: flex;
    align-items: center;
    margin-top: 30px;
}

.icon-box {
    width: 50px;
    height: 50px;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    color: var(--accent);
    font-size: 1.5rem;
    margin-right: 15px;
}

.contact-form {
    background: var(--surface-color);
    padding: 40px;
    border-radius: 15px;
    border: 1px solid var(--border-color);
}

.form-group {
    margin-bottom: 20px;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 15px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.full-width {
    width: 100%;
}

/* --- TIMELINE EXPERIENCE --- */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    padding-left: 40px;
}

/* La línea vertical degradada */
.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 5px;
    width: 2px;
    height: 100%;
    background: linear-gradient(to bottom, var(--accent), transparent);
}

.timeline-item {
    position: relative;
    margin-bottom: 3rem;
}

/* El punto brillante en la línea */
.timeline-dot {
    position: absolute;
    left: -46px;
    top: 0;
    width: 14px;
    height: 14px;
    background: var(--bg-color);
    border: 2px solid var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent-glow);
    z-index: 2;
}

.timeline-date {
    font-family: monospace;
    font-size: 0.9rem;
    color: var(--accent);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

/* Tarjeta de contenido */
.timeline-content {
    background: var(--surface-color);
    border: 1px solid #222;
    padding: 1.5rem 2rem;
    border-radius: 12px;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.timeline-content:hover {
    transform: translateX(5px);
    border-color: var(--accent);
}

.timeline-content h3 {
    font-size: 1.2rem;
    margin-bottom: 0.3rem;
    color: var(--text-primary);
}

.timeline-content .company {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

.timeline-content p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1rem;
}

/* Tags pequeños dentro de la experiencia */
.timeline-tags {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.timeline-tags span {
    font-size: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 10px;
    border-radius: 4px;
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* --- FOOTER --- */
footer {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* --- RESPONSIVE & MOBILE MENU --- */
@media (max-width: 768px) {

    /* Menú navegación lateral */
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 70%;
        height: 100vh;
        background-color: var(--surface-color);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2rem;
        transition: right 0.4s ease;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.5);
        z-index: 100;
        padding: 2rem;
    }

    /* Clase que agrega JS para mostrar el menú */
    .nav-links.active {
        right: 0;
    }

    .mobile-toggle {
        display: block;
        font-size: 1.8rem;
        background: none;
        border: none;
        color: var(--text-primary);
        cursor: pointer;
        z-index: 101;
    }

    /* Tipografía */
    .hero-content h1 {
        font-size: 2.5rem;
    }

    /* Grids de 2 columnas a 1 columna */
    .about-grid,
    .contact-wrapper,
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .contact-wrapper {
        padding: 0 10px;
    }

    .contact-form {
        padding: 20px;
    }
}

/* Ocultar botón menú en escritorio */
@media (min-width: 769px) {
    .mobile-toggle {
        display: none;
    }
}
