/* ===================== GENERAL STYLES ===================== */
body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    color: #333;
    padding-top: 100px;
}

.container {
    width: 80%;
    margin: auto;
    overflow: visible;
}

header {
    background: #35424a;
    color: #ffffff;
    padding-top: 30px;
    height: 70px;
    border-bottom: #e8491d 3px solid;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
}

header a {
    color: #ffffff;
    text-decoration: none;
    text-transform: uppercase;
    font-size: 16px;
}

header ul {
    padding: 0;
    list-style: none;
}

header li {
    display: inline;
    padding: 0 20px 0 0;
}

header #branding {
    float: left;
}

header #branding h1 {
    margin: 0;
}

header nav {
    float: right;
    margin-top: 10px;
}

.section {
    padding: 20px;
    margin-bottom: 20px;
    background: #e6e6e6;
}

.section h2 {
    margin-top: 0;
}

footer {
    background: #35424a;
    color: #ffffff;
    text-align: center;
    padding: 20px;
    margin-top: 20px;
}

.custom-link {
    color: inherit;
    text-decoration: underline;
    text-decoration-thickness: 1px;
}

.custom-link:hover {
    color: #007BFF;
}

/* ===================== RESPONSIVE HEADER ===================== */
@media (min-width: 550px) {    
    header #branding h1 .highlight::before { content: "Adrien RENGGLI"; visibility: visible; display: inline-block; }
}

@media (max-width: 550px) {
    header #branding h1 .highlight::before { content: "RENGGLI"; visibility: visible; display: inline-block; }
}

@media (max-width: 400px) {
    header #branding h1 .highlight::before { content: ""; }
}

/* ===================== HAMBURGER MENU ===================== */
#menu-toggle, .hamburger-menu, .menu-btn { display: none; }

@media (min-width: 0) {
    .hamburger-menu { display: block; }
    .menu-btn { display: block; position: fixed; top: 30px; right: 20px; width: 50px; height: 50px; cursor: pointer; z-index: 1000; }
    header nav { display: none; }
}

.menu-btn span, .menu-btn span:before, .menu-btn span:after {
    content: ''; display: block; width: 100%; height: 4px; background: #fff; position: absolute; transition: all 0.3s ease;
}

.menu-btn span { top: 50%; transform: translateY(-50%); }
.menu-btn span:before { top: -10px; }
.menu-btn span:after { bottom: -10px; }
#menu-toggle:checked + .menu-btn span { background-color: transparent; }
#menu-toggle:checked + .menu-btn span:before { transform: rotate(45deg); top: 0; }
#menu-toggle:checked + .menu-btn span:after { transform: rotate(-45deg); bottom: 0; }

.menu-box {
    display: none; position: fixed; top: 70px; right: 0; width: 200px;
    max-height: calc(100vh - 70px); overflow-y: auto; background: #555;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); z-index: 999; text-align: right; padding-right: 20px;
}

#menu-toggle:checked ~ .menu-box { display: block; }
.menu-box li { display: block; padding: 10px 20px; }

/* ===================== CARDS & GRID ===================== */
.cards-grid { display: flex; flex-wrap: wrap; gap: 20px; justify-content: center; }

.card {
    width: 250px; padding: 20px; background-color: #f5f5f5; border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05); display: flex; flex-direction: column;
    justify-content: space-start; align-items: center; text-align: center;
    transition: transform 0.2s;
}

