:root {
    --primary: #1e3a8a;
    /* Professional blue */
    --accent: #3b82f6;
    /* Bright blue */
    --text-main: #1e293b;
    --text-muted: #64748b;
    --bg-light: #f8fafc;
    --primary-600: #2563eb;  /* header gradient stop */
    --blue-100: #bfdbfe;     /* h2 subtitle */
    --blue-50: #e0e7ff;      /* contact info text */
    --blue-300: #93c5fd;     /* contact info icons */
}

* {
    box-sizing: border-box;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.5;
    color: var(--text-main);
    background: white;
    margin: 0;
    padding: 0;
    font-size: 10pt;
}

.container {
    max-width: 210mm;
    /* A4 width */
    margin: 0 auto;
    padding: 30px 0;
}

/* HEADER */
body .container > header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-600) 100%);
    color: white;
    padding: 18px 30px;
    margin: -30px 0 12px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.header-left {
    flex: 1;
}

.container > header .header-content h1 {
    font-size: 20pt;
    font-weight: 800;
    margin: 0 0 5px 0;
    color: white;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.container > header .header-content h2 {
    font-size: 13pt;
    font-weight: 400;
    margin: 0 0 12px 0;
    color: var(--blue-100);
    letter-spacing: 0.3px;
}

.contact-info {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 9pt;
    color: var(--blue-50);
}

.contact-info div {
    display: flex;
    align-items: center;
    gap: 5px;
}

.contact-info i {
    color: var(--blue-300);
    width: 14px;
    text-align: center;
}

.header-photo {
    width: 120px;
    height: 120px;
    border-radius: 12px;
    overflow: hidden;
    border: 4px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
}

.header-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Placeholder si no hay foto */
.header-photo.placeholder {
    background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0.05));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36pt;
    font-weight: 700;
    color: rgba(255,255,255,0.3);
}

/* SECTIONS */
.section {
    margin-bottom: 1.2em;
    padding: 0 30px;
}

.section-title {
    font-size: 11pt;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--primary);
    border-bottom: 2px solid var(--accent);
    padding-bottom: 5px;
    margin-bottom: 6px;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title i {
    font-size: 13pt;
    color: var(--accent);
}

/* PROFILE */
.profile-text {
    font-size: 9.5pt;
    text-align: justify;
    line-height: 1.5;
}

/* EXPERIENCE */
.experience-item {
    margin-bottom: 8px;
}

.exp-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 2px;
}

.exp-title {
    font-weight: 700;
    font-size: 10.5pt;
    color: var(--text-main);
}

.exp-period {
    font-size: 9pt;
    color: var(--text-muted);
    font-weight: 500;
}

.exp-company {
    font-size: 9.5pt;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 5px;
}

.exp-desc {
    font-size: 9pt;
    margin-bottom: 6px;
    color: var(--text-main);
    line-height: 1.4;
}

.exp-achievements {
    font-size: 9.5pt;
    padding-left: 15px;
    margin: 5px 0 0 0;
    color: var(--text-muted);
}

.exp-achievements li {
    margin-bottom: 4px;
    line-height: 1.4;
}

/* SKILLS */
.skills-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.skill-category h3 {
    font-size: 9.5pt;
    font-weight: 700;
    margin: 0 0 6px 0;
    color: var(--primary);
}

.skill-level {
    font-size: 8pt;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.skill-list {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 8.5pt;
}

.skill-list li {
    margin-bottom: 2px;
    padding-left: 12px;
    position: relative;
    line-height: 1.3;
}

.skill-list li::before {
    content: "▸";
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: bold;
}

/* CERTIFICATIONS */
.cert-item {
    margin-bottom: 7px;
}

.cert-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.cert-name {
    font-weight: 700;
    font-size: 9.5pt;
    color: var(--text-main);
}

.cert-year {
    color: var(--text-muted);
    font-size: 8.5pt;
    font-weight: 600;
}

.cert-issuer {
    font-size: 8.5pt;
    color: var(--accent);
    font-weight: 500;
}

.cert-id {
    font-size: 8pt;
    color: var(--text-muted);
    font-family: 'Courier New', monospace;
}

/* EDUCATION */
.edu-item {
    margin-bottom: 7px;
}

.edu-degree {
    font-weight: 700;
    font-size: 9.5pt;
}

.edu-institution {
    font-size: 9pt;
    color: var(--accent);
}

.edu-year {
    font-size: 8.5pt;
    color: var(--text-muted);
}

/* LANGUAGES */
.lang-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.lang-item {
    font-size: 9pt;
}

.lang-name {
    font-weight: 700;
    color: var(--text-main);
}

.lang-level {
    font-size: 8.5pt;
    color: var(--text-muted);
}

/* PAGE BREAK - Deshabilitado para flujo continuo */
/* .page-break {
    page-break-after: always;
} */

/* PRINT SETTINGS */
@media print {
    nav { display: none !important; }
    /* Primera página sin margen superior */
    @page :first {
        margin-top: 0 !important;
        margin-bottom: 15mm;
        margin-left: 0;
        margin-right: 0;
    }

    /* Resto de páginas con margen superior */
    @page {
        margin-top: 10mm;
        margin-bottom: 15mm;
        margin-left: 0;
        margin-right: 0;
    }

    body {
        margin: 0;
        padding: 0;
    }

    .container {
        padding: 0;
        width: 100%;
        max-width: none;
    }

    header {
        margin: 0;
        padding: 16px 20mm;
    }

    .section {
        margin-bottom: 1em;
        page-break-inside: auto;
        padding: 0 20mm;
    }

    .no-print {
        display: none;
    }

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

.print-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--primary);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-family: inherit;
    font-weight: 600;
    border: none;
    transition: all 0.3s;
    z-index: 1000;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.print-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.back-btn {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: #334155;
    color: #e2e8f0;
    padding: 12px 24px;
    border-radius: 8px;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.875rem;
    z-index: 1000;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s;
}

.back-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
    background: #475569;
}

/* METRICS BOX */
.metrics {
    display: flex;
    gap: 15px;
    margin: 15px 0;
    padding: 12px;
    background: var(--bg-light);
    border-left: 3px solid var(--accent);
}

.metric-item {
    text-align: center;
}

.metric-value {
    font-size: 16pt;
    font-weight: 700;
    color: var(--primary);
    display: block;
}

.metric-label {
    font-size: 8pt;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* PROJECTS */
.project-item {
    margin-bottom: 8px;
}

.project-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 6px;
}

.project-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 8px;
    color: white;
    font-size: 20px;
}

.project-content {
    flex: 1;
}

.project-title {
    font-weight: 700;
    font-size: 10pt;
    color: var(--primary);
    margin-bottom: 4px;
}

.project-tech {
    font-size: 8.5pt;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 6px;
}

.project-desc {
    font-size: 9pt;
    line-height: 1.4;
    color: var(--text-main);
}
