/* --- CONFIGURATION INSTITUT (Charte Graphique) --- */
:root {
    --ists-primary: #00408A; /* Bleu foncé */
    --ists-secondary: #FFD700; /* Jaune */
    --ists-accent: #E60000; /* Rouge */
    --font-display: 'Montserrat', sans-serif;
    --font-body: 'Open Sans', sans-serif;


    --ists-blue: #004691; /* Bleu caractéristique Transco */
    --ists-yellow: #ffc107;
}


.icon-box.bg-ists-subtle {
    background-color: rgba(0, 70, 145, 0.1);
    width: 50px;
    height: 50px;
}

.card-profile {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-profile:hover {
    transform: translateY(-10px);
    box-shadow: 0 1rem 3rem rgba(0,0,0,.175) !important;
}

.card-img-top {
    height: 250px;
    object-fit: cover;
}

body {
    font-family: var(--font-body);
}
h1, h2, h3, h4, h5, h6, .font-display {
    font-family: var(--font-display);
}

/* Classes Utilitaires Couleurs */
.bg-ists-primary {
    background-color: var(--ists-primary) !important;
}
.text-ists-primary {
    color: var(--ists-primary) !important;
}
.bg-ists-secondary {
    background-color: var(--ists-secondary) !important;
}
.text-ists-secondary {
    color: var(--ists-secondary) !important;
}
.bg-ists-accent {
    background-color: var(--ists-accent) !important;
}

.bg-ists {
    background-color: var(--ists-blue) !important;
}
.text-ists {
    color: var(--ists-blue) !important;
}
.border-ists {
    border-color: var(--ists-blue) !important;
}


/* Dark Mode Ajustements */
[data-bs-theme="dark"] body {
    background-color: #111827;
    color: #F9FAFB;
}
[data-bs-theme="dark"] .bg-surface {
    background-color: #1F2937;
}

/* --- STYLES SPÉCIFIQUES --- */
/* Navbar */
.navbar-ists {
    background-color: var(--ists-primary);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}
.nav-link {
    color: rgba(255,255,255,0.85) !important;
    transition: color 0.3s;
}
.nav-link:hover {
    color: #fff !important;
}

/* Hero Section */
.hero-section {
    position: relative;
    background-color: #f8f9fa;
    overflow: hidden;
}
[data-bs-theme="dark"] .hero-section {
    background-color: #1F2937;
}

.hero-pattern {
    position: absolute;
    inset: 0;
    background-color: var(--ists-primary);
    /* Pointillés jaunes */
    background-image: radial-gradient(var(--ists-secondary) 1.5px, transparent 1.5px);
    background-size: 24px 24px;
    opacity: 0.95;
}
[data-bs-theme="dark"] .hero-pattern {
    opacity: 0.6;
}

/* Effets d'images et Cartes */
.hover-scale img {
    transition: transform 0.7s ease;
}
.hover-scale:hover img {
    transform: scale(1.05);
}
.img-overlay-gradient {
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
}

/* Formulaire Flottant */
.floating-search-card {
    margin-top: -3rem;
    z-index: 20;
    position: relative;
    border: none;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* Play Button Video */
.video-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ists-primary);
    transition: all 0.3s ease;
    z-index: 2;
}
.hover-scale:hover .video-play-btn {
    background-color: var(--ists-secondary);
    transform: translate(-50%, -50%) scale(1.1);
}

