/* ===== RESET & BASE ===== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.5;
    color: #333;
    background: linear-gradient(135deg, #9F9FA9 0%, #171717 100%);
    min-height: 100vh;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ===== TITLE BAR ===== */
.title-bar {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 1030px;
    height: 100px;
    background: linear-gradient(135deg, #9F9FA9 0%, #171717 100%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 998;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    margin-top: 0;
    font-family: 'Source Code Pro', monospace;
}

.title-bar-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.title-bar h1 {
    color: white;
    font-size: 27.5px;
    font-weight: 300;
    margin: 0;
    flex-grow: 1;
    text-align: center;
    line-height: 1.2;
}

.title-bar h1 .large-red {
    font-size: 32.5px;
    font-weight: bold;
    color: #ff0000;
}

.title-bar h1 .small-text {
    font-size: 22.5px;
    color: white;
    font-weight: 300;
}

.title-bar h1 .normal-text {
    font-size: 27.5px;
    color: white;
    font-weight: 300;
}

/* ===== NAVIGATION BUTTONS ===== */
.nav-button {
    background: linear-gradient(135deg, #9F9FA9 0%, #171717 100%);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 15px;
    min-width: 88px;
    height: 38px;
    font-family: 'Source Code Pro', monospace;
    font-weight: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.nav-button:hover {
    background: linear-gradient(135deg, #AFAFB9 0%, #272727 100%);
    transform: scale(1.05);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
}

.home-icon {
    height: 28px;
    width: 28px;
    object-fit: contain;
}

/* ===== HAMBURGER MENU ===== */
.menu-hamburger {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.menu-hamburger:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.menu-hamburger span {
    display: block;
    width: 22.5px;
    height: 2.5px;
    background: white;
    margin: 2.5px 0;
    transition: 0.3s;
}

.menu-hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.menu-hamburger.active span:nth-child(2) {
    opacity: 0;
}

.menu-hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7.5px, -6px);
}

/* ===== SIDEBAR ===== */
.sidebar {
    position: fixed;
    left: -280px;
    top: 0;
    height: 100vh;
    width: 280px;
    background: linear-gradient(135deg, #2c2c2c 0%, #1a1a1a 100%);
    transition: left 0.8s ease;
    z-index: 1000;
    box-shadow: 5px 0 15px rgba(0, 0, 0, 0.3);
    padding: 0;
    font-family: 'Source Code Pro', monospace;
    display: flex;
    flex-direction: column;
}

.sidebar.open {
    left: 0;
}

.sidebar-header {
    padding: 15px 12px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(40, 40, 40, 0.8);
    overflow: hidden;
    flex-shrink: 0;
}

.sidebar-logo {
    width: 100%;
    height: 180px;
    object-fit: contain;
    border-radius: 12px;
}

.dev-warning {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    color: white;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    margin-top: 10px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    font-family: 'Source Code Pro', monospace;
}

/* ===== CONTACT BACKGROUND ===== */
.contact-background {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    z-index: 50;
    width: 100%;
    padding: 0 20px;
    pointer-events: auto;
    transition: opacity 0.3s ease;
}

.contact-background.hidden {
    opacity: 0;
    pointer-events: none;
}

.contact-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    margin-bottom: 8px;
    font-weight: 300;
    font-family: 'Source Code Pro', monospace;
    pointer-events: none;
}

.contact-link {
    display: inline-block;
    transition: transform 0.3s ease;
    pointer-events: auto;
    position: relative;
    z-index: 2;
}

.contact-icon {
    width: 55%;
    max-width: 100px;
    height: auto;
    object-fit: contain;
    transition: all 0.3s ease;
    cursor: pointer;
}

.contact-link:hover .contact-icon {
    transform: scale(1.1);
    filter: brightness(1.25);
    opacity: 0.9;
}

/* ===== SIDEBAR MENU ===== */
.sidebar-menu {
    margin: 10px 0 0;
    padding: 0;
    list-style: none;
    max-height: calc(100vh - 300px);
    overflow-y: auto;
    flex-grow: 1;
    position: relative;
    z-index: 3;
}

.sidebar-menu li {
    margin: 5px 15px;
    position: relative;
}

.sidebar-menu > li > a {
    display: block;
    color: white;
    text-decoration: none;
    padding: 10px 15px 10px 35px;
    border-radius: 6px;
    background: rgba(70, 70, 70, 0.7);
    font-weight: 300;
    font-size: 15px;
    line-height: 1.3;
    white-space: normal;
    word-wrap: break-word;
    text-indent: -15px;
    transition: all 0.3s ease;
    position: relative;
    z-index: 3;
}

.sidebar-menu > li > a:hover {
    background: rgba(90, 90, 90, 0.8);
}

/* ===== SUBMENUS ===== */
.submenu {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(50, 50, 50, 0.9);
    border-radius: 0 0 6px 6px;
    position: relative;
    z-index: 4;
}

.sidebar-menu li:hover .submenu {
    max-height: 500px;
}

.submenu li a {
    display: block;
    padding: 7px 15px 7px 40px;
    font-size: 13px;
    color: #ffffff;
    text-decoration: none;
    background: rgba(50, 50, 50, 0.9);
    white-space: normal;
    word-wrap: break-word;
    line-height: 1.3;
    text-indent: -15px;
    transition: all 0.3s ease;
    position: relative;
    z-index: 4;
}

.submenu li a:hover {
    background: rgba(70, 70, 70, 0.9);
}

/* ===== ROLLING SHUTTER RESPONSIVE ===== */
.rolling-shutter {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 997;
    transform: translateY(0);
    transition: transform 2s cubic-bezier(0.65, 0, 0.35, 1);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    background: none;
}

.shutter-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
}

/* Image paysage par défaut */
.shutter-image.landscape {
    display: block;
}

.shutter-image.portrait {
    display: none;
}

/* Mobile portrait → image portrait */
@media (max-width: 768px) and (orientation: portrait) {
    .shutter-image.landscape {
        display: none;
    }
    
    .shutter-image.portrait {
        display: block;
        object-fit: contain;
    }
}
    .title-bar-left {
        gap: 7px;             /* ← espace encore réduit */
    }
/* Mobile paysage → image paysage */
@media (max-width: 768px) and (orientation: landscape) {
    .shutter-image.landscape {
        display: block;
        object-fit: cover;
    }
    
    .shutter-image.portrait {
        display: none;
    }
}

.rolling-shutter.rolling-up {
    transform: translateY(-100%);
}

/* ===== IFRAME & OVERLAY ===== */
#page-container {
    width: 100%;
    height: calc(100vh - 100px);
    border: none;
    margin-top: 100px;
    background: white;
    z-index: 1;
    position: relative;
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* ===== ANIMATIONS ===== */
.sidebar.fade-in {
    animation: sidebarFadeIn 2.0s ease-out;
}

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

/* Effet pulse hamburger */
.menu-hamburger.pulse::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.3);
    animation: pulse-glow 2s ease-in-out infinite;
    z-index: -1;
}

