/* Variables et reset */
:root {
    --primary-color: #3498db;
    --secondary-color: #2c3e50;
    --light-color: #ecf0f1;
    --dark-color: #34495e;
    --accent-color: #e74c3c;
    --text-color: #333;
    --light-text: #777;
    --shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
    --hover-transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    --hover-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    --glow-effect: 0 0 10px rgba(52, 152, 219, 0.5);
    --text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    /* Empêcher le curseur de texte clignotant lors du clic */
    -webkit-user-select: text;
    user-select: text;
    cursor: default;
}

body {
    color: var(--text-color);
    line-height: 1.6;
    background-color: #f9f9f9;
}

/* Conteneur principal */
.cv-container {
    max-width: 250mm;
    margin: 20px auto;
    background: white;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
    -webkit-user-modify: read-only;
    -moz-user-modify: read-only;
}

/* En-tête */
header {
    background: var(--secondary-color);
    color: white;
    padding: 40px;
    position: relative;
    overflow: hidden;
}

.header-content {
    display: flex;
    align-items: center;
    position: relative;
    z-index: 2;
}

.profile-image {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid white;
    margin-right: 30px;
    box-shadow: var(--shadow);
    transition: var(--hover-transition);
}

.profile-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-image:hover {
    transform: scale(1.05);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.3);
}

.name-title {
    flex: 1;
    position: relative;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 5px;
    font-weight: 700;
    transition: var(--hover-transition);
    display: inline-block;
    position: relative;
}

h1:hover {
    transform: translateY(-2px);
    text-shadow: var(--text-shadow);
    color: #fff;
}

h1::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), #fff);
    transition: width 0.4s ease;
}

h1:hover::after {
    width: 100%;
}

.job-title {
    font-size: 1.3rem;
    color: var(--light-color);
    font-weight: 400;
    margin-bottom: 10px;
    transition: var(--hover-transition);
    padding: 3px 0;
    position: relative;
}

.job-title:hover {
    color: #fff;
}

.job-title::before {
    content: '{ ';
    opacity: 0;
    color: var(--primary-color);
    font-weight: bold;
    transition: var(--hover-transition);
}

.job-title::after {
    content: ' }';
    opacity: 0;
    color: var(--primary-color);
    font-weight: bold;
    transition: var(--hover-transition);
}

.job-title:hover::before,
.job-title:hover::after {
    opacity: 1;
}

.header-line {
    width: 60px;
    height: 3px;
    background: var(--primary-color);
    margin: 10px 0;
}

/* Contact Info */
.contact-info {
    display: flex;
    flex-wrap: wrap;
    margin-top: 20px;
}

.contact-item {
    display: flex;
    align-items: center;
    margin-right: 20px;
    margin-bottom: 10px;
    transition: var(--hover-transition);
    padding: 3px 6px;
    border-radius: 4px;
}

.contact-item:hover {
    transform: translateY(-3px);
    background-color: rgba(255, 255, 255, 0.1);
    box-shadow: var(--hover-shadow);
}

.contact-item a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.contact-icon {
    width: 20px;
    margin-right: 8px;
    color: var(--primary-color);
}

/* Contenu principal */
.main-content {
    display: flex;
    padding: 0;
}

/* Barre latérale */
.sidebar {
    flex: 0 0 30%;
    background: var(--light-color);
    padding: 10px 30px;
}

/* Contenu principal */
.content {
    flex: 0 0 70%;
    padding: 10px 30px;
}

/* Sections */
.section {
    margin-bottom: 25px;
}

.section:last-child {
    margin-bottom: 0;
}

.section-title {
    font-size: 1.4rem;
    color: var(--primary-color);
    /* margin-bottom: 15px; */
    position: relative;
    font-weight: 600;
    transition: var(--hover-transition);
}

.section-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 30px;
    height: a3px;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

.section:hover .section-title::after {
    width: 60px;
}

.section+.section::before {
    content: "";
    display: block;
    border-top: 2px solid var(--primary-color);
    margin: 10px 0;
}

/* Section Profil avec animation spéciale */
.section:first-child {
    position: relative;
    overflow: hidden;
    border-left: 0 solid var(--primary-color);
    transition: all 0.5s ease;
    padding-left: 0;
    margin-bottom: 20px;
}

.section:first-child:hover {
    border-left: 5px solid var(--primary-color);
    padding-left: 15px;
    background: linear-gradient(90deg, rgba(52, 152, 219, 0.05), transparent);
}

.section:first-child p {
    transition: var(--hover-transition);
}

.section:first-child:hover p {
    transform: translateX(3px);
}

.section:first-child::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary-color));
    transition: width 0.6s ease;
}

.section:first-child:hover::after {
    width: 100%;
}

/* Compétences */
.skills-list {
    list-style: none;
}

