/* ============================================
   FOOTILITY - CV PUBBLICO
   Estensioni minime sopra quotation.css / quotation-public.css
   ============================================ */

/*
 * TYPOGRAPHY SCALE (CV)
 *   Base body text: 11px (leggibile, compatto come preventivi)
 *   Note/meta:       10px
 *   Card title:      14px (bold)
 *   Sezione subtitle 1.5rem (24px) — invariato
 *   Titolo pagina:   2.5rem (40px) — invariato
 *   Metric value:    1.5rem (24px)
 */
.cv-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    font-family: Arial, sans-serif;
    font-size: 11px;
    line-height: 1.5;
    color: #212529;
    box-sizing: border-box;
}

.cv-container p { margin-bottom: 0.5rem; }
.cv-container ul { font-size: 11px; }

/* Paragrafi "importanti" (summary profilo, interessi): leggermente più grandi per respiro */
.cv-summary,
.cv-interests {
    font-size: 12px;
    line-height: 1.65;
}

.cv-interests {
    font-style: italic;
    color: #444;
}

.cv-project-summary {
    font-size: 11px;
    line-height: 1.5;
    color: #333;
}

.cv-highlights-list {
    padding-left: 1.1rem;
    margin: 0;
}

.cv-highlights-list li {
    font-size: 11px;
    line-height: 1.5;
    margin-bottom: 0.3rem;
}

.cv-cta-title {
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 0.25rem;
}

.cv-cta-sub {
    font-size: 11px;
    color: #555;
    line-height: 1.5;
}

/* === TITOLI (riuso stili quotation) === */
.cv-title {
    font-size: 2.5rem;
    font-weight: bold;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px dotted #000;
    line-height: 1.2;
}

.cv-subtitle {
    font-size: 1.5rem;
    font-weight: bold;
    padding-bottom: 0.5rem;
    border-bottom: 3px dotted #000;
}

.cv-info-text {
    color: #555;
    margin-top: 0.5rem;
    margin-bottom: 0;
    font-size: 11px;
}

.cv-section-subtitle {
    font-size: 14px;
    font-weight: bold;
    color: #000;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.5rem 0;
    border-bottom: 2px dashed #000;
    margin-bottom: 1rem;
}

.cv-alert-candidatura {
    border: 1px dashed #000 !important;
    background-color: #f8f9fa !important;
    border-radius: 0 !important;
    color: #212529 !important;
    padding: 0.6rem 1rem;
    margin-bottom: 1.5rem;
    font-size: 11px;
}