/* Scrollbar & Theme Btn */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #f1f1f1;
}
::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.theme-toggle-btn {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 1050;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

footer {
    border-top: 4px solid var(--ists-secondary);
}
footer a {
    text-decoration: none;
    color: #9ca3af;
}
footer a:hover {
    color: white;
}


/* ==========================================================================
   SIDEBAR TRANSCO - COMPORTEMENT MINI (HOVER EXPAND)
   ========================================================================== */

.sidebar {
    width: 70px; /* Largeur réduite par défaut */
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1040;
    background-color: #00408A; /* Bleu TRANSCO */
    color: #ffffff;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1); /* Animation fluide */
    padding-top: 70px;
    overflow-x: hidden; /* Cache le texte qui dépasse */
    white-space: nowrap;
    box-shadow: 4px 0 10px rgba(0, 0, 0, 0.1);
}

/* Extension au survol */
.sidebar:hover {
    width: 260px;
}

/* --- ÉLÉMENTS DE NAVIGATION --- */
.sidebar .nav-link {
    padding: 15px 0 15px 23px; /* Aligne l'icône au centre du mode 70px */
    color: rgba(255, 255, 255, 0.8) !important;
    display: flex;
    align-items: center;
    gap: 25px; /* Espace entre icône et texte */
    font-weight: 500;
    border-left: 4px solid transparent;
    transition: all 0.2s;
}

/* Texte (le nom des menus) */
.sidebar .nav-link span {
    opacity: 0; /* Caché par défaut */
    transition: opacity 0.3s ease;
}

.sidebar:hover .nav-link span {
    opacity: 1; /* Visible au survol de la sidebar */
}

.sidebar .nav-link i {
    font-size: 1.2rem;
    min-width: 20px;
    text-align: center;
}

/* État Actif et Hover sur lien */
.sidebar .nav-link:hover, 
.sidebar .nav-link.active {
    background-color: rgba(255, 215, 0, 0.1);
    color: #FFD700 !important;
    border-left-color: #FFD700;
}

/* --- POINTILLÉS JAUNES (Séparateurs) --- */
.sidebar-header {
    padding: 20px 0 10px 23px;
    font-size: 0.7rem;
    font-weight: 800;
    color: #FFD700;
    opacity: 0;
    transition: opacity 0.3s;
    /* Ligne pointillée jaune en dessous */
    border-bottom: 2px dotted #FFD700; 
    margin: 10px 15px;
}

.sidebar:hover .sidebar-header {
    opacity: 1;
}

/* --- PIED DE SIDEBAR (DÉCONNEXION) --- */
.logout-container {
    margin-top: auto;
    border-top: 2px dotted #FFD700; /* Pointillés jaunes aussi ici */
    padding-bottom: 20px;
    padding-top: 10px;
}

/* --- AJUSTEMENT DU CONTENU PRINCIPAL --- */
.main-content {
    margin-left: 70px; /* Aligné sur la sidebar réduite */
    transition: margin-left 0.3s;
    min-height: 100vh;
    padding-top: 20px;
}

/* --- COMPORTEMENT MOBILE --- */
@media (max-width: 767.98px) {
    .sidebar {
        width: 260px; /* Full width sur mobile */
        left: -260px;
    }
    .sidebar.mobile-open {
        left: 0;
    }
    .sidebar .nav-link span, .sidebar-header {
        opacity: 1; /* Toujours visible sur mobile quand ouvert */
    }
    .main-content {
        margin-left: 0;
    }
}

/* ==========================================================================
   AJUSTEMENT HIÉRARCHIE (NAVBAR AU-DESSUS DU SIDEBAR)
   ========================================================================== */

/* 1. On s'assure que la Navbar est au premier plan */
.navbar-ists {
    z-index: 1050 !important; /* Priorité maximale */
    position: sticky;
    top: 0;
}

/* 2. On place la Sidebar juste en dessous */
.sidebar {
    width: 70px;
    height: 100vh;
    position: fixed;
    top: 0; /* Elle part du haut mais sera derrière la navbar */
    left: 0;
    z-index: 1040; /* Juste en dessous de la navbar */
    background-color: #00408A;
    padding-top: 80px; /* IMPORTANT : Doit correspondre à la hauteur de votre navbar pour ne pas cacher le 1er lien */
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-x: hidden;
    box-shadow: 4px 0 10px rgba(0, 0, 0, 0.1);
}

/* 3. L'overlay doit être entre la sidebar et le contenu, mais sous la navbar */
.sidebar-overlay {
    z-index: 1035; 
}

/* --- ADAPTATION MOBILE --- */
@media (max-width: 767.98px) {
    .sidebar {
        top: 0;
        left: -260px; /* Cachée à gauche */
        width: 260px !important;
        padding-top: 80px; /* Garde l'espace pour voir le bouton dans la navbar */
    }

    .sidebar.mobile-open {
        left: 0 !important;
    }
}

/* ==========================================================================
   SIDEBAR TRANSCO - AVEC PATTERN POINTILLÉS (HERO STYLE)
   ========================================================================== */

.sidebar {
    width: 70px;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1040;
    background-color: #00408A; /* Bleu TRANSCO */
    
    /* --- LE PATTERN POINTILLÉS (Inspiré du Hero) --- */
    background-image: radial-gradient(#FFD700 1px, transparent 1px);
    background-size: 20px 20px;
    /* On réduit un peu l'opacité des points pour ne pas gêner la lecture */
    background-blend-mode: soft-light; 
    
    color: #ffffff;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding-top: 80px; /* Espace sous la navbar */
    overflow-x: hidden;
    white-space: nowrap;
    box-shadow: 4px 0 10px rgba(0, 0, 0, 0.2);
}

.sidebar:hover {
    width: 260px;
}

/* --- ÉLÉMENTS DE NAVIGATION --- */
.sidebar .nav-link {
    padding: 15px 0 15px 23px; /* Centre l'icône dans les 70px */
    color: #ffffff !important;
    display: flex;
    align-items: center;
    gap: 25px;
    font-weight: 600;
    border-left: 4px solid transparent;
    transition: all 0.2s;
}

/* Masquage du texte par défaut */
.sidebar .nav-link span {
    opacity: 0;
    transition: opacity 0.3s;
}

.sidebar:hover .nav-link span {
    opacity: 1;
}

/* Style des icônes (FontAwesome ou Material) */
.sidebar .nav-link i, 
.sidebar .nav-link .material-icons {
    font-size: 1.3rem;
    min-width: 24px;
    text-align: center;
    color: #FFD700; /* Icônes en Jaune TRANSCO */
}

/* État Actif et Survol */
.sidebar .nav-link:hover, 
.sidebar .nav-link.active {
    background-color: rgba(255, 215, 0, 0.2);
    border-left-color: #FFD700;
}

/* Séparateur pointillé entre les sections (MES SERVICES) */
.sidebar-header {
    margin: 15px;
    border-bottom: 1px dotted rgba(255, 215, 0, 0.5);
    padding-bottom: 5px;
    font-size: 0.7rem;
    color: #FFD700;
    opacity: 0;
}

.sidebar:hover .sidebar-header {
    opacity: 1;
}

/* --- AJUSTEMENT MOBILE --- */
@media (max-width: 767.98px) {
    .sidebar {
        left: -260px;
        width: 260px !important;
    }
    .sidebar.mobile-open {
        left: 0;
    }
}

/* =====================================================
   MOBILE UNIQUEMENT – NE TOUCHE PAS AU DESKTOP
   ===================================================== */
@media (max-width: 991.98px) {

    /* Sidebar caché par défaut sur mobile */
    #sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1040; /* derrière navbar */
    }

    /* Sidebar visible uniquement via bouton */
    #sidebar.mobile-open {
        transform: translateX(0);
    }

    /* Icônes + textes invisibles quand sidebar fermé */
    #sidebar .nav-link {
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease;
    }

    /* Icônes + textes visibles quand sidebar ouvert */
    #sidebar.mobile-open .nav-link {
        opacity: 1;
        pointer-events: auto;
    }

    /* Le contenu principal ne bouge pas */
    .main-content {
        margin-left: 0 !important;
    }

    /* Overlay */
    .sidebar-overlay {
        display: none;
    }

    .sidebar-overlay.active {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.4);
        z-index: 1030;
    }
}

