/* =====================================================
   Resume styles — oscargbocanegra.github.io
   Extracted from resume.html inline <style>
   ===================================================== */

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #1e293b;
    background: #f1f5f9;
    min-height: 100vh;
    padding: 20px;
}

.resume-container {
    max-width: 1200px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
    overflow: hidden;
    display: grid;
    grid-template-columns: 293px 1fr;
}

/* Sidebar Styles */
.sidebar {
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
    color: #f8fafc;
    padding: 0;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.sidebar::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 100%;
    background: linear-gradient(135deg, rgba(59,130,246,0.1) 0%, transparent 40%);
    pointer-events: none;
}

.profile-section {
    text-align: center;
    position: relative;
    background: rgba(255,255,255,0.02);
    padding: 36px 24px 28px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    z-index: 2;
}

.profile-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(59,130,246,0.15);
    border: 2px solid rgba(59,130,246,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: #93c5fd;
    font-family: 'Inter', sans-serif;
}

.profile-role {
    font-size: 0.88rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 6px;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.profile-stack {
    font-size: 0.68rem;
    color: #60a5fa;
    font-weight: 500;
    line-height: 1.6;
    opacity: 0.9;
}

.sidebar-section {
    margin-bottom: 0;
    position: relative;
    padding: 24px 28px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    z-index: 2;
}

.sidebar-section:last-child {
    border-bottom: none;
    padding-bottom: 40px;
}

.sidebar-section h2 {
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 18px;
    padding-bottom: 8px;
    position: relative;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: #94a3b8;
}

.sidebar-section h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 30px;
    height: 2px;
    background: #3b82f6;
}

.sidebar-section h2 i {
    margin-right: 8px;
    opacity: 0.9;
    color: #60a5fa;
}

.contact-item {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    padding: 4px 0;
}

.contact-item i {
    width: 20px;
    margin-right: 12px;
    color: #60a5fa;
    font-size: 0.9rem;
}

.contact-item a, .contact-item span {
    color: #cbd5e1;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 400;
    transition: color 0.2s ease;
    word-break: break-word;
}

.contact-item a:hover {
    color: #ffffff;
}

.skill-item {
    margin-bottom: 14px;
}

.skill-name {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    color: #f1f5f9;
}

.skill-name span:last-child {
    color: #94a3b8;
    font-weight: 600;
    font-size: 0.75rem;
}

.skill-bar {
    height: 4px;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    overflow: hidden;
}

.skill-progress {
    height: 100%;
    background: #3b82f6;
    border-radius: 4px;
    animation: skillLoad 1.5s ease-in-out;
}

@keyframes skillLoad {
    from { width: 0; }
}

.certification-badge {
    display: inline-block;
    background: rgba(255,255,255,0.06);
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    margin: 3px 3px 3px 0;
    border: 1px solid rgba(255,255,255,0.1);
    font-weight: 400;
    color: #e2e8f0;
    transition: background 0.2s ease, transform 0.2s ease;
}

.certification-badge:hover {
    background: rgba(255,255,255,0.12);
    transform: translateY(-1px);
}

.language-item {
    padding: 6px 0;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
}

.language-flag {
    font-size: 1.1rem;
    margin-right: 10px;
}

.sidebar-download-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    background: #2563eb;
    color: white;
    text-decoration: none;
    padding: 12px 20px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
    border: 1px solid rgba(255,255,255,0.1);
    cursor: pointer;
    font-family: inherit;
}

.sidebar-download-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none !important;
}

.sidebar-download-btn i {
    margin-right: 8px;
    font-size: 1rem;
}

.sidebar-download-btn:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.3);
    color: white;
}

/* Main Content Styles */
.main-content {
    padding: 40px 48px;
    background: #ffffff;
    overflow-y: auto;
}

.header-section {
    margin-bottom: 32px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e2e8f0;
    position: relative;
}

.header-section::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 60px;
    height: 2px;
    background: #2563eb;
}

.name-title {
    font-size: 2.2rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.professional-title {
    font-size: 0.95rem;
    color: #475569;
    font-weight: 500;
    margin-bottom: 12px;
    letter-spacing: 0.2px;
    line-height: 1.5;
}

.section {
    margin-bottom: 36px;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 18px;
    position: relative;
    padding-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid #e2e8f0;
}

/* Extracto Profesional */
.section > p {
    color: #334155;
    font-size: 0.95rem;
}

.section > p strong {
    color: #0f172a;
}

.tech-category {
    margin-bottom: 18px;
}

.tech-category h3 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: #334155;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tech-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tech-badge {
    background: #f1f5f9;
    color: #334155;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.78rem;
    font-weight: 500;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

.tech-badge:hover {
    background: #e2e8f0;
    color: #0f172a;
    border-color: #cbd5e1;
    transform: translateY(-1px);
}

.experience-item {
    margin-bottom: 24px;
    padding: 0 0 24px 0;
    background: transparent;
    border-radius: 0;
    border-bottom: 1px solid #f1f5f9;
    transition: none;
    position: relative;
}

.experience-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.experience-item:hover {
    box-shadow: none;
    transform: none;
}

.job-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
    flex-wrap: wrap;
    gap: 8px;
}

