/* style.css */

:root {
    --primary-color: #004080; /* 10% lighter blue */
    --background-color: #f0f2f5;
    --text-color: #333;
    --card-background: #fff;
}

body.dark-mode {
    --primary-color: #60a5fa;
    --background-color: #1f2937;
    --text-color: #f9fafb;
    --card-background: #374151;
}

body {
    margin: 0;
    font-family: 'Poppins', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    transition: background-color 0.3s, color 0.3s;
}

header {
    background-color: var(--primary-color);
    color: white;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between; /* Ensure space between nav and button */
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
}

#language-toggle {
    background: none;
    border: 2px solid white;
    color: white;
    padding: 5px 10px;
    border-radius: 20px;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s;
    margin-right: auto; /* Push the button to the far left */
}

#language-toggle:hover {
    background-color: white;
    color: var(--primary-color);
}

nav {
    display: flex;
    gap: 20px; /* Add spacing between menu items */
}

nav a {
    color: white;
    margin: 0 10px;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s;
    position: relative;
}

nav a::after {
    content: "";
    position: absolute;
    width: 0%;
    height: 2px;
    bottom: -4px;
    left: 0;
    background-color: white;
    transition: width 0.3s;
}

nav a:hover::after {
    width: 100%;
}

nav a:hover {
    text-decoration: underline;
}

#dark-mode-toggle {
    background: none;
    border: 2px solid white;
    color: white;
    padding: 5px 10px;
    border-radius: 20px;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s;
    margin-left: auto; /* Push the button to the right */
}

#dark-mode-toggle:hover {
    background-color: white;
    color: var(--primary-color);
}

.container {
    max-width: 1000px;
    margin: 30px auto;
    padding: 20px;
    background: var(--card-background);
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: background-color 0.3s;
}

h1, h2, h3 {
    color: var(--primary-color);
}

section {
    margin-bottom: 40px;
}

/* Style pour les tags des projets */
.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.tags span {
    background-color: #e0f1ff;
    color: #0066cc;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 14px;
}

/* Bouton toggle filtres */
.toggle-filters-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background-color: var(--primary-color);
    color: white;
    padding: 9px 18px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
    transition: background-color 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.toggle-filters-btn:hover {
    background-color: #003366;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* Conteneur des filtres */
#filters-container.filters-hidden {
    display: none;
}

#filters-container {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 20px 24px;
    background-color: var(--card-background);
    border: 1px solid rgba(0, 64, 128, 0.15);
    border-radius: 12px;
    margin-bottom: 24px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.07);
}

/* Ligne cadre + année côte à côte */
.filters-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

/* Groupe label + select */
.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-group > label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--primary-color);
}

#filters-container select {
    padding: 8px 12px;
    border: 1.5px solid rgba(0, 64, 128, 0.25);
    border-radius: 8px;
    background-color: var(--card-background);
    color: var(--text-color);
    font-size: 14px;
    outline: none;
    cursor: pointer;
    min-width: 150px;
    transition: border-color 0.2s;
}

#filters-container select:focus {
    border-color: var(--primary-color);
}

/* Tags en pills cliquables */
#filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

#filter-tags input[type="checkbox"] {
    display: none;
}

#filter-tags label {
    display: inline-flex;
    align-items: center;
    background-color: var(--background-color);
    border: 1.5px solid var(--primary-color);
    color: var(--primary-color);
    padding: 5px 13px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.15s, color 0.15s;
}

#filter-tags label:hover {
    background-color: var(--primary-color);
    color: white;
}

#filter-tags label:has(input:checked) {
    background-color: var(--primary-color);
    color: white;
}

/* Bouton réinitialiser */
.filters-actions {
    display: flex;
    justify-content: flex-end;
}

#reset-filters {
    background-color: transparent;
    color: #e53e3e;
    border: 1.5px solid #e53e3e;
    padding: 7px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    margin-left: 0;
    transition: background-color 0.2s, color 0.2s;
    box-shadow: none;
}

#reset-filters:hover {
    background-color: #e53e3e;
    color: white;
}

/* Style des tags sur les projets */

.projects-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.projects-group {
    display: flex;
    flex-direction: column;
    position: relative;
    padding-left: 20px;
    margin-left: 30px;
}

