/*
*   CV — Javier Muñoz
*/

:root {
    --red:      #cd5353;
    --red-dim:  #b84848;
    --red-tint: rgba(205, 83, 83, .08);
    --dark:     #2e3138;
    --mid:      #555b66;
    --muted:    #8a909b;
    --border:   #eaeaea;
    --bg:       #f0f0f0;
    --white:    #ffffff;
    --radius:   6px;
    --shadow:   0 4px 40px rgba(0,0,0,.08);
    --font-head: 'open_sansextrabold', Arial, sans-serif;
    --font-bold: 'open_sansbold',      Arial, sans-serif;
    --font-semi: 'open_sanssemibold',  Arial, sans-serif;
    --font-reg:  'open_sansregular',   Arial, sans-serif;
    --font-it:   'open_sansitalic',    Arial, sans-serif;
    --font-ui:   -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
}

/* Preloader */
#loader { position: fixed; inset: 0; background: var(--bg); z-index: 9999; display: flex; align-items: center; justify-content: center; }
.spinner { width: 40px; height: 40px; border: 3px solid var(--border); border-top-color: var(--red); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Language toggle */
#lang-toggle {
    position: fixed; top: 16px; right: 16px; z-index: 1000;
    display: flex; gap: 4px;
    background: var(--white); border-radius: 20px; padding: 4px 6px;
    box-shadow: 0 2px 12px rgba(0,0,0,.12);
}
.lang-btn {
    background: none; border: none; cursor: pointer;
    font-size: 18px; line-height: 1; padding: 2px 4px; border-radius: 12px;
    opacity: .45; transition: opacity .2s, transform .15s;
}
.lang-btn:hover  { opacity: .75; }
.lang-btn.active { opacity: 1; transform: scale(1.15); }

/* Layout */
#wrapper { margin: 48px 0; }

/* Sidebar */
.profile { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; border-top: 4px solid var(--red); }

.profile-name { padding: 20px 20px 16px; display: flex; flex-direction: column; gap: 6px; }
.profile .name { font-family: var(--font-head); font-size: 15px; text-transform: uppercase; letter-spacing: .08em; color: var(--dark); line-height: 1.2; }
.profile .job  { font-family: var(--font-ui); font-size: 9px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); line-height: 1.55; }

.profile-image { flex-shrink: 0; clip-path: polygon(0 6%, 100% 0, 100% 94%, 0 100%); margin-top: -12px; margin-bottom: 12px; }
.profile-image img { display: block; width: 100%; }

ul.profile-information { list-style: none; margin: 0; padding: 0 20px; }
ul.profile-information li { display: flex; align-items: baseline; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 12px; }
ul.profile-information li:last-child { border-bottom: none; }
.info-label { font-family: var(--font-semi); font-size: 9px; text-transform: uppercase; letter-spacing: .06em; color: var(--dark); min-width: 60px; flex-shrink: 0; }
.info-value { font-family: var(--font-ui); font-size: 11.5px; color: var(--muted); line-height: 1.4; word-break: break-word; }
.info-value a { color: var(--muted); transition: color .2s; }
.info-value a:hover { color: var(--red); }

/* profile-actions removed */

/* Skills */
.sidebar-skills { }
.sidebar-section-title { padding: 18px 20px 10px; display: flex; flex-direction: column; gap: 6px; }
.sidebar-section-title h2 { font-family: var(--font-head); font-size: 10px; text-transform: uppercase; letter-spacing: .1em; color: var(--dark); margin: 0; }

.zigzag-divider { display: block; fill: none; stroke: var(--red); stroke-width: 3.5; stroke-miterlimit: 10; overflow: visible; opacity: .85; }

.skills-list { list-style: none; margin: 0; padding: 0 20px 16px; }
.skills-list li { margin-bottom: 11px; }
.skills-list li:last-child { margin-bottom: 0; }
.skills-list h4 { font-family: var(--font-ui); font-size: 8.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--mid); margin-bottom: 5px; line-height: 1.4; }
.skill-bar { height: 5px; background: #ebebeb; border-radius: 10px; overflow: hidden; }
.skill-fill { height: 100%; background: linear-gradient(90deg, var(--red-dim), var(--red)); border-radius: 10px; transform-origin: left; animation: bar-in .9s cubic-bezier(.22,.68,0,1.2) both; }
.skills-list li:nth-child(1) .skill-fill { animation-delay: .10s; }
.skills-list li:nth-child(2) .skill-fill { animation-delay: .18s; }
.skills-list li:nth-child(3) .skill-fill { animation-delay: .26s; }
.skills-list li:nth-child(4) .skill-fill { animation-delay: .34s; }
.skills-list li:nth-child(5) .skill-fill { animation-delay: .42s; }
.skills-list li:nth-child(6) .skill-fill { animation-delay: .50s; }
.skills-list li:nth-child(7) .skill-fill { animation-delay: .58s; }
.skills-list li:nth-child(8) .skill-fill { animation-delay: .66s; }
@keyframes bar-in { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* Languages section */
.sidebar-languages { padding-bottom: 24px; }

.lang-list { list-style: none; margin: 0; padding: 0 20px 0; }
.lang-list li { margin-bottom: 13px; }
.lang-list li:last-child { margin-bottom: 0; }

.lang-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 5px;
}

.lang-name {
    font-family: var(--font-semi);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--dark);
}