@keyframes pulse-glow {
    0%, 100% {
        opacity: 0;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
}

/* ===== RESPONSIVE DESIGN ===== */

/* TABLETTES */
@media (max-width: 1024px) {
    .title-bar {
        width: 97%;
        padding: 0 15px;
    }
    
    .title-bar h1 {
        font-size: 24px;
    }
    
    .title-bar h1 .large-red {
        font-size: 28px;
    }
    
    .title-bar h1 .small-text {
        font-size: 20px;
    }
    
    .title-bar h1 .normal-text {
        font-size: 24px;
    }
}

/* MOBILE */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    .title-bar-left {
    gap: 6px;             /* ← espace encore réduit */
    }
    
    .title-bar {
        height: 80px;
        padding: 0 12px;
        width: calc(100% - 20px);
        left: 10px;
        transform: none;
        border-radius: 12px;
    }
    
    .title-bar h1 {
        font-size: 20px;
    }
    
    .title-bar h1 .large-red {
        font-size: 24px;
    }
    
    .title-bar h1 .small-text {
        font-size: 17px;
    }
    
    .title-bar h1 .normal-text {
        font-size: 20px;
    }
    
    /* BOUTON ACCUEIL MOBILE - TAILLE RÉDUITE */
    .nav-button {
        padding: 6px 10px;
        font-size: 12px;
        min-width: 70px;
        height: 32px;
        gap: 5px;
    }
    
    /* ICONE MAISON MOBILE - TAILLE RÉDUITE ET BIEN CENTRÉE */
    .home-icon {
        height: 18px;
        width: 18px;
        object-fit: contain;
        display: block;
    }
    
    .menu-hamburger {
        width: 38px;
        height: 38px;
    }
    
    .menu-hamburger span {
        width: 20px;
        height: 2px;
        margin: 2px 0;
    }
    
    #page-container {
        height: calc(100vh - 90px);
        margin-top: 80px;
    }
    
    /* Sidebar mobile */
    .sidebar {
        width: 260px;
    }
    
    @media (max-width: 768px) {
    .sidebar-header {
        padding: 2px 2px 2px;
        margin-top: 2
    }
    
    .sidebar-logo {
        width: 100%; /* 95% de la largeur sur mobile */
        border-radius: 7px; /* Coins arrondis sur mobile */
        margin-top: 2
    }
}
    
    .sidebar-menu > li > a {
        font-size: 14px;
        padding: 8px 10px 8px 30px;
    }
    
    .submenu li a {
        font-size: 13px;
        padding: 8px 10px 8px 30px;
    }
    
    .dev-warning {
        font-size: 12px;
        padding: 0px 0px;
    }
    
    /* Contact background mobile - ICÔNE PLUS GRANDE ET REMONTÉE */
    .contact-background {
        bottom: 65px; /* Remonté de 15px à 25px pour éviter le dock mobile */
        padding: 0 15px;
    }
    
    /* Agrandir l'icône mail de 5% sur mobile */
    .contact-icon {
        max-width: 85px; /* 5% de plus que 80px */
        width: 60%; /* 5% de plus que 55% */
    }
    
    .contact-label {
        font-size: 13px;
        margin-bottom: 6px;
    }
    
    /* Lorsque le menu est survolé (sous-menu ouvert), masquer "Me contacter" */
    .sidebar-menu:hover ~ .contact-background,
    .sidebar-menu li:hover ~ .contact-background {
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease;
    }
}

