/* ===== RESET & BASE ===== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    background: #F8FAFC;
    color: #1E293B;
    line-height: 1.6;
    padding: 20px;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* ===== WRAPPER ===== */
.cv-wrapper {
    max-width: 1100px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 24px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.06);
    padding: 40px 35px;
}

/* ===== HEADER ===== */
.cv-header {
    margin-bottom: 40px;
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 30px;
}

.header-grid {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 30px;
    align-items: start;
}

.header-avatar {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    overflow: hidden;
    background: #e2e8f0;
    border: 4px solid #00507C;
    flex-shrink: 0;
}

.header-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.header-titles h1 {
    font-size: 28px;
    font-weight: 700;
    color: #00507C;
    letter-spacing: -0.5px;
    margin-bottom: 4px;
}

.headline {
    font-size: 18px;
    font-weight: 500;
    color: #1E293B;
    margin-bottom: 2px;
}

.subheadline {
    font-size: 15px;
    font-weight: 400;
    color: #64748b;
    margin-bottom: 12px;
}

.header-contact {
    display: flex;
    flex-wrap: wrap;
    gap: 18px 28px;
    margin-bottom: 16px;
}

.header-contact span {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #475569;
}

.header-contact svg {
    color: #00507C;
    flex-shrink: 0;
}

.header-actions {
    margin-top: 4px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    border-radius: 40px;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.btn-primary {
    background: #00507C;
    color: #ffffff;
    border-color: #00507C;
}

.btn-primary:hover {
    background: #003b5e;
    border-color: #003b5e;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 80, 124, 0.25);
}

.btn-outline {
    background: transparent;
    color: #00507C;
    border-color: #00507C;
    padding: 6px 18px;
    font-size: 13px;
}

.btn-outline:hover {
    background: #00507C;
    color: #ffffff;
}

/* ===== SECTIONS ===== */
.cv-section {
    margin-bottom: 40px;
}

.cv-section h2 {
    font-size: 20px;
    font-weight: 600;
    color: #00507C;
    margin-bottom: 16px;
    letter-spacing: -0.3px;
    border-left: 4px solid #00507C;
    padding-left: 14px;
}

/* ===== CARDS ===== */
.card {
    background: #F8FAFC;
    border-radius: 16px;
    padding: 20px 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.2s;
}

.card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.card-text {
    background: #F8FAFC;
    padding: 24px 28px;
}

.card-text p {
    font-size: 15px;
    color: #334155;
    line-height: 1.7;
}

.grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.card-sm {
    padding: 16px 20px;
}

.card-sm h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1E293B;
    margin-bottom: 2px;
}

.card-sm p {
    font-size: 14px;
    color: #64748b;
}

/* ===== EXPERIENCE ===== */
.experience-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.exp-item {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 18px;
    padding: 10px 16px;
    background: #F8FAFC;
    border-radius: 10px;
    transition: background 0.15s;
}

.exp-item:hover {
    background: #f1f5f9;
}

.exp-org {
    font-weight: 600;
    color: #00507C;
    font-size: 15px;
    min-width: 150px;
}

.exp-role {
    font-weight: 500;
    color: #1E293B;
    font-size: 14px;
}

.exp-date {
    font-size: 13px;
    color: #94a3b8;
    margin-left: auto;
}

/* ===== SKILLS ===== */
.skills-grid {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.skill-label {
    display: inline-block;
    font-weight: 600;
    font-size: 14px;
    color: #1E293B;
    min-width: 150px;
    margin-right: 12px;
}

.skill-chips {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 8px;
}

.skill-chips span {
    background: #e2e8f0;
    color: #1E293B;
    padding: 4px 14px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.15s;
}

.skill-chips span:hover {
    background: #cbd5e1;
}

/* ===== PROJECTS ===== */
.project-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.project-card {
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.25s, transform 0.2s;
    border: 1px solid #f1f5f9;
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    transform: translateY(-4px);
}

.project-img {
    background: #ffffff;
    height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 20px;
    border-bottom: 1px solid #f1f5f9;
}

.project-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    max-height: 280px;
    padding: 0;
}