.job-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 2px;
}

.company-name {
    font-size: 0.95rem;
    color: #2563eb;
    font-weight: 600;
}

.job-period {
    background: #f1f5f9;
    color: #475569;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    border: 1px solid #e2e8f0;
}

.job-location {
    color: #64748b;
    font-size: 0.85rem;
    margin-bottom: 12px;
    font-style: normal;
}

.job-achievements {
    list-style: none;
    margin-top: 10px;
}

.job-achievements li {
    margin-bottom: 8px;
    padding-left: 18px;
    position: relative;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #334155;
}

.job-achievements li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    width: 5px;
    height: 5px;
    background-color: #94a3b8;
    border-radius: 50%;
}

.education-item {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 16px;
    margin-bottom: 16px;
    padding: 0;
    background: transparent;
    border: none;
}

.education-content h3 {
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 2px;
}

.education-content p {
    color: #475569;
    font-size: 0.88rem;
    margin-bottom: 2px;
    font-weight: 500;
}

.education-year {
    background: #f8fafc;
    color: #475569;
    padding: 6px 12px;
    border-radius: 4px;
    font-weight: 600;
    text-align: center;
    align-self: start;
    font-size: 0.8rem;
    border: 1px solid #e2e8f0;
}

.download-section {
    display: none; /* Replaced by sidebar button */
}

/* Language Toggle Button */
.language-toggle {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 1000;
}

