@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&family=Inter:wght@400;500;600&display=swap');

:root {
    --bg-main: #0f172a;
    --cv-bg: #ffffff;
    --cv-text: #334155;
    --cv-text-light: #64748b;
    --primary: #1e40af; /* Azul oscuro corporativo */
    --primary-dark: #1e3a8a; /* Azul marino profundo */
    --secondary: #3b82f6; /* Azul eléctrico / Celeste sobrio */
    --accent: #0284c7;
    
    --header-bg: #111827; /* Gris muy oscuro, casi negro, para el encabezado */
    --sidebar-bg: #f8fafc;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-main);
    color: #f8fafc;
    margin: 0;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.container { width: 100%; max-width: 1000px; }

/* UI Controles */
.no-print {
    width: 100%;
    max-width: 210mm;
    background: #1e293b;
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    border-left: 4px solid var(--secondary);
    box-sizing: border-box;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: opacity 0.3s, transform 0.1s;
    font-family: 'Outfit', sans-serif;
    display: inline-block;
}
.btn:hover { opacity: 0.9; transform: translateY(-2px); }

.card { background: #1e293b; padding: 2rem; border-radius: 12px; margin-bottom: 2rem; }
.form-group { margin-bottom: 1.5rem; }
.form-group label { display: block; margin-bottom: 0.5rem; font-weight: 500; }
.form-control { width: 100%; padding: 0.75rem; border-radius: 8px; border: 1px solid #334155; background: #0f172a; color: white; font-family: inherit; box-sizing: border-box; }
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2); }
textarea.form-control { min-height: 200px; resize: vertical; }

/* Página CV (A4) */
.cv-page {
    width: 210mm;
    min-height: 297mm;
    background: var(--cv-bg);
    color: var(--cv-text);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
}

/* Tarjetas de Cursos (Reemplazo de la tabla) */
.courses-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}
.course-card {
    background: var(--sidebar-bg);
    border-left: 4px solid var(--primary-dark);
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    break-inside: avoid;
}
.course-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}
.course-aircraft {
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--secondary);
    text-transform: uppercase;
}
.course-date {
    font-size: 0.75rem;
    color: var(--cv-text-light);
    font-weight: 600;
    background: #e2e8f0;
    padding: 2px 6px;
    border-radius: 4px;
}
.course-name {
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    color: var(--cv-text);
    line-height: 1.3;
}
.course-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.8rem;
    color: var(--cv-text-light);
}

/* Header Replicando el PDF */
.cv-header {
    background: var(--header-bg);
    padding: 2.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    border-bottom: 4px solid var(--primary);
    position: relative;
    overflow: visible;
    flex-wrap: wrap;
    gap: 2rem;
}

.header-left {
    flex: 1;
    min-width: 0;
}

.header-right {
    width: 180px;
    margin-left: 2rem;
    margin-right: 1rem; /* Añadir espacio extra a la derecha */
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    align-items: center;
}

.contact-col p {
    color: white;
    margin-right: 0.5rem;
    font-size: 1.2rem;
    line-height: 1;
}

.qr-overlay-container {
    position: absolute;
    bottom: -15px;
    left: -25px;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 20;
}
.qr-image-wrapper {
    width: 64px;
    height: 64px;
    background: white;
    padding: 4px;
    border-radius: 8px;
    border: 2px solid var(--secondary);
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}
.qr-label {
    background: #0077b5; /* LinkedIn Blue */
    color: white;
    font-size: 0.65rem;
    font-weight: bold;
    padding: 3px 10px;
    border-radius: 10px;
    margin-top: -2px; /* Just touches the border, doesn't overlap the code */
    z-index: 21;
    font-family: 'Outfit', sans-serif;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

/* El Pill Magenta del nombre */
.name-pill {
    background: var(--secondary); /* Color rosa/magenta brillante */
    border-radius: 9999px;
    padding: 0.5rem 2rem;
    display: inline-block;
    margin-bottom: 1rem;
    align-self: flex-start;
    text-align: center;
}

.name-pill h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 2.2rem; /* Reduced to fit better */
    font-weight: 800;
    margin: 0;
    color: white;
    letter-spacing: 1px;
    white-space: normal; /* Permitir wrap si es muy largo */
    line-height: 1.2;
    text-align: center;
}