/* TRÈS PETITS ÉCRANS */
@media (max-width: 480px) {
    .title-bar {
        height: 70px;
        padding: 0 10px;
        width: calc(100% - 20px);
    }
    .title-bar-left {
        gap: 5px;             /* ← espace encore réduit */
    }
    
    .title-bar h1 {
        font-size: 18px;
    }
    
    .title-bar h1 .large-red {
        font-size: 22px;
    }
    
    .title-bar h1 .small-text {
        font-size: 15px;
    }
    
    .title-bar h1 .normal-text {
        font-size: 18px;
    }
    
    /* BOUTON ACCUEIL TRÈS PETITS ÉCRANS - ENCORE PLUS PETIT */
    .nav-button {
        padding: 5px 8px;
        font-size: 11px;
        min-width: 65px;
        height: 30px;
        gap: 4px;
    }
    
    /* ICONE MAISON TRÈS PETITS ÉCRANS */
    .home-icon {
        height: 16px;
        width: 16px;
    }
    
    .menu-hamburger {
        width: 34px;
        height: 34px;
    }
    
    #page-container {
        height: calc(100vh - 80px);
        margin-top: 70px;
    }
    
    .sidebar {
        width: 240px;
    }
    
    @media (max-width: 480px) {
    .sidebar-header {
        padding: 1px 1px 1px;
        margin-top: 1
    }
    
    .sidebar-logo {
        width: 100%; /* 95% de la largeur sur très petits écrans */
        border-radius: 8px; /* Coins arrondis sur très petits écrans */
        margin-top: 1
    }
}
    
    .sidebar-menu > li > a {
        font-size: 13px;
        padding: 8px 10px 8px 25px;
    }
    
    .submenu li a {
        font-size: 12px;
        padding: 7px 12px 7px 35px;
    }
    
    .dev-warning {
        font-size: 11px;
        padding: 0px 0px;
    }
    
    /* Contact background très petits écrans - encore plus remonté */
    .contact-background {
        bottom: 55px; /* Plus remonté pour très petits écrans */
        padding: 0 12px;
    }
    
    /* Agrandir l'icône mail sur très petits écrans */
    .contact-icon {
        max-width: 65px; /* 5% de plus que 70px */
        width: 65%; /* 5% de plus que 60% */
    }
    
    .contact-label {
        font-size: 12px;
        margin-bottom: 5px;
    }
    
    /* Lorsque le menu est survolé (sous-menu ouvert), masquer "Me contacter" */
    .sidebar-menu:hover ~ .contact-background,
    .sidebar-menu li:hover ~ .contact-background {
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease;
    }
}

