/* --- VARIABLES & RESET (Paleta Futurista Clean) --- */
:root {
    --primary-dark: #0f172a;   /* Azul muy oscuro (casi negro) */
    --sidebar-bg: #1e293b;     /* Gris azulado oscuro */
    --accent: #06b6d4;         /* Cian eléctrico (Futurista) */
    --accent-hover: #0891b2;
    --text-main: #334155;      /* Gris oscuro para lectura */
    --text-light: #f1f5f9;     /* Blanco humo */
    --bg-body: #e2e8f0;        /* Gris claro fondo general */
    --white: #ffffff;
    
    --font-heading: 'Montserrat', sans-serif;
    --font-body: 'Roboto', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    display: flex;
    justify-content: center;
    min-height: 100vh;
    padding: 40px 20px;
}

/* --- LAYOUT PRINCIPAL --- */
.cv-wrapper {
    display: grid;
    grid-template-columns: 300px 1fr; /* Sidebar fija 300px, resto flexible */
    background-color: var(--white);
    width: 100%;
    max-width: 1100px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
    border-radius: 8px;
    overflow: hidden; /* Para que el border-radius funcione */
}

/* --- SIDEBAR (Izquierda) --- */
.sidebar {
    background-color: var(--sidebar-bg);
    color: var(--text-light);
    padding: 40px 25px;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Perfil */
.profile-container {
    text-align: center;
    margin-bottom: 10px;
}

.img-border {
    width: 140px;
    height: 140px;
    margin: 0 auto 20px;
    padding: 5px;
    border: 2px solid var(--accent); /* Borde neón */
    border-radius: 50%;
}

.profile-container img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    background-color: #fff;
}

.profile-container h1 {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: 1px;
    margin-bottom: 5px;
    text-transform: uppercase;
}

.profile-container .role {
    color: var(--accent);
    font-size: 0.9rem;
    font-weight: 500;
}

/* Secciones Sidebar */
.sidebar-section h3 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    padding-bottom: 10px;
    margin-bottom: 15px;
    color: var(--white);
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-section h3 i {
    color: var(--accent);
}

/* Contacto */
.contact-info ul {
    list-style: none;
}

.contact-info li {
    margin-bottom: 15px;
    font-size: 0.9rem;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    word-break: break-all;
}

.contact-info a {
    color: var(--text-light);
    text-decoration: none;
    transition: color 0.3s;
}

.contact-info a:hover {
    color: var(--accent);
}

/* Skills (Tags visuales) */
.skills-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.skills-tags span {
    background-color: rgba(6, 182, 212, 0.15); /* Fondo translúcido */
    color: var(--accent);
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid rgba(6, 182, 212, 0.3);
}

/* Educación y Certificaciones */
.edu-item {
    margin-bottom: 15px;
}
.edu-item strong {
    display: block;
    color: var(--accent);
    font-size: 0.95rem;
}
.edu-item p {
    font-size: 0.85rem;
    color: #cbd5e1;
}

.simple-list {
    list-style: none;
}
.simple-list li {
    margin-bottom: 10px;
    font-size: 0.85rem;
    position: relative;
    padding-left: 15px;
}
.simple-list li::before {
    content: "•";
    color: var(--accent);
    position: absolute;
    left: 0;
}

/* --- MAIN CONTENT (Derecha) --- */
.main-content {
    padding: 50px 60px;
    background-color: var(--white);
}

.section-title {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    color: var(--primary-dark);
    margin-bottom: 25px;
    font-weight: 700;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    width: 50px;
    height: 4px;
    background-color: var(--accent);
    bottom: -8px;
    left: 0;
    border-radius: 2px;
}

/* Resumo */
.summary-section {
    margin-bottom: 50px;
}
.summary-section p {
    font-size: 1.05rem;
    color: #475569;
    text-align: justify;
}

/* --- TIMELINE DE EXPERIENCIA (Estilo Moderno) --- */
.timeline {
    position: relative;
    border-left: 2px solid #e2e8f0; /* Línea vertical */
    margin-left: 10px;
    padding-left: 30px;
}

.timeline-item {
    position: relative;
    margin-bottom: 40px;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

/* Punto en la línea de tiempo */
.timeline-marker {
    position: absolute;
    left: -37px; /* Ajuste para centrar en la línea */
    top: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--white);
    border: 3px solid var(--accent);
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.2);
}

/* Header del trabajo (Título + Fecha) */
.job-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
    flex-wrap: wrap;
}

.job-header h3 {
    font-size: 1.2rem;
    color: var(--primary-dark);
    font-weight: 700;
}

.date {
    background-color: #f1f5f9;
    color: var(--primary-dark);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.company {
    font-style: italic;
    color: #64748b;
    margin-bottom: 15px;
    font-weight: 500;
}

.timeline-content ul {
    list-style: none;
}

.timeline-content li {
    margin-bottom: 8px;
    position: relative;
    padding-left: 20px;
    font-size: 0.95rem;
}

.timeline-content li::before {
    content: "▹"; /* Flecha pequeña */
    color: var(--accent);
    position: absolute;
    left: 0;
    font-weight: bold;
}

/* Highlight para el CEO role */
.timeline-item.highlight .timeline-marker {
    background-color: var(--accent);
    border-color: var(--primary-dark);
}

.timeline-item.highlight .timeline-content {
    background-color: #f8fafc; /* Fondo muy sutil */
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid var(--accent);
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
}

/* --- RESPONSIVE DESIGN --- */
@media (max-width: 850px) {
    .cv-wrapper {
        max-width: 900px;
        grid-template-columns: 260px 1fr;
    }
    .sidebar {
        padding: 28px 20px;
    }
    .main-content {
        padding: 36px 28px;
    }
    .img-border {
        width: 120px;
        height: 120px;
    }
}

@media (max-width: 600px) {
    /* Asegura márgenes iguales a ambos lados y centrado */
    body {
        padding: 12px; /* simétrico: igual margen izquierdo y derecho */
    }

    .cv-wrapper {
        grid-template-columns: 1fr;
        width: 100%;
        max-width: 700px;
        margin: 0 auto; /* centra horizontalmente */
        box-shadow: none;
        border-radius: 8px;
        overflow: visible;
    }

    /* Sidebar pasa arriba, diseño más compacto */
    .sidebar {
        width: 100%;
        padding: 16px;
        display: flex;
        flex-direction: column;
        gap: 14px;
    }

    /* Perfil en fila compacta para ahorrar espacio */
    .profile-container {
        display: flex;
        align-items: center;
        gap: 12px;
        text-align: left;
    }
    .img-border {
        width: 88px;
        height: 88px;
        margin: 0;
        padding: 3px;
    }
    .profile-container h1 {
        font-size: 1.05rem;
        margin-bottom: 0;
    }
    .profile-container .role {
        font-size: 0.78rem;
    }

    /* Contenido principal con padding equilibrado */
    .main-content {
        padding: 18px;
    }
    .section-title {
        font-size: 1.4rem;
    }

    /* Proyectos y timeline en una columna */
    .project-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .project-card {
        padding: 12px;
    }

    .timeline {
        padding-top: 8px;
    }
    .timeline-item {
        padding: 12px 0;
    }

    /* Ajustes generales para listas y tags */
    .skills-tags span {
        font-size: 0.72rem;
        padding: 4px 8px;
    }
    .contact-info li {
        font-size: 0.86rem;
    }

    /* Si quieres margen derecho mayor, modifica aquí (ejemplo: 20px) */
    /* .cv-wrapper { padding-right: 20px; } */
}