/* CV Professionale - Sarino Alfonso Grande */
/* Design moderno ottimizzato per stampa A4 e web */

:root {
    /* Colori principali */
    --primary-dark: #1a1a2e;
    --secondary-dark: #16213e;
    --accent-blue: #0f3460;
    --accent-red: #e94560;
    --accent-gradient: linear-gradient(135deg, #0f3460 0%, #e94560 100%);
    
    /* Colori testo */
    --text-light: #ffffff;
    --text-dark: #2d2d2d;
    --text-muted: #6c757d;
    
    /* Sfondo */
    --bg-light: #f8f9fa;
    --bg-white: #ffffff;
    
    /* Dimensioni A4 */
    --page-width: 210mm;
    --page-height: 297mm;
    --sidebar-width: 75mm;
    --main-width: 135mm;
    --page-margin: 0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 10pt;
    line-height: 1.5;
    color: var(--text-dark);
    background: #e0e0e0;
}

/* ================================
   STRUTTURA PAGINA
   ================================ */

.cv-page {
    width: var(--page-width);
    min-height: var(--page-height);
    margin: 20px auto;
    display: flex;
    background: var(--bg-white);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

/* ================================
   SIDEBAR
   ================================ */

.sidebar {
    width: var(--sidebar-width);
    min-height: var(--page-height);
    background: var(--primary-dark);
    color: var(--text-light);
    padding: 25px 20px;
    display: flex;
    flex-direction: column;
}

.profile-section {
    text-align: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.profile-photo {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--accent-red);
    margin-bottom: 15px;
}

.profile-name {
    font-size: 14pt;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.2;
}

.profile-title {
    font-size: 8pt;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Sezioni sidebar */
.sidebar-section {
    margin-bottom: 20px;
}

.sidebar-section h3 {
    font-size: 9pt;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
    padding-bottom: 6px;
    border-bottom: 2px solid var(--accent-red);
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-section h3 i {
    font-size: 10pt;
    color: var(--accent-red);
}

/* Contatti */
.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 8pt;
}

.contact-item i {
    width: 16px;
    color: var(--accent-red);
    text-align: center;
    margin-top: 2px;
}

.contact-item a {
    color: var(--text-light);
    text-decoration: none;
}

.contact-item a:hover {
    text-decoration: underline;
}

/* Skills con barre di progresso */
.skill-item {
    margin-bottom: 12px;
}

.skill-name {
    font-size: 8pt;
    margin-bottom: 4px;
    display: flex;
    justify-content: space-between;
}

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

.skill-progress {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 3px;
    transition: width 0.5s ease;
}

/* Lingue */
.language-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 8pt;
}

.language-level {
    font-size: 7pt;
    background: rgba(255, 255, 255, 0.15);
    padding: 2px 8px;
    border-radius: 10px;
}

/* Software tags */
.software-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.software-tag {
    font-size: 7pt;
    background: rgba(255, 255, 255, 0.1);
    padding: 3px 8px;
    border-radius: 3px;
    border-left: 2px solid var(--accent-red);
}

/* QR Code */
.qr-section {
    margin-top: auto;
    text-align: center;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.qr-code {
    width: 60px;
    height: 60px;
    margin: 0 auto 8px;
    background: white;
    padding: 5px;
    border-radius: 5px;
}

.qr-code img {
    width: 100%;
    height: 100%;
}

.qr-label {
    font-size: 7pt;
    color: rgba(255, 255, 255, 0.7);
}

/* ================================
   AREA PRINCIPALE
   ================================ */

.main-content {
    width: var(--main-width);
    padding: 25px 25px 25px 20px;
    background: var(--bg-white);
}

/* Header principale */
.main-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--bg-light);
}

.main-header h1 {
    font-size: 22pt;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 5px;
}

.main-header .tagline {
    font-size: 10pt;
    color: var(--text-muted);
    font-style: italic;
}

/* Sezioni contenuto */
.content-section {
    margin-bottom: 18px;
}

.content-section h2 {
    font-size: 11pt;
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 12px;
    padding-bottom: 6px;
    border-bottom: 2px solid var(--accent-red);
    display: flex;
    align-items: center;
    gap: 8px;
}

.content-section h2 i {
    color: var(--accent-red);
}

/* Profilo */
.profile-text {
    font-size: 9pt;
    line-height: 1.6;
    color: var(--text-dark);
    text-align: justify;
}

/* Timeline Esperienze */
.timeline {
    position: relative;
    padding-left: 20px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 5px;
    bottom: 5px;
    width: 2px;
    background: linear-gradient(to bottom, var(--accent-red), var(--accent-blue));
}

.timeline-item {
    position: relative;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px dashed #e0e0e0;
}

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

.timeline-item::before {
    content: '';
    position: absolute;
    left: -20px;
    top: 5px;
    width: 10px;
    height: 10px;
    background: var(--accent-red);
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 0 0 2px var(--accent-red);
}

.timeline-period {
    font-size: 8pt;
    color: var(--accent-red);
    font-weight: 600;
    margin-bottom: 4px;
}

.timeline-role {
    font-size: 10pt;
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 2px;
}

.timeline-company {
    font-size: 9pt;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.timeline-description {
    font-size: 8pt;
    line-height: 1.5;
    color: var(--text-dark);
}

/* Progetti */
.projects-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.project-card {
    background: var(--bg-light);
    padding: 12px;
    border-radius: 6px;
    border-left: 3px solid var(--accent-red);
}

.project-name {
    font-size: 9pt;
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 5px;
}

.project-description {
    font-size: 7.5pt;
    line-height: 1.4;
    color: var(--text-muted);
}

/* Formazione */
.education-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px dashed #e0e0e0;
}

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

.education-title {
    font-size: 9pt;
    font-weight: 600;
    color: var(--primary-dark);
}

.education-institution {
    font-size: 8pt;
    color: var(--text-muted);
}

.education-year {
    font-size: 8pt;
    color: var(--accent-red);
    font-weight: 600;
}

/* Pubblicazioni */
.publication-item {
    margin-bottom: 10px;
    padding-left: 15px;
    border-left: 2px solid var(--accent-blue);
}

.publication-title {
    font-size: 9pt;
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 3px;
}

.publication-description {
    font-size: 8pt;
    color: var(--text-muted);
}

/* ================================
   PAGINA 2+ (aggiunte)
   ================================ */

.page-break {
    page-break-before: always;
}

.cv-page.secondary .sidebar {
    background: var(--secondary-dark);
}

/* ================================
   STILE STAMPA
   ================================ */

@media print {
    body {
        background: white;
    }
    
    .cv-page {
        margin: 0;
        box-shadow: none;
        width: 210mm;
        height: 297mm;
    }
    
    .page-break {
        page-break-before: always;
    }
    
    @page {
        size: A4;
        margin: 0;
    }
}

/* ================================
   RESPONSIVE WEB
   ================================ */

@media screen and (max-width: 800px) {
    .cv-page {
        width: 100%;
        flex-direction: column;
        margin: 0;
    }
    
    .sidebar {
        width: 100%;
        min-height: auto;
        padding: 20px;
    }
    
    .main-content {
        width: 100%;
        padding: 20px;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
    }
}

/* ================================
   ANIMAZIONI WEB
   ================================ */

@media screen {
    .skill-progress {
        animation: skillFill 1s ease-out;
    }
    
    @keyframes skillFill {
        from { width: 0; }
    }
    
    .timeline-item {
        animation: fadeInUp 0.5s ease-out;
    }
    
    @keyframes fadeInUp {
        from {
            opacity: 0;
            transform: translateY(10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}
