/* --- HEADER CLASSIQUE --- */
header,
.home-page.scrolled header {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background-color: #010030;
    color: white;
    z-index: 2000;
    display: block;
    text-align: center;
    box-shadow: 0 2px 16px rgba(0,0,0,0.07);
    margin: 0;
    padding: 10px 20px 70px 20px !important;
}

/* --- HEADER PLEIN ÉCRAN HOME --- */
.home-page:not(.scrolled) header {
    position: absolute !important;
    height: 100vh;
    width: 100vw;
    left: 0;
    top: 0;
    padding: 0 !important;
    box-shadow: none;
    opacity: 1;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: height 0.7s cubic-bezier(.4,0,.2,1), padding 0.7s cubic-bezier(.4,0,.2,1), background 0.7s cubic-bezier(.4,0,.2,1), box-shadow 0.7s cubic-bezier(.4,0,.2,1), opacity 0.7s cubic-bezier(.4,0,.2,1);
}

/* --- LOGO --- */
.home-page #main-logo {
    position: relative !important;
    display: block !important;
    margin: 0 auto !important;
    left: 0 !important;
    right: 0 !important;
    top: unset !important;
    height: 300px !important;
    width: auto !important;
    z-index: 3001 !important;
    transform: scale(1.1);
    transition: none !important;
}
#main-logo.logo-transition {
    z-index: 9999 !important;
    position: absolute !important;
    transition: none !important;
}
.home-page.scrolled #main-logo,
header img#main-logo {
    position: absolute !important;
    top: 10px !important;
    left: 10px !important;
    height: 100px !important;
    width: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    z-index: 1000 !important;
    transform: none !important;
    transition: none !important;
}

/* --- LOGO & SVG CENTRÉS --- */
.logo-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
header .logo-svg-text,
.home-page .logo-svg-text {
    display: flex;
    justify-content: center;
    align-items: center;
}
.logo-svg-text img {
    width: 300px;
    height: auto;
    display: block;
    margin-top: 10px;
    margin-left: 0;
    margin-right: 0;
}
.home-page .logo-svg-text {
    margin-top: 60px;
}
.home-page.scrolled .logo-svg-text,
header .logo-svg-text {
    margin-top: 10px;
    margin-left: 0px;
}

/* --- PROFIL & BOUTONS --- */
.home-page header .profile-container {
    display: none !important;
}
.home-page.scrolled header .profile-container,
header .profile-container {
    display: flex !important;
    z-index: 4000 !important;
    position: absolute;
    top: 20px;
    right: 70px;
    align-items: center;
    gap: 10px;
}
.profile-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #007BFF;
    background: #e3eafc;
    font-size: 1.4rem;
    font-weight: bold;
    color: #007BFF;
}
.profile-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.login-btn,
.logout-btn {
    background-color: #FF4D4D;
    color: white;
    border: none;
    padding: 10px 10px;
    cursor: pointer;
    border-radius: 10px;
    font-size: 1.7rem;
    transition: background 0.3s;
}
.login-btn:hover,
.logout-btn:hover {
    background-color: #CC0000;
}

/* --- MENU --- */
.main-nav {
    width: 100%;
    background: #222;
    position: absolute;
    top: 90px;
    left: 0;
    z-index: 20;
    margin-bottom: 0;
    padding-bottom: 0;
}
.main-nav ul {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 40px;
    list-style: none;
    margin: 0;
    padding: 15px 0 15px 0;
}
.main-nav li a {
    color: white;
    text-decoration: none;
    font-size: 1.5rem;
    padding: 8px 16px;
    border-radius: 5px;
    transition: background 0.3s, border 0.3s;
    border: 2px solid #ffffff31;
}
.main-nav li a:hover,
.main-nav li a.active,
.main-nav li a.active:hover {
    background: #007BFF;
    border-color: #007BFF;
    color: #fff;
}
.home-page header .main-nav {
    display: none !important;
}

/* --- TITRE --- */
.header-page-title h1 {
    transition: color 0.7s, font-size 0.7s, opacity 0.7s, transform 0.7s;
}
.home-page .header-page-title h1 {
    color: #ffffff;
    font-size: 2.5rem;
    opacity: 1;
    transform: scale(1.1);
}
.home-page.scrolled .header-page-title h1 {
    color: #ffffff;
    font-size: 2rem;
    opacity: 1;
    transform: scale(1);
}

/* Flèche animée sous le logo en plein écran sur la home */
.home-page .scroll-down-arrow {
    margin-top: 40px;
    width: 40px;
    height: 40px;
    border-left: 6px solid #fff;
    border-bottom: 6px solid #fff;
    transform: rotate(-45deg);
    animation: bounceDown 1.2s infinite;
    opacity: 0.8;
}
@keyframes bounceDown {
    0%, 100% { transform: translateY(0) rotate(-45deg); }
    50% { transform: translateY(18px) rotate(-45deg); }
}
.home-page.scrolled .scroll-down-arrow {
    display: none;
}

/* --- LOADING DOTS --- */
.dots-loader {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(255,255,255,0.85);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}
.dots-container {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
}
.dot {
    height: 20px;
    width: 20px;
    margin-right: 10px;
    border-radius: 10px;
    background-color: #b3d4fc;
    animation: pulse 1.5s infinite ease-in-out;
}
.dot:last-child {
    margin-right: 0;
}
.dot:nth-child(1) { animation-delay: -0.3s; }
.dot:nth-child(2) { animation-delay: -0.1s; }
.dot:nth-child(3) { animation-delay: 0.1s; }
@keyframes pulse {
    0% {
        transform: scale(0.8);
        background-color: #b3d4fc;
        box-shadow: 0 0 0 0 rgba(178, 212, 252, 0.7);
    }
    50% {
        transform: scale(1.2);
        background-color: #6793fb;
        box-shadow: 0 0 0 10px rgba(178, 212, 252, 0);
    }
    100% {
        transform: scale(0.8);
        background-color: #b3d4fc;
        box-shadow: 0 0 0 0 rgba(178, 212, 252, 0.7);
    }
}