.projects-group-header {
    display: flex;
    align-items: center;
    font-size: 18px;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.projects-group-header::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background-color: var(--primary-color);
}

.project {
    background-color: var(--card-background);
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: background-color 0.3s ease;
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}


.project-header h3 {
    margin: 0;
    color: var(--primary-color);
}

.project .tags {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.project .tags span {
    background-color: #e0f1ff;
    padding: 5px 10px;
    border-radius: 20px;
    color: #0066cc;
    font-size: 12px;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.project .tags span:hover {
    background-color: #b3d9ff;
}

.project .truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    white-space: normal;
}

.project p {
    margin: 10px 0;
}

.year-label {
    padding-left: 10px;
    color: var(--primary-color);
}

.experiences-group {
    display: flex;
    flex-direction: column;
    gap: 30px;
    position: relative;
    padding-left: 20px;
    margin-left: 30px;
}

.experience {
    position: relative;
    padding-left: 20px;
    border-left: 3px solid var(--primary-color);
}

.experience h2 {
    margin: 0;
    color: var(--primary-color);
}

.diplomas-group {
    display: flex;
    flex-direction: column;
    gap: 30px;
    position: relative;
    padding-left: 20px;
    margin-left: 30px;
}

.diploma {
    position: relative;
    padding-left: 20px;
    border-left: 3px solid var(--primary-color);
}

.diploma h2 {
    margin: 0;
    color: var(--primary-color);
}

.certification {
    background-color: var(--card-background);
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: background-color 0.3s ease;
}

.certification h2 {
    color: var(--primary-color);
    margin-bottom: 10px;
}

.certification p {
    color: var(--text-color);
    line-height: 1.6;
}

/* Hero layout: image to the right and larger, responsive */
.hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    width: 100%;
}
.hero-card {
    flex: 1 1 0;
    min-width: 0; /* prevent overflow for long text */
}
.hero-card h1 { margin: 0 0 8px; font-size: 1.8rem; }
.hero-card .subtitle { margin: 0 0 10px; font-size: 1.05rem; color: var(--muted-color); }

.hero-image {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    padding-top: 30px;
    padding-right: 30px;
    justify-content: right;
}
.hero-image img {
    width: 240px;
    max-width: 35%;
    height: auto;
    border-radius: 12px;
    object-fit: cover;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

/* Adaptations for medium screens */
@media (max-width: 1000px) {
    .hero { gap: 16px; }
    .hero-image img { width: 200px; max-width: 32%; }
}

.truncate {
    display: inline; /* Ensure text and "voir plus" are on the same line */
    white-space: nowrap; /* Prevent wrapping */
    overflow: hidden;
    text-overflow: ellipsis;
}

.truncate span {
    font-weight: bold;
    color: var(--primary-color); /* Use the site's primary color */
    cursor: pointer;
    text-decoration: none; /* Remove underline */
    transition: color 0.3s ease; /* Smooth color transition */
}

.truncate span:hover {
    color: #0056b3; /* Slightly darker shade on hover */
}

.voir-plus {
    font-weight: bold;
    color: var(--primary-color);
    cursor: pointer;
    text-decoration: none;
    margin-left: 5px;
}

.voir-plus:hover {
    color: #0059b3; /* Slightly darker shade on hover */
}

a {
    color: var(--primary-color);
}

a:hover {
    color: #0059b3; /* Slightly darker blue on hover */
}

button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

button:hover {
    background-color: #003366; /* Darker blue on hover */
}

button#dark-mode-toggle {
    background: none;
    border: 2px solid white;
    color: white;
    padding: 5px 10px;
    border-radius: 20px;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s;
}

button#dark-mode-toggle:hover {
    background-color: white;
    color: var(--primary-color);
}

.month-divider {
    display: flex;
    align-items: center;
    margin: 20px 0;
    position: relative;
}

.month-divider span {
    font-weight: bold;
    color: var(--primary-color);
    background: white; /* Ensure text is readable */
    padding: 0 5px;
    z-index: 1; /* Ensure the text is above other elements */
}

.competences-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