/* ===== IFRAME MOBILE PORTRAIT ===== */
@media (max-width: 768px) and (orientation: portrait) {
    body {
        padding: 0 !important;
    }
    
    #page-container {
        width: 100vw !important;
        height: calc(100vh - 70px) !important;
        margin-top: 70px !important;
        border: none !important;
        border-radius: 0 !important;
    }
    
    .title-bar {
        width: 100vw !important;
        left: 0 !important;
        border-radius: 0 !important;
    }
}

/* ===== BADGE DE MISE À JOUR ===== */
.update-badge {
    position: absolute;
    top: 8px;
    right: 5px;
    color: #ff0000;
    font-size: 9px;
    font-weight: bold;
    border: 1px solid #ff0000;
    padding: 0px 3px;
    border-radius: 2px;
    z-index: 5;
    pointer-events: none;
    line-height: 14px;
    font-family: 'Source Code Pro', monospace;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: transparent;
    height: 14px;
    white-space: nowrap;
}

.submenu li {
    position: relative;
}

@keyframes pulse-update {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.update-badge {
    animation: pulse-update 2s infinite ease-in-out;
}

@media (max-width: 768px) {
    .update-badge {
        font-size: 8px;
        padding: 0px 2px;
        top: 6px;
        right: 3px;
        height: 12px;
        line-height: 12px;
    }
}

/* ===== RÉDUCTION HEADER MOBILE PORTRAIT ===== */
@media (max-width: 768px) and (orientation: portrait) {
    .title-bar h1 {
        font-size: 90%; /* Réduction de 10% */
    }
    
    .title-bar h1 .large-red {
        font-size: 90%;
    }
    
    .title-bar h1 .small-text {
        font-size: 90%;
    }
    
    .title-bar h1 .normal-text {
        font-size: 90%;
    }
}

/* ===== INDICATEUR MAJ ===== */
.maj-indicator {
    color: #ff0000;
    font-size: 10px;
    font-weight: bold;
    margin-left: 5px;
    background: rgba(255, 0, 0, 0.1);
    padding: 1px 4px;
    border-radius: 3px;
    border: 1px solid rgba(255, 0, 0, 0.3);
    vertical-align: super;
}

/* ===== FOOTER MOBILE PORTRAIT ===== */
@media (max-width: 768px) and (orientation: portrait) {
    footer {
        flex-direction: row;
        justify-content: center;
        gap: 8px;
        padding: 6px 0;
        font-size: 10px;
        height: 28px; /* Hauteur fixe pour éviter le débordement */
    }
    
    footer > *:not(:first-child):not(:last-child) {
        display: none !important; /* Cache tous les éléments sauf le premier et dernier */
    }
    
    /* Affiche uniquement le copyright et contact */
    footer > span:first-child {
        display: inline !important;
        color: white;
        font-size: 10px;
        white-space: nowrap;
    }
    
    footer nav {
        display: flex !important;
        align-items: center;
        gap: 8px;
    }
    
    /* Affiche uniquement le lien contact */
    footer nav a[data-page="contact.html"] {
        display: inline-block !important;
        color: white;
        text-decoration: none;
        font-size: 10px;
        white-space: nowrap;
    }
    
    /* Cache tous les autres liens */
    footer nav a:not([data-page="contact.html"]) {
        display: none !important;
    }
    
    /* Style du séparateur */
    footer nav span {
        display: inline !important;
        color: rgba(255, 255, 255, 0.5);
    }
    
    /* Masquer les séparateurs inutiles */
    footer nav span {
        display: none !important;
    }
    
    /* Afficher seulement le séparateur pour Contact */
    footer nav a[data-page="contact.html"]::before {
        content: "|";
        color: rgba(255, 255, 255, 0.5);
        margin: 0 8px;
    }
    
    /* Supprime le séparateur existant dans le footer */
    footer > span:nth-child(2) {
        display: none !important;
    }
}

/* ===== BOUTON ACCUEIL CARRÉ ===== */
.home-button-square {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.2); /* même fond que le hamburger */
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
    margin-left: 4px;
    overflow: hidden; /* par sécurité */
}

