﻿/* ========================================
   LAYOUT CSS - Institut Supérieur Pierre et Marie Mbondji
   VERSION COMPLÈTE FINALE AVEC FIX ANIMATION MEGA MENU
   Nom du fichier : layout.css (dans wwwroot/css/)
   ======================================== */

/* ========================================
   VARIABLES CSS GLOBALES
   ======================================== */
:root {
    --primary-color: #162856;
    --secondary-color: #f8bd0c;
    --text-color: #333333;
    --background-color: #ffffff;
    --accent-color: #f8bd0c;
    --light-gray: #f8f9fa;
    --medium-gray: #e9ecef;
    --dark-gray: #6c757d;
    --light-blue: #e6f0ff;
    --header-height: 80px;
    --footer-height: auto;
    --ispmm-primary: #162856;
    --ispmm-secondary: #1a2f5f;
    --ispmm-accent: #f8bd0c;
    --ispmm-danger: #dc3545;
    --ispmm-success: #28a745;
    --ispmm-warning: #ffc107;
    --ispmm-info: #17a2b8;
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 3rem;
    --border-radius: 8px;
    --border-radius-lg: 12px;
    --transition: all 0.3s ease;
    --transition-fast: all 0.15s ease;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 5px 15px rgba(0, 0, 0, 0.2);
    --font-size-sm: 0.875rem;
}

/* ========================================
   STRUCTURE GÉNÉRALE
   ======================================== */
html {
    font-size: 14px;
    scroll-behavior: smooth;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-color);
    background-color: var(--background-color);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Skip link pour l'accessibilité */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    color: white;
    background: var(--primary-color);
    padding: 8px;
    text-decoration: none;
    z-index: 100;
    border-radius: 0 0 8px 8px;
    transition: top 0.3s;
}

    .skip-link:focus {
        top: 0;
        color: white;
    }

/* ========================================
   TOP BAR - AVEC CORRECTIONS DROPDOWN ET CANDIDATER BUTTON
   ======================================== */
.top-bar {
    background: linear-gradient(135deg, #162856 0%, #1a2f5f 100%);
    color: white;
    padding: 0.5rem 0;
    font-size: 0.875rem;
    position: relative;
    z-index: 1050;
    /* CORRECTION CRITIQUE: Permettre au dropdown de déborder */
    overflow: visible !important;
}

.top-bar-contact {
    display: flex;
    align-items: center;
    gap: 1rem;
}

    .top-bar-contact i {
        color: var(--secondary-color);
        margin-right: 0.5rem;
    }

    .top-bar-contact a {
        color: white;
        text-decoration: none;
        transition: color 0.3s ease;
    }

        .top-bar-contact a:hover {
            color: var(--secondary-color);
        }

.top-bar-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Bouton Candidater amélioré avec positionnement correct */
.btn-candidater {
    background: linear-gradient(135deg, var(--secondary-color), #ffc107);
    color: var(--primary-color);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.8rem;
    border: none;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

    .btn-candidater::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
        transition: left 0.5s ease;
    }

    .btn-candidater:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(248, 189, 12, 0.3);
        color: var(--primary-color);
        text-decoration: none;
    }

        .btn-candidater:hover::before {
            left: 100%;
        }

/* Language Switcher avec positioning fix */
.language-switcher {
    position: relative;
    z-index: 1070 !important; /* Higher than navbar */
    overflow: visible !important;
}

.language-toggle {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

    .language-toggle:hover,
    .language-toggle:focus {
        background: rgba(255, 255, 255, 0.2);
        color: white;
    }

.language-switcher .dropdown-menu {
    position: absolute !important;
    top: 100% !important;
    right: 0 !important;
    left: auto !important;
    z-index: 10000 !important; /* Much higher z-index */
    min-width: 160px !important;
    margin-top: 0.5rem !important;
    padding: 0.5rem 0 !important;
    background: #ffffff !important;
    border: 1px solid rgba(0, 0, 0, 0.15) !important;
    border-radius: 8px !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15) !important;
    /* FIXED: Simplified animation - no transform conflicts */
    opacity: 0 !important;
    visibility: hidden !important;
    transition: opacity 0.3s ease, visibility 0.3s ease !important;
    display: block !important;
    overflow: visible !important;
}

    .language-switcher .dropdown-menu.show {
        opacity: 1 !important;
        visibility: visible !important;
        z-index: 10000 !important; /* Ensure it stays on top when shown */
    }

/* Social Links */
.social-links {
    display: flex;
    gap: 0.5rem;
}

    .social-links a {
        color: rgba(255, 255, 255, 0.8);
        font-size: 1rem;
        transition: color 0.3s ease;
    }

        .social-links a:hover {
            color: var(--secondary-color);
        }

/* ========================================
   MAIN HEADER ET NAVIGATION
   ======================================== */
.main-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #1a2f5f 100%);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
    /* CORRECTION: Permettre débordement pour les dropdowns */
    overflow: visible !important;
}