.project-content {
    padding: 20px 22px 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.project-content h3 {
    font-size: 19px;
    font-weight: 600;
    color: #00507C;
    margin-bottom: 4px;
}

.project-content p {
    font-size: 14px;
    color: #475569;
    margin-bottom: 12px;
    line-height: 1.6;
}

.project-content ul {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 16px;
    margin-bottom: 14px;
}

.project-content ul li {
    font-size: 13px;
    color: #334155;
    position: relative;
    padding-left: 16px;
    line-height: 1.5;
}

.project-content ul li::before {
    content: "▹";
    position: absolute;
    left: 0;
    color: #00507C;
    font-weight: 600;
}

.tech-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
}

.tech-badges span {
    background: #dbeafe;
    color: #1e3a5f;
    padding: 3px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s;
}

.tech-badges span:hover {
    background: #00507C;
    color: #ffffff;
    transform: scale(1.05);
}

.project-content .btn-outline {
    align-self: flex-start;
    margin-top: auto;
}

/* ===== CERTIFICATIONS ===== */
.cert-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.cert-badge {
    background: #F8FAFC;
    border: 1px solid #e2e8f0;
    padding: 6px 18px;
    border-radius: 40px;
    font-size: 14px;
    font-weight: 500;
    color: #1E293B;
    transition: all 0.15s;
}

.cert-badge:hover {
    background: #f1f5f9;
    border-color: #00507C;
    color: #00507C;
}

/* ===== CONTACT ===== */
.contact-links {
    display: flex;
    flex-wrap: wrap;
    gap: 16px 30px;
}

.contact-links a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #1E293B;
    transition: color 0.15s;
    padding: 4px 0;
}

.contact-links a:hover {
    color: #00507C;
}

.contact-links svg {
    color: #00507C;
    flex-shrink: 0;
}

/* ===== FOOTER ===== */
.cv-footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 2px solid #f1f5f9;
    text-align: center;
    font-size: 14px;
    color: #94a3b8;
}

.cv-footer p {
    font-weight: 400;
}

.footer-url {
    font-size: 12px;
    color: #cbd5e1;
    margin-top: 2px;
}

/* ============================================
   RESPONSIVE 
   ============================================ */

@media (max-width: 992px) {
    .project-grid {
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }
    
    .project-img {
        height: 240px;
        padding: 16px;
    }
}

@media (max-width: 768px) {
    .cv-wrapper {
        padding: 20px 16px;
        border-radius: 16px;
    }

    .header-grid {
        grid-template-columns: 1fr;
        justify-items: center;
        text-align: center;
        gap: 16px;
    }

    .header-avatar {
        width: 120px;
        height: 120px;
    }

    .header-titles h1 {
        font-size: 22px;
    }

    .headline {
        font-size: 16px;
    }

    .subheadline {
        font-size: 14px;
    }

    .header-contact {
        justify-content: center;
        gap: 10px 18px;
    }

    .header-contact span {
        font-size: 13px;
    }

    .header-actions {
        text-align: center;
    }

    .grid-cards {
        grid-template-columns: 1fr;
    }

    .project-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .project-img {
        height: 220px;
        padding: 14px;
    }

    .exp-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
        padding: 12px 14px;
    }

    .exp-date {
        margin-left: 0;
        font-size: 12px;
    }

    .skills-grid {
        gap: 12px;
    }

    .skill-label {
        display: block;
        margin-bottom: 4px;
        min-width: auto;
    }

    .contact-links {
        flex-direction: column;
        gap: 10px;
    }

    .cert-grid {
        gap: 8px;
    }

    .cert-badge {
        font-size: 13px;
        padding: 4px 14px;
    }

    .cv-section h2 {
        font-size: 18px;
        padding-left: 10px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    .cv-wrapper {
        padding: 14px 12px;
        border-radius: 12px;
    }

    .header-avatar {
        width: 100px;
        height: 100px;
    }

    .header-titles h1 {
        font-size: 19px;
    }

    .btn {
        padding: 8px 18px;
        font-size: 13px;
    }

    .btn-outline {
        padding: 5px 14px;
        font-size: 12px;
    }

    .project-img {
        height: 180px;
        padding: 10px;
    }

    .project-content {
        padding: 14px 16px 18px;
    }

    .project-content h3 {
        font-size: 17px;
    }

    .card-text {
        padding: 16px 18px;
    }

    .card-sm {
        padding: 12px 16px;
    }

    .tech-badges span {
        font-size: 11px;
        padding: 2px 10px;
    }
}

