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

body {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.4;
    color: var(--arcade-text-primary);
    background-color: var(--arcade-bg-primary);
    transition: var(--arcade-transition);
}

/* Container principal extensible */
.container {
    width: 100%;
    margin: 0 auto;
    padding: 15mm;
    min-height: 297mm;
    background-color: var(--arcade-bg-primary);
}

/* Header */
.main-header {
    text-align: center;
    margin-bottom: 2rem;
    border-bottom: 3px solid var(--arcade-border-strong);
    padding-bottom: 1rem;
    position: relative;
}

.main-header h1 {
    font-size: 2.2em;
    font-weight: 300;
    color: var(--arcade-text-primary);
    margin-bottom: 0.3rem;
}

.main-header h2 {
    font-size: 1.4em;
    font-weight: 400;
    color: var(--arcade-text-secondary);
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 0.9em;
    color: var(--arcade-text-secondary);
    font-style: italic;
}

/* Sections de périodes */
.period-section {
    margin-bottom: 2.5rem;
    break-inside: avoid;
}

.period-header {
    margin-bottom: 1rem;
    padding: 0.8rem 1.2rem;
    background: var(--arcade-bg-secondary);
    border-left: 4px solid var(--arcade-accent);
    border-radius: 4px;
    border: 1px solid var(--arcade-border);
}

.period-header h3 {
    font-size: 1.3em;
    font-weight: 600;
    color: var(--arcade-text-primary);
    margin-bottom: 0.2rem;
}

.period-subtitle {
    font-size: 0.9em;
    color: var(--arcade-text-secondary);
    font-style: italic;
}

/* Diagramme de Gantt */
.gantt-chart {
    position: relative;
    min-height: 200px;
    background-color: var(--arcade-bg-secondary);
    border: 1px solid var(--arcade-border);
    border-radius: 6px;
    padding: 2rem 1rem 3rem 1rem;
    overflow-x: auto;
    overflow-y: hidden;
}

/* Scrollbar personnalisée */
.gantt-chart::-webkit-scrollbar {
    height: 8px;
}

.gantt-chart::-webkit-scrollbar-track {
    background: var(--arcade-bg-primary);
    border-radius: 4px;
}

.gantt-chart::-webkit-scrollbar-thumb {
    background: var(--arcade-border);
    border-radius: 4px;
}

.gantt-chart::-webkit-scrollbar-thumb:hover {
    background: var(--arcade-text-secondary);
}

/* Timeline horizontale */
.timeline {
    position: relative;
    height: 100%;
    border-bottom: 2px solid var(--arcade-border);
    min-width: 100%;
}

/* Axe des années */
.year-axis {
    position: absolute;
    bottom: -35px;
    left: 0;
    right: 0;
    height: 30px;
    border-top: 2px solid var(--arcade-border);
    background: linear-gradient(to bottom, rgba(52,73,94,0.1) 0%, transparent 100%);
}

.year-marker {
    position: absolute;
    bottom: 5px;
    transform: translateX(-50%);
    font-size: 0.8em;
    color: var(--arcade-text-primary);
    font-weight: 600;
    background: var(--arcade-bg-primary);
    padding: 2px 6px;
    border-radius: 3px;
    border: 1px solid var(--arcade-border);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.year-marker::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 10px;
    background-color: var(--arcade-bg-secondary);
    box-shadow: 0 0 0 1px white;
}

/* Lignes pointillées verticales pour les années */
.year-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1px;
    border-left: 1px dashed var(--arcade-border);
    opacity: 0.8;
    pointer-events: none;
    z-index: 0;
}

/* Barres d'emploi */
.job-bar {
    position: absolute;
    height: 28px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    padding: 0 8px;
    cursor: pointer;
    transition: opacity 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border: 1px solid rgba(255,255,255,0.3);
    z-index: 1;
}

.job-bar:hover {
    opacity: 0.8;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.job-text {
    font-size: 0.75em;
    font-weight: 600;
    color: white;
    text-shadow: 0 1px 3px rgba(0,0,0,0.8);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Couleurs par entreprise */
.company-mairie { background: linear-gradient(135deg, #3498db, #2980b9); }
.company-la-poste { background: linear-gradient(135deg, #f1c40f, #f39c12); }
.company-adecco { background: linear-gradient(135deg, #e74c3c, #c0392b); }
.company-ratp { background: linear-gradient(135deg, #9b59b6, #8e44ad); }
.company-activite-salariee { background: linear-gradient(135deg, #7f8c8d, #5d6d7e); }
.company-employeur-particulier { background: linear-gradient(135deg, #1abc9c, #16a085); }
.company-urssaf { background: linear-gradient(135deg, #34495e, #2c3e50); }
.company-darty-sav { background: linear-gradient(135deg, #e67e22, #d35400); }
.company-manpower { background: linear-gradient(135deg, #2ecc71, #27ae60); }
.company-creteil { background: linear-gradient(135deg, #3498db, #2980b9); }
.company-capgemini { background: linear-gradient(135deg, #9b59b6, #8e44ad); }
.company-alliance { background: linear-gradient(135deg, #e74c3c, #c0392b); }
.company-groupe-altimate { background: linear-gradient(135deg, #f39c12, #e67e22); }
.company-ijenko { background: linear-gradient(135deg, #1abc9c, #16a085); }
.company-118000 { background: linear-gradient(135deg, #3498db, #2980b9); }
.company-extia { background: linear-gradient(135deg, #e74c3c, #c0392b); }
.company-bilendi-tech { background: linear-gradient(135deg, #9b59b6, #8e44ad); }
.company-ocus { background: linear-gradient(135deg, #2ecc71, #27ae60); }
.company-smice { background: linear-gradient(135deg, #e67e22, #d35400); }

/* Footer */
.main-footer {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid var(--arcade-border);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-content h3 {
    text-align: center;
    font-size: 1.6em;
    font-weight: 300;
    color: var(--arcade-text-primary);
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--arcade-accent);
}

.statistics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-item {
    background: var(--arcade-bg-secondary);
    padding: 1.2rem;
    border-radius: 8px;
    border: 1px solid var(--arcade-border);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    text-align: center;
}

.stat-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.stat-value {
    font-size: 1.3em;
    font-weight: 600;
    color: var(--arcade-text-primary);
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.85em;
    color: var(--arcade-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Catégories de stats avec couleurs différentes */
.stat-overview {
    border-left: 4px solid var(--arcade-accent);
}

.stat-duration {
    border-left: 4px solid var(--arcade-accent);
}

.stat-records {
    border-left: 4px solid var(--arcade-accent);
}

.stat-companies {
    border-left: 4px solid var(--arcade-accent);
}

.stat-financial {
    border-left: 4px solid var(--arcade-accent);
}

/* Optimisation impression */
@media print {
    body {
        font-size: 11pt;
        line-height: 1.3;
    }
    
    .container {
        padding: 10mm;
        margin: 0;
        max-width: none;
    }
    
    .period-section {
        break-inside: avoid;
        margin-bottom: 1.5rem;
    }
    
    .job-bar {
        box-shadow: none;
        border: 1px solid #333;
    }
    
    .main-footer {
        break-inside: avoid;
    }
}

/* Responsive pour écrans plus petits */
@media screen and (max-width: 768px) {
    .container {
        padding: 1rem;
        max-width: 100%;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .main-header h1 {
        font-size: 1.8em;
    }
    
    .job-text {
        font-size: 0.7em;
    }
}