.main-navbar {
    background-color: #ffffff !important;
    border-bottom: 1px solid #e9ecef;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 1030;
    padding: 0.5rem 1rem;
    /* CORRECTION: Permettre débordement pour les dropdowns */
    overflow: visible !important;
}

/* Correction pour les conteneurs Bootstrap */
.container-fluid,
.navbar-collapse {
    overflow: visible !important;
    position: relative;
}

.navbar-brand {
    color: var(--primary-color) !important;
    font-weight: 700;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

    .navbar-brand:hover {
        color: var(--secondary-color) !important;
    }

.brand-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-logo {
    display: flex;
    align-items: center;
}

.logo-img {
    height: 50px;
    width: auto;
    max-height: 60px;
}

/* Correction pour les éléments de navigation */
.navbar-nav {
    overflow: visible !important;
    position: relative;
}

.nav-item.dropdown {
    position: relative;
    overflow: visible !important;
}

/* Navigation Links */
.navbar-nav .nav-link {
    color: var(--primary-color) !important;
    font-weight: 500;
    padding: 10px 15px !important;
    border-radius: 6px;
    transition: all 0.3s ease;
    margin: 0 2px;
    position: relative;
}

    .navbar-nav .nav-link:hover {
        background: linear-gradient(135deg, var(--primary-color), #2c5282) !important;
        color: #ffffff !important;
        transform: translateY(-2px);
    }

    .navbar-nav .nav-link.active {
        background: linear-gradient(135deg, var(--primary-color), #2c5282) !important;
        color: #ffffff !important;
        font-weight: 600;
    }

    .navbar-nav .nav-link i {
        margin-right: 5px;
        font-size: 0.9rem;
    }

/* Mobile Navigation */
.navbar-toggler {
    border: 2px solid var(--primary-color) !important;
    background-color: transparent;
    padding: 4px 8px;
}

    .navbar-toggler:focus {
        box-shadow: 0 0 0 0.25rem rgba(22, 40, 86, 0.25);
        outline: none;
    }

.navbar-toggler-icon {
    background: none;
}

.navbar-toggler .fas {
    color: var(--primary-color) !important;
    font-size: 1.2rem;
}

/* ========================================
   DROPDOWN STYLES - FIXED ANIMATION CONFLICTS
   ======================================== */

/* REMOVED CONFLICTING KEYFRAME ANIMATION - THIS WAS CAUSING THE FLICKER */
/*
@keyframes megaMenuFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
*/

/* Standard Dropdown Styling - FIXED */
.dropdown-menu {
    border: none;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    padding: 0.5rem 0;
    margin-top: 0.5rem;
    background: #ffffff;
    min-width: 220px;
    z-index: 1030;
    /* FIXED: Simplified animation - no transform conflicts */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

    .dropdown-menu.show {
        opacity: 1;
        visibility: visible;
    }

.dropdown-item {
    padding: 0.5rem 1rem;
    color: #495057;
    font-weight: 400;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
}

    .dropdown-item:hover {
        background: linear-gradient(135deg, var(--primary-color), #2c5282);
        color: #ffffff;
    }

    .dropdown-item:focus {
        background: linear-gradient(135deg, var(--primary-color), #2c5282);
        color: #ffffff;
    }

    .dropdown-item i {
        width: 20px;
        opacity: 0.7;
    }

    .dropdown-item:hover i {
        opacity: 1;
    }

    .dropdown-item.active {
        background: linear-gradient(135deg, var(--primary-color), #2c5282);
        color: #ffffff;
        font-weight: 600;
    }

/* Active Navigation Item */
.navbar-nav .nav-link.active,
.navbar-nav .nav-item.active > .nav-link {
    background: linear-gradient(135deg, var(--primary-color), #2c5282) !important;
    color: #ffffff !important;
    font-weight: 600;
}

/* Ensure proper z-index stacking */
.navbar {
    z-index: 1050;
}

.dropdown-menu {
    z-index: 1040;
}

.mega-menu .dropdown-menu {
    z-index: 1040;
}

/* Hover effects for better UX */
.nav-item:hover .dropdown-menu {
    display: block;
}

.mega-menu:hover .dropdown-menu {
    display: block;
}

/* ========================================
   MEGA MENU STYLES - FIXED ANIMATION CONFLICTS
   ======================================== */

/* Mega Menu Container */
.mega-menu {
    position: static !important;
    /* Ensure container allows overflow for proper positioning */
    overflow: visible !important;
}

    .mega-menu .dropdown-menu {
        /* Base positioning - will be overridden by JavaScript for clipping fix */
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        width: 100vw;
        max-width: 100vw;
        margin-left: calc(-50vw + 50%);
        /* Visual styling */
        border: none;
        border-radius: 0 0 10px 10px;
        box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
        padding: 2.5rem 0;
        background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
        z-index: 1040;
        /* FIXED: Simplified animation properties - NO CONFLICTING ANIMATIONS */
        opacity: 0;
        visibility: hidden;
        /* REMOVED: transform: translateY(-15px); - this was causing conflicts */
        /*transition: opacity 0.3s ease, visibility 0.3s ease;*/ /* Simplified transition */
        /* Prevent horizontal scrollbar */
        overflow-x: hidden;
    }

        .mega-menu .dropdown-menu.show {
            opacity: 1 !important;
            visibility: visible !important;
            /* REMOVED: transform and animation properties that cause conflicts */
            /* transform: translateY(0) !important; */
            /* animation: megaMenuFadeIn 0.3s ease-out; */
        }

        /* Enhanced positioning class for JavaScript-applied fixes */
        .mega-menu .dropdown-menu.clipping-fixed {
            /* This class will be added by JavaScript when clipping fix is applied */
            position: fixed !important;
            margin-left: 0 !important;
        }

        /* Enhanced positioning for clipping fix */
        .mega-menu .dropdown-menu.positioned {
            position: fixed !important;
            top: auto !important;
            left: 0 !important;
            right: 0 !important;
            width: 100vw !important;
            max-width: 100vw !important;
            margin-left: 0 !important;
            transform: none !important;
        }

        /* Bordure supérieure colorée pour le mega menu */
        .mega-menu .dropdown-menu::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 4px;
            background: linear-gradient(90deg, var(--primary-color), var(--secondary-color), var(--primary-color));
        }

.mega-menu-content {
    min-height: 300px;
    max-width: 100%;
    overflow-x: auto; /* Allow horizontal scroll if needed */
}

/* Column adjustments for better fit */
.mega-menu-column {
    padding: 0 1rem; /* Reduced padding to fit more content */
    border-right: 1px solid #e9ecef;
    position: relative;
    min-width: 200px; /* Ensure minimum width for columns */
}

    .mega-menu-column:last-child {
        border-right: none;
        padding-right: 1.5rem; /* Extra padding on the right edge */
    }

    .mega-menu-column::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 3px;
        height: 100%;
        background: var(--secondary-color);
        opacity: 0;
        /*transition: opacity 0.3s ease;*/
    }

    .mega-menu-column:hover::before {
        opacity: 1;
    }

/* Titre des colonnes amélioré */
.mega-menu-title {
    color: var(--primary-color);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.7rem;
    border-bottom: 2px solid var(--primary-color);
    display: flex;
    align-items: center;
    position: relative;
}

    .mega-menu-title::after {
        content: '';
        position: absolute;
        bottom: -2px;
        left: 0;
        width: 0;
        height: 2px;
        background: var(--secondary-color);
        /*transition: width 0.3s ease;*/
    }

.mega-menu-column:hover .mega-menu-title::after {
    width: 100%;
}

/* Styles pour les liens de catégorie dans les titres */
.mega-menu-title .category-link {
    color: var(--primary-color);
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 600;
}

    .mega-menu-title .category-link:hover {
        color: var(--secondary-color);
        text-decoration: underline;
        text-underline-offset: 3px;
    }

    .mega-menu-title .category-link:focus {
        outline: 2px solid var(--secondary-color);
        outline-offset: 2px;
        border-radius: 2px;
    }

/* Note informative dans le menu */
.menu-note {
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: rgba(248, 189, 12, 0.1);
    border-radius: 4px;
    border-left: 3px solid var(--secondary-color);
}

    .menu-note small {
        font-size: 0.75rem;
        line-height: 1.2;
    }

/* Améliorations pour les éléments du mega menu */
.mega-menu .dropdown-item {
    padding: 0.6rem 0;
    color: #495057;
    font-weight: 400;
    transition: all 0.3s ease;
    border-radius: 4px;
    margin: 2px 0;
    display: flex;
    align-items: center;
    text-decoration: none;
}

    .mega-menu .dropdown-item:hover {
        background: linear-gradient(135deg, var(--primary-color), #2c5282);
        color: #ffffff;
        transform: translateX(8px);
        padding-left: 0.5rem;
        text-decoration: none;
    }

    .mega-menu .dropdown-item:focus {
        background: linear-gradient(135deg, var(--primary-color), #2c5282);
        color: #ffffff;
        text-decoration: none;
        outline: 2px solid var(--secondary-color);
        outline-offset: 2px;
    }

    .mega-menu .dropdown-item i {
        width: 22px;
        opacity: 0.7;
        transition: all 0.3s ease;
        font-size: 0.9rem;
    }

    .mega-menu .dropdown-item:hover i {
        opacity: 1;
        transform: scale(1.1);
    }

/* Custom scrollbar for mega menu if content overflows */
.mega-menu-content {
    max-height: 80vh;
    overflow-y: auto;
}

    .mega-menu-content::-webkit-scrollbar {
        width: 6px;
    }

    .mega-menu-content::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 3px;
    }

    .mega-menu-content::-webkit-scrollbar-thumb {
        background: var(--primary-color);
        border-radius: 3px;
    }

        .mega-menu-content::-webkit-scrollbar-thumb:hover {
            background: #1a2f5f;
        }

/* ========================================
   CONTENU PRINCIPAL
   ======================================== */
.main-content {
    flex: 1;
    padding: 2rem 0;
    background: #ffffff;
}

.page-header {
    text-align: center;
    margin-bottom: 2rem;
    padding: 2rem 0;
    background: linear-gradient(135deg, var(--light-blue) 0%, #ffffff 100%);
    border-radius: var(--border-radius);
}

    .page-header h1 {
        color: var(--primary-color);
        font-weight: 700;
        margin-bottom: 0.5rem;
        font-size: 2.5rem;
    }

    .page-header .subtitle {
        color: var(--dark-gray);
        font-size: 1.1rem;
        margin-bottom: 0;
    }

/* ========================================
   CARTES ET COMPOSANTS
   ======================================== */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
    margin-bottom: var(--spacing-lg);
    overflow: hidden;
}

    .card:hover {
        transform: translateY(-5px);
        box-shadow: var(--shadow-lg);
    }

.card-header {
    background: linear-gradient(135deg, var(--primary-color), #1a2f5f);
    color: white;
    border-bottom: none;
    padding: var(--spacing-lg);
    position: relative;
    overflow: hidden;
}

    .card-header::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 4px;
        background: linear-gradient(90deg, var(--secondary-color), #ffc107, var(--secondary-color));
    }

    .card-header h3 {
        margin: 0;
        font-weight: 600;
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

.card-body {
    padding: var(--spacing-lg);
    background: white;
}

.card-footer {
    background: var(--light-gray);
    border-top: none;
    padding: var(--spacing-lg);
}

/* ========================================
   BOUTONS
   ======================================== */
.btn {
    border-radius: var(--border-radius);
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), #1a2f5f);
    color: white;
    box-shadow: 0 4px 6px rgba(22, 40, 86, 0.3);
}

    .btn-primary:hover {
        background: linear-gradient(135deg, #1a2f5f, #2c4a8c);
        transform: translateY(-2px);
        box-shadow: 0 6px 12px rgba(22, 40, 86, 0.4);
        color: white;
    }

.btn-secondary {
    background: linear-gradient(135deg, var(--secondary-color), #ffc107);
    color: var(--primary-color);
    box-shadow: 0 4px 6px rgba(248, 189, 12, 0.3);
}

    .btn-secondary:hover {
        background: linear-gradient(135deg, #ffc107, #ffd54f);
        transform: translateY(-2px);
        box-shadow: 0 6px 12px rgba(248, 189, 12, 0.4);
        color: var(--primary-color);
    }

.btn-outline-primary {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    background: transparent;
}

    .btn-outline-primary:hover {
        background: var(--primary-color);
        color: white;
    }

.btn-outline-secondary {
    border: 2px solid var(--secondary-color);
    color: var(--secondary-color);
    background: transparent;
}

    .btn-outline-secondary:hover {
        background: var(--secondary-color);
        color: var(--primary-color);
    }

/* ========================================
   FORMULAIRES
   ======================================== */
.form-control,
.form-select {
    border: 2px solid var(--medium-gray);
    border-radius: var(--border-radius);
    padding: 0.75rem 1rem;
    transition: var(--transition);
    font-size: 1rem;
}

    .form-control:focus,
    .form-select:focus {
        border-color: var(--primary-color);
        box-shadow: 0 0 0 0.25rem rgba(22, 40, 86, 0.25);
        outline: none;
    }

.form-label {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.form-text {
    color: var(--dark-gray);
    font-size: 0.875rem;
}

.invalid-feedback {
    color: var(--ispmm-danger);
    font-size: 0.875rem;
    font-weight: 500;
}

.valid-feedback {
    color: var(--ispmm-success);
    font-size: 0.875rem;
    font-weight: 500;
}

/* ========================================
   FOOTER
   ======================================== */
.site-footer {
    background: linear-gradient(135deg, var(--primary-color), #1a2f5f);
    color: white;
    padding: 3rem 0 1.5rem;
    margin-top: auto;
    flex-shrink: 0;
}

    .site-footer h5,
    .site-footer .footer-title {
        color: var(--secondary-color);
        font-weight: 600;
        margin-bottom: 1rem;
    }

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

    .footer-links li {
        margin-bottom: 0.5rem;
    }

    .footer-links a {
        color: white;
        text-decoration: none;
        transition: color 0.3s ease;
    }

        .footer-links a:hover {
            color: var(--secondary-color);
        }

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

    .social-links a {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.1);
        transition: all 0.3s ease;
        color: white;
        text-decoration: none;
    }

        .social-links a:hover {
            background: var(--secondary-color);
            color: var(--primary-color);
            transform: translateY(-3px);
        }

/* Back to Top Button */
.btn-back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    display: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    border: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
    background: linear-gradient(135deg, var(--primary-color), #1a2f5f);
    color: white;
}

    .btn-back-to-top:hover {
        transform: translateY(-3px);
        box-shadow: 0 6px 16px rgba(0,0,0,0.4);
        background: linear-gradient(135deg, #1a2f5f, #2c4a8c);
        color: white;
    }

/* ========================================
   ESPACEMENT UTILITAIRE
   ======================================== */
.mt-xs {
    margin-top: var(--spacing-xs);
}

.mt-sm {
    margin-top: var(--spacing-sm);
}

.mt-md {
    margin-top: var(--spacing-md);
}

.mt-lg {
    margin-top: var(--spacing-lg);
}

.mt-xl {
    margin-top: var(--spacing-xl);
}

.mb-xs {
    margin-bottom: var(--spacing-xs);
}

.mb-sm {
    margin-bottom: var(--spacing-sm);
}

.mb-md {
    margin-bottom: var(--spacing-md);
}

.mb-lg {
    margin-bottom: var(--spacing-lg);
}

.mb-xl {
    margin-bottom: var(--spacing-xl);
}

.pt-xs {
    padding-top: var(--spacing-xs);
}

.pt-sm {
    padding-top: var(--spacing-sm);
}

.pt-md {
    padding-top: var(--spacing-md);
}

.pt-lg {
    padding-top: var(--spacing-lg);
}

.pt-xl {
    padding-top: var(--spacing-xl);
}

.pb-xs {
    padding-bottom: var(--spacing-xs);
}

.pb-sm {
    padding-bottom: var(--spacing-sm);
}

.pb-md {
    padding-bottom: var(--spacing-md);
}

.pb-lg {
    padding-bottom: var(--spacing-lg);
}

.pb-xl {
    padding-bottom: var(--spacing-xl);
}

/* ========================================
   CLASSES UTILITAIRES
   ======================================== */
.text-primary {
    color: var(--ispmm-primary) !important;
}

.text-secondary {
    color: var(--ispmm-secondary) !important;
}

.text-accent {
    color: var(--ispmm-accent) !important;
}

.text-success {
    color: var(--ispmm-success) !important;
}

.text-warning {
    color: var(--ispmm-warning) !important;
}

.text-danger {
    color: var(--ispmm-danger) !important;
}

.bg-primary {
    background-color: var(--ispmm-primary) !important;
}

.bg-secondary {
    background-color: var(--ispmm-secondary) !important;
}

.bg-accent {
    background-color: var(--ispmm-accent) !important;
}

.bg-success {
    background-color: var(--ispmm-success) !important;
}

.bg-warning {
    background-color: var(--ispmm-warning) !important;
}

.bg-danger {
    background-color: var(--ispmm-danger) !important;
}

.border-primary {
    border-color: var(--ispmm-primary) !important;
}

.border-accent {
    border-color: var(--ispmm-accent) !important;
}

.rounded {
    border-radius: var(--border-radius) !important;
}

.rounded-lg {
    border-radius: var(--border-radius-lg) !important;
}

.shadow {
    box-shadow: var(--shadow) !important;
}

.shadow-lg {
    box-shadow: var(--shadow-lg) !important;
}

.transition {
    transition: var(--transition) !important;
}

.transition-fast {
    transition: var(--transition-fast) !important;
}

/* ========================================
   MEDIA QUERIES RESPONSIVE
   ======================================== */
@media (max-width: 1200px) {
    .mega-menu .dropdown-menu {
        padding: 1.5rem 0; /* Reduced padding for smaller screens */
    }

    .mega-menu-column {
        padding: 0 0.75rem;
        min-width: 180px;
    }
}

@media (max-width: 991.98px) {
    /* Mobile: Use standard dropdown behavior */
    .mega-menu .dropdown-menu {
        position: static !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        transform: none !important;
        opacity: 1 !important;
        visibility: visible !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        background: #f8f9fa !important;
        overflow-x: visible;
    }

        .mega-menu .dropdown-menu.positioned {
            position: static !important;
        }

    .mega-menu-column {
        padding: 1rem 0;
        border-right: none;
        border-bottom: 1px solid #e9ecef;
        min-width: auto;
    }

        .mega-menu-column:last-child {
            border-bottom: none;
        }

        .mega-menu-column::before {
            display: none;
        }

    .mega-menu .dropdown-item:hover {
        transform: none;
        padding-left: 0;
    }

    .menu-note {
        margin: 0.5rem 0;
    }

    .top-bar-contact {
        display: none;
    }

    .btn-candidater {
        font-size: 0.75rem;
        padding: 0.4rem 0.8rem;
    }

    .top-bar {
        padding: 0.3rem 0;
    }

    .navbar-nav .nav-link {
        padding: 8px 12px !important;
    }

    .main-navbar {
        padding: 0.3rem 1rem;
    }
}

@media (max-width: 767.98px) {
    .page-header h1 {
        font-size: 2rem;
    }

    .card-header,
    .card-body {
        padding: 1rem;
    }

    .btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }

    .top-bar-actions {
        gap: 0.5rem;
    }

    .social-links {
        display: none;
    }

    .language-switcher .dropdown-toggle {
        padding: 0.3rem 0.6rem;
        font-size: 0.75rem;
    }
}

@media (max-width: 575.98px) {
    .top-bar {
        font-size: 0.8rem;
    }

    .navbar-brand {
        font-size: 1rem;
    }

    .logo-img {
        height: 40px;
    }

    .btn-candidater {
        display: none;
    }

    .page-header {
        padding: 1.5rem 0;
    }

        .page-header h1 {
            font-size: 1.75rem;
        }

    .footer {
        padding: 2rem 0 1rem;
        text-align: center;
    }
}

/* ========================================
   FIN DU FICHIER CSS
   ======================================== */