.lang-level {
    font-family: var(--font-ui);
    font-size: 9px;
    color: var(--muted);
    letter-spacing: .03em;
}

.lang-bar {
    height: 4px;
    background: #ebebeb;
    border-radius: 10px;
    overflow: hidden;
}

.lang-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--red-dim), var(--red));
    border-radius: 10px;
    transform-origin: left;
    animation: bar-in .9s cubic-bezier(.22,.68,0,1.2) both;
}

.lang-list li:nth-child(1) .lang-fill { animation-delay: .8s; }
.lang-list li:nth-child(2) .lang-fill { animation-delay: .9s; }
.lang-list li:nth-child(3) .lang-fill { animation-delay: 1s; }

/* Mobile header — hidden on desktop */
.mobile-header  { display: none; }
.mobile-skills  { display: none; }

/* Main content */
section#about { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }

.main-title { padding: 28px 36px 16px; display: flex; flex-direction: column; gap: 8px; }
.main-title h1 { font-family: var(--font-head); font-size: 11px; text-transform: uppercase; letter-spacing: .14em; color: var(--dark); margin: 0; }

.content { padding: 28px 36px; }

/* Print-only elements — hidden on screen */
.print-header { display: none; }
.print-sidebar-bg { display: none; }
.print-page-break   { display: none; }
.cv-section { display: contents; } /* transparent wrapper on screen */

/* Who am I */
.about-intro { display: flex; flex-direction: column; gap: 14px; }
.about-intro .lead { color: var(--dark); font-family: var(--font-bold); font-size: 13.5px; line-height: 1.65; }
.stat-pills { display: flex; flex-wrap: wrap; gap: 7px; }
.stat-pill { display: inline-flex; align-items: center; gap: 5px; background: var(--red-tint); color: var(--red); font-family: var(--font-semi); font-size: 10px; text-transform: uppercase; letter-spacing: .05em; border-radius: 4px; padding: 4px 10px; border: 1px solid rgba(205,83,83,.15); }
.stat-pill i { font-size: 11px; opacity: .8; }
.about-intro .body { color: var(--mid); font-size: 13px; line-height: 1.78; }