.cv-alert-candidatura strong {
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* === CARD BASE (stile quotation dashed) === */
.cv-card {
    border: 1px dashed #000 !important;
    border-radius: 0 !important;
    background: #fff;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.cv-card:hover {
    box-shadow: 8px 8px 0 #000;
    transform: translate(-2px, -2px);
}

.cv-card-static:hover {
    box-shadow: none;
    transform: none;
}

.cv-card-header {
    background-color: #000;
    color: #fff;
    font-weight: bold;
    font-size: 11px;
    padding: 0.55rem 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: none;
}

.cv-card-body {
    padding: 1rem;
    font-size: 11px;
    line-height: 1.55;
}

.cv-card-footer {
    padding: 0.5rem 1rem;
    font-size: 10px;
    color: #6c757d;
    border-top: 1px dashed #ccc;
    background-color: #f8f9fa;
}

/* === INFO TABLE (stile preventivo) === */
.cv-info-table {
    border: none;
    font-size: 11px;
    width: 100%;
    margin: 0;
}

.cv-info-table td {
    padding: 0.3rem 0;
    vertical-align: top;
    border-bottom: 1px dashed #ccc;
}

.cv-info-table tr:last-child td {
    border-bottom: none;
}

.cv-info-label {
    font-weight: bold;
    width: 110px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.cv-info-value {
    font-weight: 300;
    color: #666;
    font-size: 11px;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.cv-info-value a {
    color: #666;
    font-weight: 300;
    font-size: 11px;
    border-bottom: 1px solid #999;
}

/* === LOGO F === */
.cv-logo-box {
    font-family: 'Kg Happy', Arial, sans-serif;
    font-size: clamp(4rem, 7vw, 5.5rem);
    line-height: 1;
    text-align: center;
    user-select: none;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* === METRIC CARDS (stile summary-card) === */
.cv-metric-card {
    border: 1px dashed #000 !important;
    border-radius: 0 !important;
    text-align: center;
    height: 100%;
    transition: background 0.2s ease, color 0.2s ease;
    background: #fff;
}

.cv-metric-card:hover {
    background: #000;
    color: #fff;
}

.cv-metric-card:hover .cv-metric-label {
    color: #fff;
}

.cv-metric-value {
    font-size: 1.5rem;
    font-weight: bold;
    line-height: 1.1;
    padding: 0.85rem 0.5rem 0.25rem 0.5rem;
}

.cv-metric-label {
    font-size: 10px;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0 0.5rem 0.85rem 0.5rem;
    transition: color 0.2s ease;
}

/* === TOP SKILLS BAR (stile phase-total nero) === */
.cv-top-skills-bar {
    background-color: #000;
    color: #fff;
    padding: 1rem 1.25rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    align-items: center;
    margin-bottom: 1.5rem;
    border: 1px dashed #000;
}

.cv-top-skill-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.65rem;
    background-color: #fff;
    color: #000;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    line-height: 1.2;
    border: 1px solid #fff;
    transition: background 0.15s ease, color 0.15s ease;
}

.cv-top-skill-pill:hover {
    background: transparent;
    color: #fff;
    border-color: #fff;
}

/* === STACK PILLS generiche (dentro card) === */
.cv-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.55rem;
    border: 1px dashed #000;
    background: #fff;
    color: #000;
    font-size: 10px;
    font-weight: 500;
    white-space: nowrap;
    line-height: 1.3;
    margin: 0 0.25rem 0.25rem 0;
}

.cv-pill-dark {
    background: #000;
    color: #fff;
    border-style: solid;
    border-color: #000;
}

.cv-pill-new {
    border-style: solid;
    border-color: #000;
    background: #fffbe6;
}
.cv-pill-new-badge {
    font-size: 7px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    background: #000;
    color: #fff;
    padding: 1px 4px;
    border-radius: 2px;
    vertical-align: middle;
    top: 0;
}

/* === EXPERIENCE CARD (separate dashed cards) === */
.cv-experience-card .cv-card-header {
    padding: 0.55rem 1rem;
}

.cv-experience-company {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.4px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cv-experience-location {
    font-size: 10px;
    font-weight: 400;
    color: rgba(255,255,255,0.75);
    text-transform: none;
    letter-spacing: 0;
    margin-left: 0.25rem;
}

.cv-experience-role {
    font-size: 13px;
    font-weight: 700;
    color: #000;
    margin-bottom: 0.5rem;
    line-height: 1.35;
    padding-bottom: 0.4rem;
    border-bottom: 1px dashed #ccc;
}

.cv-experience-card.is-active {
    border-width: 2px !important;
}

/* === LEGACY EXPERIENCE LIST (usato in admin preview se serve) === */
.cv-list-item {
    padding: 1rem 1.25rem;
    padding-right: 180px; /* spazio per il period badge assoluto */
    border-bottom: 1px dashed #dee2e6;
    transition: background 0.15s ease;
    position: relative;
}

.cv-list-item-period-corner {
    position: absolute;
    top: 0.9rem;
    right: 1rem;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.35rem;
}

.cv-list-item:last-child {
    border-bottom: none;
}

.cv-list-item:hover {
    background-color: #f8f9fa;
}

.cv-item-title {
    font-weight: 700;
    font-size: 14px;
    line-height: 1.35;
    margin-bottom: 0.15rem;
    color: #000;
}

.cv-item-sub {
    font-size: 11px;
    color: #555;
    margin-bottom: 0.5rem;
}

.cv-item-sub strong {
    color: #000;
}

.cv-item-period {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.6rem;
    border: 1px solid #000;
    font-size: 10px;
    font-weight: 600;
    white-space: nowrap;
    background: #fff;
    color: #000;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    line-height: 1.2;
}

.cv-item-period.is-active {
    background: #000;
    color: #fff;
}

.cv-item-highlights {
    margin: 0.5rem 0 0 0;
    padding-left: 1.1rem;
}

.cv-item-highlights li {
    font-size: 11px;
    line-height: 1.5;
    color: #333;
    margin-bottom: 0.2rem;
}

.cv-item-type-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.55rem;
    background: #000;
    color: #fff;
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* === SKILLS GROUP CARD === */
.cv-skills-group-header {
    background-color: #000;
    color: #fff;
    font-weight: bold;
    font-size: 11px;
    padding: 0.5rem 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cv-skills-group-body {
    padding: 0.8rem 1rem;
    background: #fff;
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

/* === SOFT SKILLS 2 colonne con bullet === */
.cv-soft-list {
    margin: 0;
    padding-left: 1.1rem;
    columns: 2;
    column-gap: 1.5rem;
}

.cv-soft-list li {
    font-size: 11px;
    line-height: 1.5;
    margin-bottom: 0.2rem;
    break-inside: avoid;
}

/* === CTA FOOTER === */
.cv-cta-card {
    border: 2px dashed #000 !important;
    border-radius: 0 !important;
    background: #f8f9fa;
    padding: 1.25rem 1.5rem;
}

/* === SECTION TITLE DOTTED (stile area autenticata — linee laterali) === */
.cv-section-dotted {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    font-weight: 700;
    color: #1a202c;
    margin: 1.5rem 0 0.85rem;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.cv-section-dotted::before,
.cv-section-dotted::after {
    content: "";
    flex: 1 1 auto;
    border-bottom: 3px dotted #1a202c;
    opacity: 0.35;
}

/* === PROGRESS BAR (stile job-progress) === */
.cv-progress-wrap {
    margin-top: 0.5rem;
}

.cv-progress-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.35rem;
}

.cv-progress-label .cv-progress-value {
    font-weight: 700;
    color: #000;
}

.cv-progress-bar {
    height: 12px;
    background: #e9ecef;
    border: 1px solid #000;
    position: relative;
    overflow: hidden;
}

.cv-progress-bar-fill {
    height: 100%;
    background: #000;
    background-image: repeating-linear-gradient(
        45deg,
        rgba(255,255,255,0.15) 0,
        rgba(255,255,255,0.15) 6px,
        transparent 6px,
        transparent 12px
    );
}

/* === METRIC CARD con icona (arricchita) === */
.cv-metric-card {
    position: relative;
}

.cv-metric-icon {
    position: absolute;
    top: 0.55rem;
    right: 0.55rem;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    border: 1px dotted #000;
    opacity: 0.75;
    transition: opacity 0.2s ease, border-color 0.2s ease;
}

.cv-metric-card:hover .cv-metric-icon {
    opacity: 1;
    border-color: #fff;
    color: #fff;
}

/* === EXPERIENCE ACTIVE: bordo sinistro accento === */
.cv-list-item.is-active {
    border-left: 4px solid #000;
    padding-left: 1rem;
    background-image: linear-gradient(to right, rgba(0,0,0,0.03), transparent 60%);
}

/* === PROJECT CARD: card con stato "in corso" accentuato === */
.cv-card.is-ongoing {
    border-width: 2px !important;
    border-color: #000 !important;
    position: relative;
}

.cv-card.is-ongoing::before {
    content: "";
    position: absolute;
    top: -1px;
    left: -1px;
    width: calc(100% + 2px);
    height: 4px;
    background: repeating-linear-gradient(
        90deg,
        #000 0,
        #000 8px,
        transparent 8px,
        transparent 14px
    );
    z-index: 2;
}

/* === STATUS DOT === */
.cv-status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
}

.cv-status-dot.is-active {
    background: #22c55e;
    box-shadow: 0 0 0 2px rgba(34,197,94,0.25);
    animation: cv-pulse 2s infinite;
}

@keyframes cv-pulse {
    0%, 100% { box-shadow: 0 0 0 2px rgba(34,197,94,0.25); }
    50%      { box-shadow: 0 0 0 5px rgba(34,197,94,0.05); }
}

/* === HERO HIGHLIGHT: uso di "F" logo per candidato (stile fornitore quotation) === */
.cv-hero-logo {
    font-family: 'Kg Happy', Arial, sans-serif;
    font-size: clamp(3.5rem, 6vw, 5rem);
    line-height: 1;
    text-align: center;
    user-select: none;
    color: #000;
}

/* === MOBILE === */
@media (max-width: 767.98px) {
    body.vw-100.vh-100 {
        height: auto !important;
        min-height: 100vh !important;
    }

    .foo-border,
    .foo-border .foo-border {
        height: auto !important;
    }

    .foo-border.overflow-auto {
        overflow: visible !important;
    }

    .cv-container {
        padding: 12px;
    }

    .cv-title {
        font-size: 1.8rem;
    }

    .cv-subtitle {
        font-size: 1.2rem;
    }

    .cv-soft-list {
        columns: 1;
    }

    .cv-top-skills-bar {
        padding: 0.75rem 1rem;
    }

    .cv-metric-value {
        font-size: 1.35rem;
    }

    .cv-card:hover {
        box-shadow: none;
        transform: none;
    }

    /* Period badge torna nel flusso su mobile */
    .cv-list-item {
        padding-right: 1.25rem;
    }

    .cv-list-item-period-corner {
        position: static;
        align-items: flex-start;
        margin-bottom: 0.5rem;
    }
}

/* === PROJECT CARD — header title (per elementi lunghi evita overflow) === */
.cv-project-header-title {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Project card footer: cliente (sx) + tipo (dx) */
.cv-project-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 1rem !important;
    background-color: #fff !important;
    border-top: 1px dashed #000 !important;
    font-size: 11px;
    color: #000;
}

.cv-project-footer-client {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cv-project-footer-client strong {
    font-weight: 700;
}

.cv-project-footer-sep {
    display: inline-block;
    width: 1px;
    height: 10px;
    border-left: 1px dashed #999;
    flex-shrink: 0;
}

.cv-project-footer-type {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.55rem;
    background: #000;
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    flex-shrink: 0;
}

.cv-project-url {
    color: #555 !important;
    font-size: 10px;
    border-bottom: 1px dashed #aaa;
    font-weight: 500;
    white-space: nowrap;
}

.cv-project-url:hover {
    color: #000 !important;
    border-bottom-color: #000;
}

/* === CLOSED PROJECT CARD (compatto, archivio) === */
.cv-closed-card {
    border: 1px dashed #999;
    background: #fafafa;
    padding: 0.7rem 0.85rem;
    height: 100%;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.cv-closed-card:hover {
    background: #fff;
    border-color: #000;
    border-style: dashed;
}

.cv-closed-card-title {
    font-size: 12px;
    font-weight: 700;
    color: #000;
    margin-bottom: 0.2rem;
    line-height: 1.3;
}

.cv-closed-card-client {
    font-size: 10px;
    color: #666;
    margin-bottom: 0.35rem;
}

.cv-closed-card-summary {
    font-size: 10px;
    line-height: 1.45;
    color: #555;
    margin-bottom: 0.45rem;
}

.cv-closed-card-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem;
}

.cv-closed-card-stack .cv-pill {
    font-size: 9px;
    padding: 0.1rem 0.4rem;
    margin: 0;
}

/* === CV PUBLIC FOOTER (minimale, senza info aziendali) === */
.cv-public-footer {
    border-top: 3px dotted #000;
    background: #fff;
}

.cv-public-footer a:hover {
    color: #000 !important;
}

/* === PDF LOADER OVERLAY === */
.cv-pdf-loader-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.96);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: cv-loader-fadein 0.15s ease;
}

.cv-pdf-loader-overlay[hidden] {
    display: none !important;
}

@keyframes cv-loader-fadein {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.cv-pdf-loader-card {
    border: 2px dashed #000;
    padding: 2.25rem 2.5rem;
    background: #fff;
    text-align: center;
    max-width: 92%;
    box-shadow: 10px 10px 0 #000;
}

.cv-pdf-spinner {
    width: 52px;
    height: 52px;
    border: 4px dashed #000;
    border-top-color: transparent;
    border-right-color: transparent;
    border-radius: 50%;
    animation: cv-spin 1.1s linear infinite;
    margin: 0 auto 1.1rem;
}

@keyframes cv-spin {
    to { transform: rotate(360deg); }
}

.cv-pdf-loader-title {
    font-size: 1.05rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #000;
    margin-bottom: 0.35rem;
}

.cv-pdf-loader-sub {
    font-size: 0.85rem;
    color: #555;
    line-height: 1.5;
    margin-bottom: 0.75rem;
}

.cv-pdf-loader-elapsed {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border: 1px solid #000;
    background: #000;
    color: #fff;
    font-family: ui-monospace, monospace;
    font-size: 0.8rem;
    letter-spacing: 0.3px;
}

/* === PRINT + PDF (usato anche da Browsershot con emulateMedia screen, ma utile per Ctrl+P) === */
@media print {
    .cv-card:hover {
        box-shadow: none;
        transform: none;
    }
    .cv-cta-card, .cv-print-hide, .cv-public-footer {
        display: none !important;
    }
    .foo-border {
        border: none !important;
        margin: 0 !important;
        width: 100% !important;
        height: auto !important;
    }
    body.vw-100.vh-100 {
        width: auto !important;
        height: auto !important;
    }
    .cv-container {
        max-width: 100% !important;
        padding: 0 !important;
    }
    .cv-card, .cv-metric-card, .card, .list-group-item {
        page-break-inside: avoid;
        break-inside: avoid;
    }
    .cv-subtitle, .cv-title {
        page-break-after: avoid;
        break-after: avoid;
    }
}

/* === Modalità PDF esplicita via query param ?pdf=1 (Browsershot) === */
body.cv-pdf-mode .cv-cta-card,
body.cv-pdf-mode .cv-print-hide,
body.cv-pdf-mode .cv-public-footer {
    display: none !important;
}

body.cv-pdf-mode .foo-border {
    border: none !important;
    margin: 0 !important;
    width: 100% !important;
    height: auto !important;
}

body.cv-pdf-mode.vw-100.vh-100 {
    width: auto !important;
    height: auto !important;
}

body.cv-pdf-mode .cv-card:hover {
    box-shadow: none !important;
    transform: none !important;
}

/* In PDF mode: evita spezzature dentro a card e colonne Bootstrap che le wrappano */
body.cv-pdf-mode .cv-card,
body.cv-pdf-mode .cv-metric-card,
body.cv-pdf-mode .cv-experience-card,
body.cv-pdf-mode .cv-closed-card,
body.cv-pdf-mode .card,
body.cv-pdf-mode .list-group-item,
body.cv-pdf-mode .row > [class*="col-"] {
    page-break-inside: avoid !important;
    break-inside: avoid !important;
}

/* Rimuovi transform/transition in PDF: possono causare misalignment nel layout statico */
body.cv-pdf-mode .cv-card,
body.cv-pdf-mode .cv-metric-card,
body.cv-pdf-mode .cv-experience-card {
    transform: none !important;
    transition: none !important;
    box-shadow: none !important;
}

/* Le section-title non devono staccarsi dalla prima card sotto */
body.cv-pdf-mode .cv-subtitle,
body.cv-pdf-mode .cv-info-text {
    page-break-after: avoid !important;
    break-after: avoid !important;
}

/* Lista highlights dentro a card: mantieni il bullet group insieme */
body.cv-pdf-mode .cv-item-highlights,
body.cv-pdf-mode .cv-item-highlights li {
    page-break-inside: avoid !important;
    break-inside: avoid !important;
}

/* Project cards in PDF: avoid Chromium/flex overlap artifacts across page breaks */
body.cv-pdf-mode .cv-project-grid {
    display: block !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

body.cv-pdf-mode .cv-project-grid > [class*="col-"] {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-bottom: 0.75rem !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
}

body.cv-pdf-mode .cv-project-card .cv-card-body {
    overflow: visible !important;
}