.header-left h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.3rem;
    font-weight: 600;
    color: #f1f5f9;
    margin: 0;
    padding-left: 1rem; /* Alinear visualmente un poco con el pill */
}

/* Foto Perfil */
.header-right {
    position: relative;
    z-index: 10;
}
.profile-pic-container {
    width: 180px;
    height: 220px;
    border-radius: 16px;
    overflow: hidden;
    border: 3px solid rgba(255,255,255,0.8);
    box-shadow: 0 10px 25px rgba(0,0,0,0.4);
    background: #e2e8f0; /* fallback */
    margin-top: -0.5rem;
}
.profile-pic-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
}

/* Resumen Ancho Completo */
.cv-summary-full {
    padding: 2rem 2.5rem 1rem 2.5rem;
    background: var(--cv-bg);
    border-bottom: 1px solid #e2e8f0;
    box-sizing: border-box;
}

.cv-summary-full p {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--cv-text);
}

/* Layout 2 Columnas */
.cv-body {
    display: grid;
    grid-template-columns: 32% 68%;
    min-height: calc(297mm - 280px);
}

/* Columna Izquierda (Sidebar) */
.cv-sidebar {
    background: var(--sidebar-bg);
    padding: 2.5rem 2rem;
    border-right: 1px solid #e2e8f0;
}

/* Columna Derecha (Main) */
.cv-main {
    padding: 2.5rem;
}

/* Títulos de Sección idénticos al PDF */
.section-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.3rem;
    font-weight: 800;
    color: white;
    background: var(--secondary);
    border-radius: 9999px;
    padding: 0.3rem 1.2rem;
    margin-top: 0;
    margin-bottom: 1.5rem;
    display: inline-block;
    text-align: center;
}
.cv-main .section-title {
    font-size: 1.4rem;
}
/* Modificador para títulos púrpura si queremos variar */
.title-purple {
    background: var(--primary-dark);
}

/* Acerca de mi */
.summary-text {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--cv-text);
    margin-bottom: 2.5rem;
    text-align: justify;
}

/* Skills (Progress Bars) */
.skills-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 2.5rem;
}
.skill-item { width: 100%; }
.skill-name {
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
    color: var(--cv-text);
}
.skill-bar {
    height: 6px;
    background: #cbd5e1;
    border-radius: 3px;
    overflow: hidden;
}
.skill-fill {
    height: 100%;
    background: var(--primary-dark);
    border-radius: 3px;
}

/* Experiencia / Timeline */
.exp-item {
    margin-bottom: 2rem;
    border-left: 3px solid var(--secondary);
    padding-left: 1rem;
}
.exp-item:last-child { margin-bottom: 0; }

.exp-header { margin-bottom: 0.5rem; }
.exp-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--cv-text);
    margin: 0 0 0.1rem 0;
}
.exp-company {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary-dark);
    margin: 0;
}
.exp-date {
    font-size: 0.85rem;
    color: var(--cv-text-light);
    font-weight: 500;
}

.exp-bullets {
    margin: 0;
    padding-left: 1rem;
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--cv-text);
}
.exp-bullets li { margin-bottom: 0.3rem; }
.exp-bullets li::marker { color: var(--secondary); font-size: 1.2em; }

/* Educación (similar estilo) */
.edu-item {
    margin-bottom: 1.5rem;
    padding-left: 1rem;
    border-left: 3px solid var(--primary-dark);
}
.edu-item:last-child { margin-bottom: 0; }
.edu-degree {
    font-family: 'Outfit', sans-serif;
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--cv-text);
    margin: 0 0 0.2rem 0;
}
.edu-inst {
    font-size: 0.85rem;
    color: var(--cv-text-light);
    margin: 0;
}

@media print {
    @page {
        size: A4 portrait;
        margin: 0;
    }
    body { 
        background: white; 
        padding: 0; 
        margin: 0;
        display: block; 
    }
    .no-print { display: none !important; }
    .cv-page {
        box-shadow: none;
        border: none;
        width: 100%;
        height: auto; /* Permite que el contenido fluya a múltiples páginas */
        margin: 0;
    }
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
}

.cv-section { padding: 0 2.5rem; }