.language-toggle button {
    background: #ffffff;
    color: #0f172a;
    border: 1px solid #e2e8f0;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.language-toggle button:hover {
    border-color: #cbd5e1;
    transform: translateY(-1px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
}

/* Language visibility — controlled by body class */
/* Default: ES visible, EN hidden */
.lang-en { display: none; }

/* When body has .lang-en-active: EN visible, ES hidden */
body.lang-en-active .lang-en { display: block; }
body.lang-en-active .lang-es { display: none; }

/* Print: enforce language visibility explicitly */
@media print {
    .lang-en { display: none !important; }
    body.lang-en-active .lang-en { display: block !important; }
    body.lang-en-active .lang-es { display: none !important; }
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .resume-container {
        grid-template-columns: 1fr;
        border-radius: 15px;
    }

    .sidebar {
        padding: 30px 25px;
    }

    .main-content {
        padding: 30px 25px;
    }

    .name-title {
        font-size: 2rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .job-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .education-item {
        grid-template-columns: 1fr;
    }
}

/* =====================================================
   SIDEBAR — Nuevos componentes
   ===================================================== */

/* Educación compacta */
.edu-item {
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.edu-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}
.edu-year {
    display: inline-block;
    background: rgba(59,130,246,0.2);
    color: #93c5fd;
    font-size: 0.68rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 3px;
    margin-bottom: 4px;
}
.edu-degree {
    font-size: 0.8rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 2px;
    line-height: 1.3;
}
.edu-school {
    font-size: 0.7rem;
    color: #94a3b8;
}

/* Tech badges */
.badge-group-label {
    font-size: 0.62rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin: 10px 0 5px 0;
}
.badge-group {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 4px;
}
.tech-pill {
    display: inline-block;
    background: rgba(59,130,246,0.15);
    color: #93c5fd;
    border: 1px solid rgba(59,130,246,0.25);
    padding: 2px 7px;
    border-radius: 3px;
    font-size: 0.68rem;
    font-weight: 500;
    line-height: 1.6;
}

/* Certificaciones */
.cert-item {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.75rem;
    color: #cbd5e1;
    margin-bottom: 7px;
    line-height: 1.3;
}
.cert-item i {
    color: #3b82f6;
    font-size: 0.65rem;
    flex-shrink: 0;
}

/* Idiomas */
.lang-item {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 8px;
    font-size: 0.78rem;
}
.lang-flag {
    font-size: 1rem;
}
.lang-name {
    color: #f1f5f9;
    font-weight: 500;
    flex: 1;
}
.lang-level {
    color: #60a5fa;
    font-size: 0.68rem;
    font-weight: 500;
}

/* =====================================================
   MAIN CONTENT — Nuevos componentes
   ===================================================== */

/* Job meta (ubicación) */
.job-meta {
    color: #64748b;
    font-size: 0.82rem;
    margin-bottom: 8px;
    font-style: italic;
}
.job-meta i {
    margin-right: 4px;
    font-size: 0.75rem;
}

/* Experiencia compacta (2012-2014) */
.experience-compact .company-name {
    color: #64748b;
    font-size: 0.85rem;
}
.compact-exp {
    font-size: 0.82rem;
    color: #475569;
    line-height: 1.6;
    margin-top: 4px;
}

/* Honor */
.honor-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 12px 16px;
    font-size: 0.9rem;
    color: #334155;
    line-height: 1.5;
}
.honor-icon {
    color: #2563eb;
    font-size: 1.1rem;
    margin-top: 2px;
    flex-shrink: 0;
}

/* =====================================================
   PRINT / PDF STYLES
   Objetivo: 2 páginas máximo, respiración, legibilidad
   ===================================================== */
@media print {
    @page {
        size: A4;
        margin: 14mm 12mm 14mm 12mm;
    }

    /* --- Ocultar UI chrome --- */
    .language-toggle,
    .sidebar-download-btn {
        display: none !important;
    }

    /* --- Reset body --- */
    body {
        background: white !important;
        padding: 0 !important;
        margin: 0 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* --- Layout principal: sidebar angosto, main amplio --- */
    /* El fondo azul va en el CONTAINER como gradiente de 2 columnas,
       así cubre toda la altura del PDF sin importar cuántas páginas haya */
    .resume-container {
        display: grid !important;
        grid-template-columns: 190px 1fr !important;
        gap: 0 !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        max-width: none !important;
        min-height: auto !important;
        width: 100% !important;
        align-items: start !important;
        background: linear-gradient(to right, #1a2744 190px, #ffffff 190px) !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* ---- SIDEBAR ---- */
    .sidebar {
        background: transparent !important;
        padding: 0 !important;
        height: fit-content !important;
        align-self: start !important;
        overflow: visible !important;
    }

    .sidebar::before {
        display: none !important;
    }

    .profile-section {
        padding: 18px 14px 14px !important;
        border-bottom: 1px solid rgba(255,255,255,0.08) !important;
    }

    .profile-avatar {
        width: 44px !important;
        height: 44px !important;
        font-size: 0.78rem !important;
        margin-bottom: 10px !important;
        border: 1.5px solid rgba(59,130,246,0.5) !important;
        background: rgba(59,130,246,0.15) !important;
        color: #93c5fd !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .profile-role {
        font-size: 0.72rem !important;
        font-weight: 700 !important;
        color: #ffffff !important;
        margin-bottom: 4px !important;
        line-height: 1.3 !important;
    }

    .profile-stack {
        font-size: 0.58rem !important;
        color: #60a5fa !important;
        line-height: 1.5 !important;
    }

    .sidebar-section {
        padding: 10px 14px !important;
        border-bottom: 1px solid rgba(255,255,255,0.06) !important;
        break-inside: avoid;
    }

    .sidebar-section:last-child {
        border-bottom: none !important;
        padding-bottom: 16px !important;
    }

    .sidebar-section h2 {
        font-size: 0.58rem !important;
        letter-spacing: 1px !important;
        margin-bottom: 8px !important;
        padding-bottom: 4px !important;
        color: #94a3b8 !important;
    }

    .sidebar-section h2::after {
        width: 20px !important;
        height: 1px !important;
        background: #3b82f6 !important;
    }

    /* Contacto */
    .contact-item {
        margin-bottom: 6px !important;
        padding: 2px 0 !important;
    }

    .contact-item i {
        font-size: 0.7rem !important;
        width: 14px !important;
        margin-right: 7px !important;
        color: #60a5fa !important;
    }

    .contact-item a,
    .contact-item span {
        font-size: 0.68rem !important;
        color: #cbd5e1 !important;
        word-break: break-all !important;
    }

    /* Skills como badges, no como barras */
    .skill-item {
        margin-bottom: 4px !important;
    }

    .skill-bar {
        display: none !important;
    }

    .skill-name {
        font-size: 0.65rem !important;
        margin-bottom: 0 !important;
    }

    .skill-name span:last-child {
        display: none !important;
    }

    /* Educación sidebar */
    .sidebar-section [style*="margin-bottom: 15px"] {
        margin-bottom: 8px !important;
        padding-bottom: 6px !important;
    }

    /* ---- MAIN CONTENT ---- */
    .main-content {
        padding: 16px 20px 16px 18px !important;
        background: #ffffff !important;
        overflow: visible !important;
    }

    .header-section {
        margin-bottom: 12px !important;
        padding-bottom: 10px !important;
    }

    .name-title {
        font-size: 1.4rem !important;
        font-weight: 800 !important;
        color: #0f172a !important;
        margin-bottom: 4px !important;
        line-height: 1.1 !important;
    }

    .professional-title {
        font-size: 0.72rem !important;
        color: #475569 !important;
        line-height: 1.5 !important;
        margin-bottom: 0 !important;
    }

    /* Secciones */
    .section {
        margin-bottom: 12px !important;
    }

    /* Solo secciones pequeñas evitan romperse */
    .section:not(:has(.experience-item)) {
        break-inside: avoid;
    }

    .section-title {
        font-size: 0.68rem !important;
        font-weight: 700 !important;
        letter-spacing: 1.2px !important;
        color: #1a2744 !important;
        margin-bottom: 8px !important;
        padding-bottom: 4px !important;
        border-bottom: 1.5px solid #e2e8f0 !important;
        text-transform: uppercase !important;
    }

    /* Extracto profesional */
    .section > p {
        font-size: 0.72rem !important;
        line-height: 1.55 !important;
        margin-bottom: 5px !important;
        color: #334155 !important;
    }

    /* Experiencia */
    .experience-item {
        margin-bottom: 10px !important;
        padding: 0 0 10px 0 !important;
        border-bottom: 1px solid #f1f5f9 !important;
        background: none !important;
        box-shadow: none !important;
        break-inside: avoid;
    }

    .experience-item:last-child {
        border-bottom: none !important;
        margin-bottom: 0 !important;
        padding-bottom: 0 !important;
    }

    .job-header {
        display: flex !important;
        justify-content: space-between !important;
        align-items: flex-start !important;
        margin-bottom: 2px !important;
        gap: 6px !important;
    }

    .company-name {
        font-size: 0.72rem !important;
        font-weight: 700 !important;
        color: #2563eb !important;
        margin-bottom: 1px !important;
    }

    .job-title {
        font-size: 0.78rem !important;
        font-weight: 600 !important;
        color: #0f172a !important;
        margin-bottom: 1px !important;
    }

    .job-period {
        font-size: 0.62rem !important;
        padding: 2px 7px !important;
        background: #f1f5f9 !important;
        border: 1px solid #e2e8f0 !important;
        color: #475569 !important;
        border-radius: 3px !important;
        white-space: nowrap !important;
    }

    .job-achievements {
        margin-top: 4px !important;
        list-style: none !important;
    }

    .job-achievements li {
        font-size: 0.7rem !important;
        line-height: 1.5 !important;
        margin-bottom: 3px !important;
        padding-left: 12px !important;
        color: #334155 !important;
    }

    .job-achievements li::before {
        width: 4px !important;
        height: 4px !important;
        top: 6px !important;
        background: #3b82f6 !important;
    }

    /* Salto de página controlado */
    .page-break-before {
        break-before: page !important;
    }

    /* Nuevos componentes en print */
    .edu-item {
        margin-bottom: 6px !important;
        padding-bottom: 5px !important;
    }
    .edu-year {
        font-size: 0.58rem !important;
        padding: 1px 5px !important;
    }
    .edu-degree {
        font-size: 0.68rem !important;
    }
    .edu-school {
        font-size: 0.62rem !important;
    }

    .badge-group-label {
        font-size: 0.55rem !important;
        margin: 6px 0 3px 0 !important;
    }
    .tech-pill {
        font-size: 0.6rem !important;
        padding: 1px 5px !important;
        background: rgba(59,130,246,0.15) !important;
        color: #93c5fd !important;
        border: 1px solid rgba(59,130,246,0.25) !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .cert-item {
        font-size: 0.62rem !important;
        margin-bottom: 4px !important;
    }

    .lang-item {
        font-size: 0.65rem !important;
        margin-bottom: 4px !important;
    }

    .job-meta {
        font-size: 0.65rem !important;
        margin-bottom: 4px !important;
    }

    .compact-exp {
        font-size: 0.65rem !important;
        line-height: 1.5 !important;
        color: #475569 !important;
    }

    .honor-item {
        padding: 7px 10px !important;
        font-size: 0.68rem !important;
        background: #f8fafc !important;
        border: 1px solid #e2e8f0 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        break-inside: avoid;
    }
}