.hover-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}
.hover-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1) !important;
    background-color: #f8f9fa;
}
.hover-card i {
    font-size: 1.5rem;
}

.icon-box-small {
    background: rgba(0,0,0,0.03);
    width: 60px;
    height: 60px;
    margin: 0 auto;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Conteneur de la carte de galerie */
.gallery-card {
    position: relative;
    overflow: hidden;
    border-radius: 12px; /* Coins plus arrondis pour un look moderne */
    background-color: #eee;
    /* Définit un ratio 1/1 (Carré) ou 4/3 (Paysage) pour toutes les images */
    aspect-ratio: 1 / 1; 
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* L'image à l'intérieur */
.gallery-img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Remplit le cadre sans déformer */
    transition: transform 0.6s ease;
}

/* Overlay élégant (le voile qui apparaît au survol) */
.gallery-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.5), transparent);
    opacity: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
}

.gallery-overlay span {
    color: white;
    font-size: 2rem;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

/* Effets au survol (Hover) */
.gallery-card:hover {
    box-shadow: 0 15px 30px rgba(0,0,0,0.15);
    transform: translateY(-5px);
}

.gallery-card:hover .gallery-img {
    transform: scale(1.1);
}

.gallery-card:hover .gallery-overlay {
    opacity: 1;
}

.gallery-card:hover .gallery-overlay span {
    transform: translateY(0);
}

/* Empêche les images du slider de dépasser ou de se déformer */
.gslide-image img {
    max-height: 85vh !important; /* Garde une marge en haut/bas */
    object-fit: contain !important; /* L'image entière est visible, jamais coupée */
    width: auto !important;
    margin: 0 auto;
}

/* Assure que le fond reste propre pendant la transition */
.goverlay {
    background: rgba(0, 0, 0, 0.9) !important;
}

.verticalTableHeader {
    writing-mode: vertical-rl;
    transform:rotate(180deg);    
    justify-content:center;
    max-height: 18em;    
}

.titreOp1{
    font:20px/1.5 sans-serif;
    background-color: lightgray;
    margin-bottom: 5px;
}
.titreOp2{
    font:20px/1.5 sans-serif;
    background-color: #f5f5f5;
    padding-top: 5px;
    color: blue;
    font-weight: bold;
}

#formEnreg,#formRetour{
    display: inline-block;
    vertical-align: middle;
}
#zoneParent,#zoneEnfant{
    display: inline-block;
    vertical-align: middle;
}
#zoneEnfant{
    color:whitesmoke;
}
.zoneForm1,.zoneForm2,.zoneForm3{
    display: inline-block;
    vertical-align: middle;
    margin-bottom: 5px;
}