.home-button-square:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.home-icon-square {
    width: 28px;
    height: 28px;
    object-fit: contain; /* l'image garde ses proportions, sans déformation */
    display: block;
}

/* Ajustements mobiles (à intégrer dans vos media queries existantes) */
@media (max-width: 768px) {
    .home-button-square {
        width: 38px;
        height: 38px;
        margin-left: 2px;
    }
    .home-icon-square {
        width: 22px;
        height: 22px;
    }
}

@media (max-width: 480px) {
    .home-button-square {
        width: 34px;
        height: 34px;
        margin-left: 2px;
    }
    .home-icon-square {
        width: 18px;
        height: 18px;
    }
}
/* ===== SIDEBAR LOGO RESPONSIVE ===== */

/* Ajouter un effet de brillance au survol */
.sidebar-logo {
    position: relative;
    overflow: hidden;
}

.sidebar-logo::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        to bottom right,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: rotate(30deg);
    transition: transform 0.6s ease;
    opacity: 0;
}

.sidebar-logo:hover::after {
    opacity: 1;
    transform: rotate(30deg) translate(20%, 20%);
}
.sidebar-logo {
    width: 100%;
    height: auto;
    max-height: 180px;
    object-fit: contain;
    border-radius: 12px;
    cursor: pointer; /* Indique que c'est cliquable */
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.sidebar-logo:hover {
    transform: scale(1.02);
    opacity: 0.9;
}

/* Tablette */
@media (max-width: 1024px) {
    .sidebar-logo {
        max-height: 150px;
        border-radius: 10px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .sidebar-logo {
        max-height: 120px; /* Réduit la hauteur max */
        width: 90%; /* Réduit la largeur */
        margin: 0 auto; /* Centre l'image */
        display: block;
        border-radius: 8px;
    }
    
    .sidebar-header {
        padding: 10px 10px 5px;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
}

/* Très petits écrans */
@media (max-width: 480px) {
    .sidebar-logo {
        max-height: 100px; /* Encore plus petit */
        width: 85%;
        border-radius: 6px;
    }
    
    .sidebar-header {
        padding: 8px 8px 3px;
    }
}

/* Mode paysage sur mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .sidebar-logo {
        max-height: 80px; /* Plus petit en paysage */
        width: auto;
        max-width: 80%;
    }
}
.modal-iframe-open .title-bar,
.modal-iframe-open footer {
  display: none !important;
}
/* Cache le header/footer et agrandit l'iframe quand la modale est ouverte */
.modal-iframe-open .title-bar,
.modal-iframe-open footer {
  display: none !important;
}

.modal-iframe-open #page-container {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 999998 !important;
  background: black !important;
  border: none !important;
  margin: 0 !important;
  padding: 0 !important;
}