/* Hero-image / photo frame */
.photo-frame{
    background:#000;               /* cadre noir mat */
    padding:14px;                  /* épaisseur du cadre */
    display:inline-block;
    border-radius:16px;            /* arrondir le cadre */
    box-shadow: 0 6px 18px rgba(0,0,0,0.12);
}
.photo-frame img{
    display:block;
    width:480px;
    max-width:45%;
    height:auto;
    object-fit:cover;
    border-radius:10px;            /* rayon intérieur un peu plus petit que le cadre */
    box-shadow:none;
    border: none;
}

/* Hamburger / close — cachés sur desktop */
.nav-toggle,
.nav-close {
    display: none;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    line-height: 1;
    padding: 4px 8px;
}

/* Adaptations pour écrans moyens */
@media (max-width:1000px){
    .photo-frame img{ width:360px; max-width:40%; }
}

/* =====================================================================
   RESPONSIVE — MOBILE APP (max 768px)
===================================================================== */
@media (max-width: 768px) {

    /* Header : langue + dark mode + hamburger en une ligne */
    header {
        flex-wrap: nowrap;
        padding: 12px 16px;
        gap: 8px;
    }

    #language-toggle {
        order: 1;
        margin-right: auto;
        font-size: 13px;
        padding: 5px 12px;
    }

    #dark-mode-toggle {
        order: 2;
        font-size: 13px;
        padding: 5px 12px;
        margin-left: 0;
    }

    .nav-toggle {
        display: block;
        order: 3;
        font-size: 26px;
    }

    /* Nav : overlay plein écran */
    nav {
        display: none;
        position: fixed;
        inset: 0;
        background-color: var(--primary-color);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 28px;
        z-index: 100;
    }

    nav.open {
        display: flex;
    }

    .nav-close {
        display: block;
        position: absolute;
        top: 20px;
        right: 24px;
        font-size: 32px;
        padding: 0;
    }

    nav a {
        font-size: 22px;
        font-weight: 700;
        margin: 0;
        padding: 12px 32px;
        border-radius: 12px;
        width: 70%;
        text-align: center;
    }

    nav a::after { display: none; }

    nav a:hover {
        background: rgba(255,255,255,0.15);
        text-decoration: none;
    }

    /* Container : plein écran, style app */
    .container {
        max-width: 100%;
        margin: 0;
        padding: 20px 16px;
        border-radius: 0;
        box-shadow: none;
    }

    /* Typographie */
    body { font-size: 16px; }
    h1 { font-size: 1.7rem; }
    h2 { font-size: 1.3rem; }
    h3 { font-size: 1.1rem; }

    /* Hero biography : photo circulaire centrée en premier */
    .hero {
        flex-direction: column;
        align-items: center;
        gap: 16px;
        text-align: center;
    }

    .hero-image {
        order: -1;
        padding: 0;
        width: auto;
        justify-content: center;
    }

    .hero-image img {
        width: 120px !important;
        max-width: 120px !important;
        height: 120px !important;
        border-radius: 50% !important;
        object-fit: cover;
    }

    .photo-frame {
        padding: 4px;
        border-radius: 50%;
        display: block;
        margin: 0 auto;
    }

    .photo-frame img {
        width: 120px !important;
        max-width: 120px !important;
        height: 120px !important;
        border-radius: 50% !important;
    }

    /* Groupes sans indentation */
    .experiences-group,
    .diplomas-group,
    .projects-group {
        margin-left: 0;
        padding-left: 0;
    }

    .projects-group-header::before { display: none; }

    /* Expériences et diplômes : cartes */
    .experience,
    .diploma {
        background: var(--card-background);
        border-radius: 12px;
        padding: 16px;
        border-left: none;
        box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    }

    /* Cartes projets */
    .project { border-radius: 12px; }

    .project-header {
        flex-wrap: wrap;
        gap: 8px;
    }

    .project .tags {
        flex-wrap: wrap;
        gap: 6px;
        margin-top: 0;
    }

    .project .tags span {
        font-size: 11px;
        padding: 3px 8px;
    }

    /* Compétences : 1 colonne */
    .competences-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    /* Filtres */
    .filters-row {
        flex-direction: column;
        gap: 12px;
    }

    #filters-container select {
        min-width: 0;
        width: 100%;
    }

    #filter-tags label {
        font-size: 12px;
        padding: 4px 10px;
    }

}