.skill-item {
    margin-bottom: 10px;
    transition: var(--hover-transition);
}

.skill-item:hover {
    transform: translateX(5px);
}

.skill-item:hover .skill-name {
    color: var(--primary-color);
    font-weight: 600;
}

.skill-name {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.skill-bar {
    width: 100%;
    height: 8px;
    background: #ddd;
    border-radius: 4px;
    overflow: hidden;
    transition: var(--hover-transition);
}

.skill-level {
    height: 100%;
    background: var(--primary-color);
    transition: var(--hover-transition);
}

.skill-item:hover .skill-level {
    filter: brightness(1.2);
    box-shadow: 0 0 3px var(--primary-color);
}

/* Timeline pour éducation et expérience */
.timeline-item {
    position: relative;
    padding-left: 30px;
    margin-bottom: 15px;
    transition: var(--hover-transition);
}

.timeline-item:hover {
    transform: translateX(5px);
}

.timeline-item:hover::before {
    transform: scale(1.5);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.3);
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 5px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary-color);
    z-index: 1;
    transition: var(--hover-transition);
}

.timeline-item::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 5px;
    width: 2px;
    height: calc(100% + 20px);
    background: #ddd;
}

.timeline-item:last-child::after {
    display: none;
}

.timeline-date {
    font-weight: 500;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.timeline-title {
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 1.1rem;
    transition: color 0.3s ease;
}

.timeline-item:hover .timeline-title {
    color: var(--primary-color);
}

.timeline-place {
    font-style: italic;
    color: var(--light-text);
    margin-bottom: 8px;
}

.timeline-description {
    color: var(--text-color);
    font-size: 0.95rem;
}

/* Projets */
.project-item {
    margin-bottom: 20px;
}

.project-title {
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 1.1rem;
}

.project-tech {
    color: var(--accent-color);
    font-size: 0.9rem;
    margin-bottom: 8px;
}

/* Langues */
.languages-list {
    list-style: none;
}

.language-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    transition: var(--hover-transition);
    padding: 5px;
    border-radius: 4px;
}

.language-item:hover {
    background-color: rgba(52, 152, 219, 0.1);
    transform: translateX(5px);
}

.language-item:hover .language-name {
    color: var(--primary-color);
}

.language-name {
    font-weight: 500;
}

.language-level {
    color: var(--light-text);
}

/* Intérêts */
.interests-list {
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    margin-top: 10px;
}

.interest-item {
    background: var(--light-color);
    /* padding: 5px 10px; */
    border-radius: 15px;
    margin: 0 8px 8px 0;
    font-size: 0.9rem;
    transition: var(--hover-transition);
}

.interest-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--hover-shadow);
    background: var(--primary-color);
    color: white;
}

/* QR Code pour version en ligne */
.qr-section {
    text-align: center;
    margin-top: 20px;
}

.qr-code {
    width: 100px;
    height: 100px;
    margin: 0 auto;
    background-color: #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--hover-transition);
}

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

.qr-code:hover {
    transform: scale(1.1);
    box-shadow: var(--hover-shadow);
}

.qr-caption {
    font-size: 0.8rem;
    margin-top: 5px;
    color: var(--light-text);
}

a {
    color: white;
    text-decoration: none;
    transition: var(--hover-transition);
    cursor: pointer;
}

p,
.timeline-description,
.language-item,
.interest-item,
.timeline-title,
.timeline-place,
.timeline-date,
.skill-name {
    cursor: text;
}

.opquast-badge {
    width: 100px;
    height: auto;
    margin-left: 10px;
    vertical-align: middle;
    cursor: pointer;
}

/* Responsive Design */
@media print {
    body {
        background: white;
    }

    .cv-container {
        box-shadow: none;
        margin: 0;
        width: 100%;
        max-width: none;
    }

    /* Ajustements pour l'impression */
    header {
        padding: 40px;
        page-break-after: avoid;
        page-break-inside: avoid;
    }

    .header-content {
        justify-content: center;
    }

    .profile-image {
        width: 150px;
        height: 150px;
    }

    h1 {
        font-size: 2rem;
    }

    .job-title {
        font-size: 1.1rem;
    }

    .main-content {
        page-break-inside: avoid;
    }

    .qr-section {
        display: block;
    }
}

@media (max-width: 768px) {
    .cv-container {
        margin: 0;
        box-shadow: none;
    }

    .header-content {
        flex-direction: column;
        text-align: center;
    }

    .profile-image {
        margin: 0 auto 20px;
    }

    .name-title {
        text-align: center;
    }

    .header-line {
        margin: 10px auto;
    }

    .contact-info {
        justify-content: center;
    }

    .main-content {
        flex-direction: column;
    }

    .sidebar,
    .content {
        flex: 0 0 100%;
    }
}