/* Timeline */
.timeline { position: relative; }
.timeline:before { content: ""; position: absolute; left: 20px; top: 48px; bottom: 0; width: 2px; background: linear-gradient(to bottom, var(--border) 80%, transparent); }
.timeline:after { content: ""; position: absolute; top: 0; left: 0; width: 42px; height: 42px; background: var(--white); border: 2px solid var(--border); border-radius: 50%; font-family: 'fontello'; text-align: center; color: var(--red); font-size: 17px; line-height: 38px; box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.timeline.experience:after { content: '\e8ba'; }
.timeline.education:after  { content: '\e80c'; }

.exp { position: relative; padding-left: 58px; padding-top: 4px; margin-bottom: 24px; }
.exp:last-child { margin-bottom: 0; }
.exp:after { content: ""; position: absolute; left: 14px; top: 14px; width: 13px; height: 13px; background: var(--red); border: 3px solid var(--white); border-radius: 50%; box-shadow: 0 0 0 2px var(--border); transition: background .2s; }
.exp:hover:after { background: var(--dark); }

.hgroup { margin-bottom: 6px; }
.hgroup h4 { font-family: var(--font-bold); font-size: 13.5px; font-weight: normal; text-transform: none; color: var(--dark); margin: 0 0 3px; line-height: 1.35; }
.hgroup h6 { font-family: var(--font-it); font-size: 11px; font-weight: normal; text-transform: none; color: var(--muted); margin: 0; display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.hgroup h6 i { color: #ccc; font-size: 10px; }

span.current { display: inline-flex; align-items: center; background: var(--red); color: var(--white); font-family: var(--font-semi); font-style: normal; font-size: 8.5px; letter-spacing: .05em; text-transform: uppercase; border-radius: 3px; padding: 2px 7px; }

.exp p { color: var(--mid); font-size: 13px; line-height: 1.65; margin: 0 0 6px; }
.exp p:last-child { margin-bottom: 0; }
.exp ul { list-style: none; margin: 8px 0 0; padding: 0; }
.exp ul li { position: relative; padding-left: 16px; margin-bottom: 5px; color: var(--mid); font-size: 12.5px; line-height: 1.6; }
.exp ul li:before { content: "✓"; position: absolute; left: 0; top: 1px; color: var(--red); font-size: 10px; font-weight: bold; }

/* Courses grid */
.courses-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.course-badge { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border: 1.5px solid var(--border); border-radius: var(--radius); transition: border-color .2s, box-shadow .2s; }
.course-badge:hover { border-color: var(--red); box-shadow: 0 3px 12px var(--red-tint); }
.course-badge .course-name { font-family: var(--font-semi); font-size: 11.5px; color: var(--dark); line-height: 1.35; }
.course-badge .course-issuer { font-size: 10px; color: var(--muted); font-family: var(--font-it); }
.course-badge .course-meta { display: flex; align-items: center; gap: 6px; font-family: var(--font-ui); font-size: 10px; color: var(--muted); }
.course-badge .course-meta i { color: var(--red); font-size: 9px; opacity: .7; }

/* Interests */
.interests { display: flex; gap: 14px; }
.interest-item { flex: 1; text-align: center; padding: 20px 12px 16px; border: 1.5px solid var(--border); border-radius: var(--radius); transition: border-color .2s, box-shadow .2s; }
.interest-item:hover { border-color: var(--red); box-shadow: 0 4px 16px var(--red-tint); }
.interest-item .ico { font-size: 24px; color: var(--red); margin-bottom: 10px; opacity: .9; }
.interest-item h3 { font-family: var(--font-semi); font-size: 10px; text-transform: uppercase; letter-spacing: .07em; color: var(--mid); margin: 0; }

/* CTA footer */
.section-footer { padding: 28px 36px 36px; border-top: 1px solid var(--border); display: flex; flex-direction: column; align-items: center; gap: 20px; }
.cta-buttons { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.but { display: inline-flex; align-items: center; gap: 10px; padding: 11px 28px; font-family: var(--font-semi); font-size: 10.5px; text-transform: uppercase; letter-spacing: .09em; color: var(--white); border-radius: var(--radius); transition: background .2s, transform .15s, box-shadow .2s; white-space: nowrap; }
.but:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,.14); }
.but.opc-1 { background: var(--dark); }
.but.opc-1:hover { background: var(--red); }
.but.opc-2 { background: var(--red); }
.but.opc-2:hover { background: var(--red-dim); }
.but.ico:before { content: '\e864'; font-family: 'fontello'; font-size: 14px; opacity: .8; }
.but.dl:before  { content: '\e802'; font-family: 'fontello'; font-size: 14px; opacity: .8; }

/* ══════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════ */
@media (max-width: 991px) {
    .profile { margin-bottom: 24px; }
}

@media (max-width: 767px) {
    #wrapper { margin: 0; }

    /* Hide full sidebar on mobile */
    .col-lg-3.col-md-4 { display: none !important; }

    /* Mobile compact header */
    .mobile-header {
        display: flex;
        align-items: center;
        gap: 16px;
        background: var(--white);
        padding: 14px 18px;
        border-bottom: 3px solid var(--red);
        box-shadow: var(--shadow);
    }
    .mobile-header .mh-photo { width: 54px; height: 54px; border-radius: 50%; overflow: hidden; flex-shrink: 0; border: 2px solid var(--red); }
    .mobile-header .mh-photo img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
    .mobile-header .mh-info { flex: 1; min-width: 0; }
    .mobile-header .mh-name { font-family: var(--font-head); font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--dark); line-height: 1.2; margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .mobile-header .mh-job  { font-family: var(--font-ui); font-size: 8px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); line-height: 1.4; margin-bottom: 8px; }
    .mobile-header .mh-actions { display: flex; gap: 6px; }
    .mobile-header .mh-action { display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid var(--border); color: var(--muted); font-size: 11px; transition: border-color .2s, color .2s, background .2s; }
    .mobile-header .mh-action:hover { border-color: var(--red); color: var(--white); background: var(--red); }

    /* Horizontally scrollable skill pills */
    .mobile-skills { display: flex; gap: 7px; padding: 9px 18px; overflow-x: auto; background: var(--white); border-bottom: 1px solid var(--border); scrollbar-width: none; }
    .mobile-skills::-webkit-scrollbar { display: none; }
    .mobile-skill-tag { display: inline-flex; flex-shrink: 0; align-items: center; background: var(--red-tint); color: var(--red); font-family: var(--font-semi); font-size: 8.5px; text-transform: uppercase; letter-spacing: .04em; border-radius: 3px; padding: 3px 8px; border: 1px solid rgba(205,83,83,.15); white-space: nowrap; }

    .col-md-9 { width: 100% !important; }
    section#about { border-radius: 0; box-shadow: none; border-top: none; }

    .main-title     { padding: 20px 20px 14px; }
    .content        { padding: 16px 20px; }
    .section-footer { padding: 20px 20px 28px; }

    .courses-grid { grid-template-columns: 1fr; }
    .interests { flex-direction: column; gap: 10px; }
    .interest-item { display: flex; align-items: center; gap: 16px; text-align: left; padding: 12px 16px; }
    .interest-item .ico { margin-bottom: 0; font-size: 20px; }
    .cta-buttons { flex-direction: column; align-items: stretch; }
    .but { justify-content: center; }
    /* Move flags to bottom-right on mobile — clear of header text */
    #lang-toggle { top: auto; bottom: 16px; right: 16px; box-shadow: 0 4px 16px rgba(0,0,0,.18); }
}

@media (max-width: 480px) {
    .timeline:before { left: 16px; }
    .timeline:after  { width: 34px; height: 34px; line-height: 30px; font-size: 14px; }
    .exp             { padding-left: 46px; }
    .exp:after       { left: 10px; top: 12px; width: 11px; height: 11px; }
}