/* --- RESPONSIVE HEADER --- */
@media (max-width: 900px) {
    header,
    .home-page header,
    .home-page.scrolled header {
        padding: 20px 10vw 20px 0vw !important;
        width: 100%;
    }
    .main-nav {
        display: none !important;
    }
    .sidebar-menu {
        position: fixed;
        top: 0;
        left: -250px;
        width: 80vw;
        min-width: 180px;
        max-width: 200px;
        height: 100vh;
        background: #222;
        color: #fff;
        z-index: 3000;
        transition: left 0.3s;
        display: flex;
        flex-direction: column;
        padding: 80px 20px 20px 20px;
        box-shadow: 2px 0 8px rgba(0,0,0,0.15);
    }
    .sidebar-menu.open {
        left: 0;
    }
    .sidebar-menu a {
        color: #fff;
        text-decoration: none;
        margin: 16px 0;
        font-size: 1.1rem;
        display: block;
    }
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0; left: 0; right: 0; bottom: 0;
        background: rgba(0,0,0,0.3);
        z-index: 2999;
    }
    .sidebar-overlay.active {
        display: block;
    }
    .hamburger {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 8px;
        position: fixed;
        top: 20px;
        left: 10px;
        z-index: 3100;
        background: none;
        border: none;
        font-size: 1rem;
        color: #ffffff;
        cursor: pointer;
        height: 60px;
        width: auto;
        padding: 0 10px;
    }
    .hamburger-icon {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        height: 32px;
        width: 40px;
        margin-bottom: 2px;
        font-size: 2.8rem;
        line-height: 1;
    }
    .hamburger-icon .bar {
        display: block;
        width: 36px;
        height: 5px;
        background: #fff;
        border-radius: 3px;
        margin: 4px 0;
        transition: all 0.3s;
    }
    .main-nav ul {
        gap: 10px;
        flex-wrap: wrap;
        font-size: 1rem;
    }
    .main-nav li a {
        font-size: 1.1rem;
        padding: 6px 8px;
    }
    .logo-svg-text {
        display: none !important;
    }
    #main-logo {
        display: block !important;
        margin-left: auto !important;
        margin-right: auto !important;
        position: static !important;
        left: unset !important;
        right: unset !important;
        top: unset !important;
        width: 180px !important;
        height: auto !important;
        max-width: 80vw;
        transition: none !important;
    }
    header img,
    .home-page.scrolled #main-logo {
        height: 100px !important;
        max-width: 20vw;
    }
    .profile-circle {
        width: 50px !important;
        height: 50px !important;
        font-size: 1.2rem !important;
    }
    .home-page.scrolled header .profile-container,
    header .profile-container {
        top: 30px !important;
        right: 90px !important;
    }
    .login-btn,
    .logout-btn {
        display: none !important;
    }
    .logo-block {
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
    }
}
@media (max-width: 500px) {
    .main-nav ul {
        gap: 4px;
        padding: 4px 0;
    }
    .main-nav li a {
        font-size: 0.95rem;
        padding: 4px 4px;
    }
    .logo-svg-text {
        display: none !important;
    }
    #main-logo {
        display: block !important;
        margin-left: auto !important;
        margin-right: auto !important;
        position: static !important;
        left: unset !important;
        right: unset !important;
        top: unset !important;
        width: 120px !important;
        height: auto !important;
        max-width: 90vw;
        transition: none !important;
    }
    header img,
    .home-page.scrolled #main-logo {
        height: 90px !important;
        max-width: 30vw;
    }
    .profile-circle {
        width: 40px !important;
        height: 40px !important;
        font-size: 1rem !important;
    }
    .home-page.scrolled header .profile-container,
    header .profile-container {
        top: 30px !important;
        right: 70px !important;
    }
    .login-btn,
    .logout-btn {
        display: none !important;
    }
    .sidebar-menu {
        width: 80vw;
        min-width: 180px;
        max-width: 200px;
    }
    .logo-block {
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
    }
}

/* Desktop only */
@media (min-width: 901px) {
    .home-page #main-logo {
        position: absolute;
        left: 50%;
        top: 40vh;
        height: 300px;
        transform: translateX(-50%) scale(1.1);
        transition: none !important;
    }
    .home-page.scrolled #main-logo {
        position: absolute;
        left: 10px;
        top: 10px;
        height: 80px;
        transform: none;
        transition: none !important;
    }
    .home-page.scrolled header .main-nav,
    header .main-nav {
        display: block !important;
    }
    .sidebar-menu,
    .sidebar-overlay {
        display: none !important;
    }
    .hamburger {
        display: none !important;
    }
    .home-page.scrolled header .profile-container,
    header .profile-container {
        right: 50px !important;
    }
}
@media (max-width: 900px) {
    .home-page.scrolled #main-logo,
    header img#main-logo {
        position: static !important;
        display: block !important;
        margin-left: auto !important;
        margin-right: auto !important;
        left: unset !important;
        right: unset !important;
        top: unset !important;
        height: 100px !important;
        width: auto !important;
        max-width: 70vw !important;
        transform: none !important;
    }
}
@media (max-width: 500px) {
    .home-page.scrolled #main-logo,
    header img#main-logo {
        height: 90px !important;
        max-width: 90vw !important;
    }
}

/* --- CUSTOM STYLES --- */
.sidebar-menu a.active {
    background: #007BFF;
    color: #fff;
    border-radius: 8px;
    font-weight: bold;
}