@media (min-width: 1200px) {
    .project-img {
        height: 300px;
        padding: 24px;
    }
    
    .project-content {
        padding: 24px 28px 28px;
    }
}

/* ============================================
   ESTILOS PARA IMPRESIÓN (PRINT)
   ============================================ */
@media print {
    /* Reset para impresión */
    body {
        background: #ffffff !important;
        padding: 0.3cm !important;
        color: #000000 !important;
        font-size: 10pt !important;
        line-height: 1.4 !important;
        margin: 0 !important;
    }

    .cv-wrapper {
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        background: #ffffff !important;
    }

    /* Ocultar elementos no imprimibles */
    .btn,
    .btn-primary,
    .btn-outline,
    .header-actions {
        display: none !important;
    }

    /* Mantener enlaces visibles pero sin subrayado */
    a {
        text-decoration: none !important;
        color: #00507C !important;
    }

    /* Ajustes de espaciado */
    .cv-header {
        margin-bottom: 16px !important;
        padding-bottom: 12px !important;
        border-bottom-width: 1px !important;
        border-bottom-color: #d0d0d0 !important;
    }

    .cv-section {
        margin-bottom: 16px !important;
        page-break-inside: avoid !important;
    }

    .cv-section h2 {
        font-size: 13pt !important;
        margin-bottom: 8px !important;
        border-left-width: 3px !important;
        padding-left: 10px !important;
        color: #00507C !important;
    }

    /* Header impresión - mantener diseño */
    .header-grid {
        display: grid !important;
        grid-template-columns: 90px 1fr !important;
        gap: 16px !important;
        align-items: start !important;
    }

    .header-avatar {
        width: 90px !important;
        height: 90px !important;
        border-width: 2px !important;
        border-color: #00507C !important;
    }

    .header-titles h1 {
        font-size: 16pt !important;
        color: #00507C !important;
        margin-bottom: 2px !important;
    }

    .headline {
        font-size: 11pt !important;
        color: #000000 !important;
    }

    .subheadline {
        font-size: 9.5pt !important;
        color: #444444 !important;
        margin-bottom: 8px !important;
    }

    .header-contact {
        gap: 6px 14px !important;
        margin-bottom: 6px !important;
    }

    .header-contact span {
        font-size: 9pt !important;
        color: #333333 !important;
    }

    .header-contact svg {
        width: 12px !important;
        height: 12px !important;
        color: #00507C !important;
    }

    /* Cards en impresión - mantener sombras sutiles */
    .card {
        background: #f8fafc !important;
        border: 1px solid #e5e7eb !important;
        border-radius: 8px !important;
        padding: 10px 14px !important;
        box-shadow: none !important;
    }

    .card-text {
        padding: 12px 16px !important;
    }

    .card-text p {
        font-size: 9.5pt !important;
        color: #000000 !important;
        line-height: 1.5 !important;
    }

    .card-sm {
        padding: 8px 12px !important;
    }

    .card-sm h3 {
        font-size: 10pt !important;
        color: #000000 !important;
    }

    .card-sm p {
        font-size: 9pt !important;
        color: #444444 !important;
    }

    .grid-cards {
        gap: 10px !important;
    }

    /* Experiencia en impresión */
    .exp-item {
        padding: 5px 10px !important;
        background: #f8fafc !important;
        border-bottom: 1px solid #e5e7eb !important;
        border-radius: 4px !important;
        gap: 4px 12px !important;
    }

    .exp-org {
        font-size: 10pt !important;
        color: #00507C !important;
        min-width: 120px !important;
    }

    .exp-role {
        font-size: 9.5pt !important;
        color: #000000 !important;
    }

    .exp-date {
        font-size: 8.5pt !important;
        color: #666666 !important;
        margin-left: auto !important;
    }

    /* Skills en impresión */
    .skills-grid {
        gap: 8px !important;
    }

    .skill-label {
        font-size: 9pt !important;
        color: #000000 !important;
        min-width: 120px !important;
    }

    .skill-chips span {
        background: #e8e8e8 !important;
        color: #000000 !important;
        font-size: 8.5pt !important;
        padding: 2px 10px !important;
        border-radius: 20px !important;
        border: 1px solid #d0d0d0 !important;
    }

    /* ===== PROYECTOS EN IMPRESIÓN: 2 COLUMNAS ===== */
    .project-grid {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 14px !important;
    }

    .project-card {
        border: 1px solid #d0d0d0 !important;
        border-radius: 10px !important;
        box-shadow: none !important;
        page-break-inside: avoid !important;
        background: #ffffff !important;
        display: flex !important;
        flex-direction: column !important;
    }

    .project-card:hover {
        transform: none !important;
        box-shadow: none !important;
    }

    .project-img {
        height: 150px !important;
        padding: 10px !important;
        border-bottom: 1px solid #e5e7eb !important;
        background: #ffffff !important;
    }

    .project-img img {
        max-height: 150px !important;
        object-fit: contain !important;
    }

    .project-content {
        padding: 12px 14px 14px !important;
        flex: 1 !important;
        display: flex !important;
        flex-direction: column !important;
    }

    .project-content h3 {
        font-size: 11pt !important;
        color: #00507C !important;
        margin-bottom: 2px !important;
    }

    .project-content p {
        font-size: 8.5pt !important;
        color: #000000 !important;
        margin-bottom: 6px !important;
        line-height: 1.4 !important;
    }

    .project-content ul {
        gap: 2px 10px !important;
        margin-bottom: 8px !important;
    }

    .project-content ul li {
        font-size: 8pt !important;
        color: #000000 !important;
        padding-left: 12px !important;
        line-height: 1.3 !important;
    }

    .project-content ul li::before {
        color: #00507C !important;
    }

    .tech-badges {
        gap: 4px !important;
        margin-bottom: 0 !important;
    }

    .tech-badges span {
        font-size: 7.5pt !important;
        padding: 1px 8px !important;
        background: #dbeafe !important;
        color: #1e3a5f !important;
        border: 1px solid #b8cfe8 !important;
        border-radius: 12px !important;
    }

    .project-content .btn-outline {
        display: none !important;
    }

    /* Certificaciones en impresión */
    .cert-grid {
        gap: 6px !important;
    }

    .cert-badge {
        background: #f8fafc !important;
        border: 1px solid #d0d0d0 !important;
        font-size: 9pt !important;
        padding: 3px 12px !important;
        color: #000000 !important;
        border-radius: 30px !important;
    }

    /* Contacto en impresión */
    .contact-links {
        gap: 6px 16px !important;
        flex-wrap: wrap !important;
    }

    .contact-links a {
        font-size: 9pt !important;
        color: #000000 !important;
        padding: 2px 0 !important;
        display: inline-flex !important;
        align-items: center !important;
        gap: 6px !important;
    }

    .contact-links svg {
        width: 14px !important;
        height: 14px !important;
        color: #00507C !important;
    }

    /* Footer en impresión */
    .cv-footer {
        margin-top: 16px !important;
        padding-top: 10px !important;
        border-top: 1px solid #d0d0d0 !important;
        font-size: 9pt !important;
        color: #666666 !important;
    }

    .footer-url {
        font-size: 8pt !important;
        color: #999999 !important;
    }

    /* ===== FOOTER COMPANY LINK ===== */
    .footer-company {
        margin-top: 4px;
        font-size: 13px;
        font-weight: 500;
    }

    .footer-company a {
        color: #00507C !important;
        text-decoration: none !important;
        transition: opacity 0.2s;
    }

    .footer-company a:hover {
        opacity: 0.7;
        text-decoration: underline !important;
    }

    /* Para impresión */
    @media print {
        .footer-company a {
            color: #00507C !important;
            text-decoration: none !important;
        }
    }

}