.card:hover { transform: translateY(-4px); }
.card i { color: #35424a; margin-bottom: 10px; }
.card-img { width: 35px; height: auto; margin-bottom: 7px; }
.card h3 { margin: 10px 0 5px 0; font-size: 1.2em; }
.card p { font-size: 0.95em; color: #333; }
.card .link-btn { margin-top: auto; }

/* ===================== TIMELINE & EXPERIENCES ===================== */
.timeline-entry { margin-bottom: 1.5em; opacity: 0; transform: translateY(20px); transition: all 0.5s ease-in-out; }
.timeline-icon { font-size: 1.8em; margin-right: 1em; color: #35424a; }
.timeline-content {
    background-color: #fff; padding: 1em; border-left: 5px solid #35424a;
    border-radius: 8px; flex: 1; transition: 0.2s; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.timeline-entry.appear { opacity: 1; transform: translateY(0); }
.timeline-content:hover { transform: translateY(-4px); }
.timeline-content h4 { margin-bottom: 0.3em; }
.timeline-content p { margin-top: 0.3em; }

.status { font-size: 0.9em; font-weight: normal; color: #777; margin-left: 0.5em; }
.badge { background-color: #e8491d; color: white; font-size: 0.75em; padding: 2px 6px; border-radius: 12px; margin-left: 10px; vertical-align: middle; }
.badge.nationality { background-color: #e6f2ff; color: #0055a5; font-size: 0.85rem; font-weight: 600; }

.icon-list { list-style: none; padding-left: 0; margin-top: 10px; }
.icon-list li { margin-bottom: 8px; position: relative; padding-left: 25px; }
.icon-list li::before {
    content: "\f00c"; font-family: "Font Awesome 6 Free"; font-weight: 900;
    position: absolute; left: 0; top: 0; color: #007acc;
}

/* ===================== SKILLS & COURSES ===================== */
.skills-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.5em; }
.skill-card {
    background-color: #f9f9f9; border-left: 5px solid #35424a; border-radius: 8px; padding: 1em;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05); transition: transform 0.2s;
}
.skill-card:hover { transform: translateY(-4px); }
.skill-card h3 { margin-top: 0; font-size: 1.1em; color: #333; }
.skill-card ul { list-style: none; padding: 0; margin: 0; }
.skill-card li { margin: 0.5em 0; display: flex; align-items: flex-start; gap: 0.5em; }
.skill-card i, .skill-card img.icon-img { width: 20px; height: 20px; }
.bullet-icon, .bullet-emoji { margin-right: 8px; width: 20px; display: inline-block; text-align: center; color: #333;}
.bullet-svg { width: 20px; height: 20px; margin-right: 8px; vertical-align: middle; display: inline-block; }

.skill-list { list-style: none; padding-left: 0; display: flex; flex-wrap: wrap; gap: 1em; }
.skill-list li { display: flex; align-items: center; gap: 0.5em; background-color: #f0f0f0; padding: 6px 12px; border-radius: 6px; font-size: 16px; }
.skill-list i { font-size: 18px; color: #333; }

/* ===================== BUTTONS & LINKS ===================== */
.link-btn {
    display: inline-flex; align-items: center; justify-content: center; margin-top: 10px;
    padding: 8px 14px; background-color: #d9534f; color: #fff; border-radius: 6px;
    text-decoration: none; font-weight: bold; transition: background-color 0.2s ease;
}
.link-btn i { color: #fff !important; font-size: 1.2em; margin-right: 6px; margin-top: 5px; }
.link-btn:hover { background-color: #c9302c; }

.social-icons { margin-top: 1em; padding: 10px 0; text-align: center; display: flex; justify-content: center; flex-wrap: wrap; gap: 15px; }
.icon-btn {
    display: inline-block; margin: 0 8px; width: 40px; height: 40px; background-color: #35424a;
    color: white; border-radius: 50%; text-align: center; line-height: 40px; font-size: 20px;
    transition: all 0.3s ease; transform: scale(1);
}
.icon-btn:hover { background-color: #555; color: #fff; transform: scale(1.1); }

.yt-link { display: inline-flex; align-items: center; gap: 6px; color: #e8491d; font-weight: bold; text-decoration: none; transition: color 0.3s ease; }
.yt-link:hover { color: #ff0000; }
.yt-link i { font-size: 1em; }

#backToTopBtn {
    display: none; position: fixed; bottom: 20px; right: 30px; z-index: 99; border: none; outline: none;
    background-color: #555; color: white; cursor: pointer; padding: 15px; border-radius: 10px; font-size: 18px; font-weight: bold;
}
#backToTopBtn:hover { background-color: #333; }

/* ===================== CONTACT ===================== */
.contact-card {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 15px;
    background-color: #f9f9f9; padding: 20px; border-radius: 15px; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05); margin-top: 20px; transition: transform 0.2s;
}
.contact-card:hover { transform: translateY(-4px); }
.contact-item { display: flex; align-items: center; font-size: 1rem; color: #333; }
.contact-item i { margin-right: 10px; color: #35424a; min-width: 20px; }

#phoneLink, #emailLink { color: inherit; text-decoration: none; font-weight: normal; }
#phoneLink:hover, #emailLink:hover { text-decoration: underline; color: #0077cc; }

/* ===================== LANGUAGE SWITCHER ===================== */
.lang-switch {
    float: right;
    margin-top: 15px;
    margin-right: 20px;
}

.lang-btn {
    background: transparent;
    border: 1px solid #ffffff;
    color: #ffffff;
    padding: 5px 10px;
    cursor: pointer;
    border-radius: 4px;
    margin-left: 5px;
    transition: background 0.3s;
    font-weight: bold;
}

.lang-btn.active, .lang-btn:hover {
    background: #e8491d;
    border-color: #e8491d;
}

@media (max-width: 768px) {
    .lang-switch { margin-right: 60px; } /* Prevents overlap with the hamburger menu */
}

/* ===================== MODAL OVERLAY ===================== */
.modal {
    display: none; /* Caché par défaut */
    position: fixed;
    z-index: 2000; /* Au-dessus du header (qui a z-index: 1000) */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6); /* Fond sombre transparent */
}

.modal-content {
    background-color: #fefefe;
    margin: 15vh auto; /* Centré verticalement et horizontalement */
    padding: 25px;
    border-radius: 12px;
    width: 80%;
    max-width: 500px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    position: relative;
    animation: modalAppear 0.3s ease-out;
}

@keyframes modalAppear {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.close-btn {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.close-btn:hover, .close-btn:focus {
    color: #e8491d;
    text-decoration: none;
}

/* Rendre la liste des cours interactive */
.course-item {
    cursor: pointer;
    transition: background-color 0.2s, transform 0.2s;
}

.course-item:hover {
    background-color: #e0e0e0 !important;
    transform: scale(1.03);
}