/* ===== VARIABLES CSS COHÉRENTES AVEC EGEI ===== */
:root {
    --bleu-nuit: #1a237e;
    --bleu-clair: #283593;
    --rouge-nuit: #b71c1c;
    --rouge-clair: #c62828;
    --blanc: #ffffff;
    --gris-clair: #f5f5f5;
    --gris-fonce: #424242;
    --bleu-gradient: linear-gradient(135deg, #1a237e 0%, #283593 100%);
    --rouge-gradient: linear-gradient(135deg, #b71c1c 0%, #c62828 100%);
    
    --shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 15px 35px rgba(0, 0, 0, 0.15);
    --shadow-modal: 0 20px 60px rgba(0, 0, 0, 0.2);
    
    --border-radius: 20px;
    --transition: all 0.3s ease;
}

/* ===== RÉINITIALISATION COHÉRENTE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--blanc);
    color: var(--gris-fonce);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* ===== BANNIÈRE STAFF - Style EGEI ===== */
.staff-banner {
    background: linear-gradient(135deg, rgba(26, 35, 126, 0.9) 0%, rgba(183, 28, 28, 0.8) 100%), 
                url('https://images.unsplash.com/photo-1521737711867-e3b97375f902?ixlib=rb-4.0.3&auto=format&fit=crop&w=1600&q=80') center/cover;
    color: var(--blanc);
    padding: clamp(48px, 8vh, 140px) 0 clamp(28px, 6vh, 80px);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.banner-title {
    font-size: clamp(1.6rem, 4vw, 3.5rem);
    margin-bottom: 20px;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3);
    font-weight: 700;
}

.banner-subtitle {
    font-size: clamp(1rem, 2.2vw, 1.5rem);
    opacity: 0.95;
    font-weight: 300;
    max-width: 820px;
    margin: 0 auto 2.4rem;
}

.stats-container {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 2.2rem;
    align-items: center;
    white-space: nowrap; /* keep the three stats on one line */
}

.stat-item {
    text-align: center;
    min-width: 0;
    flex: 1 1 0;
}

.stat-number {
    font-size: clamp(1.2rem, 3.2vw, 2rem);
    font-weight: 700;
    margin-bottom: 0.25rem;
    display: block;
}

.stat-label {
    font-size: clamp(.75rem, 1.6vw, .95rem);
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.85;
}

.banner-scroll-indicator {
    margin-top: 3rem;
    color: var(--blanc);
    font-size: 1.5rem;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

/* ===== SECTIONS - Style EGEI ===== */
.bureau-members,
.club-leaders {
    padding: 100px 0;
}

.bureau-members {
    background: var(--blanc);
}

.club-leaders {
    background: var(--gris-clair);
}

.committee-members {
    padding: 100px 0;
    background: var(--blanc);
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-title {
    font-size: 2.8rem;
    color: var(--bleu-nuit);
    position: relative;
    display: inline-block;
    margin-bottom: 15px;
    font-weight: 700;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: var(--rouge-gradient);
    border-radius: 2px;
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--gris-fonce);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.5;
}

/* ===== CARTES MEMBRES - Style EGEI Direction ===== */
.direction-slider-container {
    position: relative;
    max-width: 1200px;
    margin: 0 auto 40px;
}

.direction-cards-slider {
    display: flex;
    gap: 24px;
    padding: 12px 8px;
    overflow: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    align-items: stretch;
}

.direction-card-slide {
    flex: 0 0 calc(33.333% - 16px);
    background: var(--blanc);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    scroll-snap-align: start;
}

.direction-card-slide:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
}

.member-photo-container {
    position: relative;
    height: 250px;
    overflow: hidden;
    background: var(--gris-clair);
}

.member-photo {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bleu-nuit);
    font-size: 3rem;
    font-weight: 600;
}

.member-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.direction-card-slide:hover .member-photo img {
    transform: scale(1.1);
}

.photo-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(26, 35, 126, 0.8) 0%, rgba(183, 28, 28, 0.7) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.direction-card-slide:hover .photo-overlay {
    opacity: 1;
}

.photo-overlay i {
    font-size: 2rem;
    color: var(--blanc);
}

.card-header {
    padding: 25px 25px 15px;
    text-align: center;
    border-bottom: 1px solid #f0f0f0;
}

.member-name {
    font-size: 1.4rem;
    color: var(--bleu-nuit);
    margin-bottom: 5px;
    font-weight: 700;
}

.member-position {
    color: var(--rouge-nuit);
    font-weight: 600;
    font-size: 1rem;
}

.card-body {
    padding: 20px 25px 25px;
}

.card-actions {
    padding: 12px 20px 18px;
    display: flex;
    justify-content: flex-end;
}

.btn-details {
    background: transparent;
    border: 1px solid rgba(11,102,255,0.12);
    color: var(--bleu-nuit);
    padding: .5rem .8rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}
.btn-details:hover { background: rgba(11,102,255,0.06); }

.member-contact p {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--gris-fonce);
}

.member-contact i {
    margin-right: 10px;
    color: var(--rouge-nuit);
    width: 16px;
}

/* ===== CONTROLES SLIDER - Style EGEI ===== */
.slider-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    margin-top: 40px;
}

.slider-btn {
    background: var(--bleu-gradient);
    color: var(--blanc);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(26, 35, 126, 0.3);
}

.slider-btn:hover:not(:disabled) {
    background: var(--rouge-gradient);
    transform: scale(1.1);
    box-shadow: 0 8px 20px rgba(183, 28, 28, 0.4);
}

.slider-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.slider-btn:disabled:hover {
    transform: none;
    background: var(--bleu-gradient);
}

.slider-dots {
    display: flex;
    gap: 15px;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--bleu-nuit);
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0.3;
}

.dot.active {
    opacity: 1;
    background: var(--rouge-nuit);
    transform: scale(1.2);
}

/* ===== ONGLETS CLUBS - Style EGEI ===== */
.clubs-tabs-container {
    background: var(--blanc);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.clubs-tabs-navigation {
    display: flex;
    background: var(--gris-clair);
    border-bottom: 1px solid var(--gris-moyen);
    flex-wrap: wrap;
}

.club-tab-btn {
    flex: 1;
    min-width: 150px;
    background: none;
    border: none;
    padding: 20px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--gris-fonce);
    white-space: nowrap;
}

.club-tab-btn:hover {
    background: var(--gris-moyen);
    color: var(--bleu-nuit);
}

.club-tab-btn.active {
    background: var(--blanc);
    color: var(--bleu-nuit);
    border-bottom: 3px solid var(--rouge-nuit);
}

.clubs-tabs-content {
    padding: 40px;
}

.club-tab-panel {
    display: none;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.club-tab-panel.active {
    display: block;
}

.club-info {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--gris-clair);
}

.club-info h3 {
    font-size: 1.8rem;
    color: var(--bleu-nuit);
    margin-bottom: 1rem;
    line-height: 1.3;
}

.club-info p {
    color: var(--gris-fonce);
    font-size: 1.1rem;
    line-height: 1.5;
}

.club-leaders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
    justify-items: center;
}

.committee-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
    justify-items: center;
}

/* ===== MODALE - Style EGEI ===== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    overflow-y: auto;
}

.modal-content {
    background-color: var(--blanc);
    margin: 5% auto;
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 600px;
    box-shadow: var(--shadow-modal);
    animation: modalSlideIn 0.3s ease;
    position: relative;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 25px 30px 20px;
    border-bottom: 1px solid var(--gris-moyen);
    gap: 15px;
}

.modal-title {
    color: var(--bleu-nuit);
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.3;
    flex: 1;
}

.modal-close {
    color: var(--gris-fonce);
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    transition: var(--transition);
    flex-shrink: 0;
    margin-top: -5px;
}

.modal-close:hover {
    color: var(--rouge-nuit);
    transform: scale(1.1);
}

.modal-body {
    padding: 30px;
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.modal-photo-container {
    flex-shrink: 0;
}

.modal-photo {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--gris-clair);
    background: var(--gris-clair);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bleu-nuit);
    font-size: 2.5rem;
    font-weight: 600;
}

.modal-info {
    flex: 1;
    min-width: 0;
}

.modal-position {
    color: var(--rouge-nuit);
    font-weight: 600;
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.modal-bio {
    color: var(--gris-fonce);
    line-height: 1.6;
    margin-bottom: 20px;
    font-size: 1rem;
}

.modal-contact {
    margin-bottom: 20px;
}

.modal-contact p {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    color: var(--gris-fonce);
    font-size: 0.95rem;
}

.modal-contact i {
    margin-right: 10px;
    color: var(--bleu-nuit);
    width: 16px;
    flex-shrink: 0;
}

.modal-skills {
    background: var(--gris-clair);
    padding: 20px;
    border-radius: var(--border-radius);
}

.modal-skills h4 {
    color: var(--bleu-nuit);
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.modal-skills ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.modal-skills li {
    background: var(--blanc);
    padding: 6px 12px;
    border-radius: 20px;
    color: var(--gris-fonce);
    font-size: 0.85rem;
    border: 1px solid var(--gris-moyen);
    transition: var(--transition);
}

.modal-skills li:hover {
    background: var(--bleu-nuit);
    color: var(--blanc);
    transform: translateY(-2px);
}

/* ===== SCROLL HORIZONTAL POUR MOBILE - CORRIGÉ ===== */
.direction-cards-slider {
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch; /* Pour iOS */
}

/* Masquer la scrollbar pour tous les navigateurs */
.direction-cards-slider::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

/* Pour Firefox */
.direction-cards-slider {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE et Edge */
}

.direction-card-slide {
    scroll-snap-align: center;
    scroll-snap-stop: always;
}

/* ===== STYLES POUR LES INITIALES ===== */
.member-initials {
    font-weight: 600;
    color: var(--bleu-nuit);
}

/* ===== RESPONSIVE DESIGN - Style EGEI ===== */
@media (max-width: 1100px) {
    .direction-card-slide {
        flex: 0 0 calc(50% - 12px);
    }
    .club-tab-btn {
        min-width: 140px;
    }
}

@media (max-width: 768px) {
    .staff-banner {
        padding: 100px 0 60px;
    }
    
    .banner-title {
        font-size: 2.5rem;
    }
    
    .banner-subtitle {
        font-size: 1.2rem;
    }
    
    .stats-container {
        gap: 2rem;
    }
    
    .section-title {
        font-size: 2.2rem;
    }
    
    .direction-card-slide {
        flex: 0 0 100%;
    }
    
    .clubs-tabs-navigation {
        flex-direction: column;
    }
    
    .club-tab-btn {
        min-width: auto;
        justify-content: flex-start;
        padding: 18px 20px;
    }
    
    .modal-body {
        flex-direction: column;
        text-align: center;
        gap: 25px;
    }
    
    .modal-photo {
        margin: 0 auto;
    }
    
    .modal-contact p {
        justify-content: center;
    }
    
    .modal-skills ul {
        justify-content: center;
    }
    
    /* Masquer les contrôles du slider sur mobile */
    /* Afficher les contrôles du slider en overlay sur mobile pour navigation tactile */
    .slider-controls {
        display: flex;
        position: absolute;
        top: 50%;
        left: 0;
        right: 0;
        justify-content: space-between;
        padding: 0 12px;
        transform: translateY(-50%);
        pointer-events: none; /* allow clicks only on buttons */
    }
    .slider-controls .slider-btn {
        pointer-events: auto;
        width: 42px;
        height: 42px;
        box-shadow: 0 6px 18px rgba(0,0,0,0.18);
    }
    
    /* Afficher le scroll horizontal naturel sur mobile */
    .direction-cards-slider {
        padding-bottom: 20px;
        margin-bottom: 10px;
    }
}

/* Improve card layout for small screens: compact horizontal card for better reading */
@media (max-width: 640px) {
    .direction-card-slide {
        display: flex;
        gap: 12px;
        align-items: center;
        padding: 12px;
        min-width: 90vw;
    }
    .member-photo-container { flex: 0 0 90px; height: 90px; }
    .member-photo { height: 90px; }
    .card-header { padding: 8px 0 6px; text-align: left; border-bottom: none; }
    .card-body { padding: 8px 0 0; }
    .member-name { font-size: 1.05rem; }
    .member-position { font-size: 0.95rem; }
    .member-contact p { font-size: 0.9rem; }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .direction-card-slide {
        width: 85vw;
        margin: 0 2.5vw;
    }
    
    .club-leaders-grid {
        grid-template-columns: 1fr;
    }
    
    .clubs-tabs-content {
        padding: 20px 15px;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .modal-header {
        padding: 20px 20px 15px;
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 10px;
    }
    
    .modal-close {
        position: absolute;
        top: 15px;
        right: 20px;
        margin-top: 0;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .stats-container {
        flex-direction: row; /* keep items inline on very small screens */
        gap: 0.8rem;
        overflow-x: auto;
        padding-bottom: 6px;
    }
    
    .stat-item {
        min-width: 110px;
        flex: 0 0 auto;
    }
}

@media (max-width: 360px) {
    .direction-card-slider {
        gap: 20px;
    }
    
    .direction-card-slide {
        width: 90vw;
        margin: 0 5vw;
        min-width: 260px;
    }
    
    .club-tab-btn {
        font-size: 0.85rem;
    }
    
    .modal-content {
        width: 98%;
        margin: 5% auto;
    }
}

/* Amélioration de l'accessibilité */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Support tactile amélioré */
@media (hover: none) {
    .direction-card-slide:hover {
        transform: none;
    }
    
    .photo-overlay {
        opacity: 0.7;
    }
    
    .direction-card-slide:active {
        transform: scale(0.98);
    }
}

/* Fallback pour les navigateurs qui ne supportent pas scroll-snap */
@supports not (scroll-snap-type: x mandatory) {
    .direction-cards-slider {
        overflow-x: scroll;
        -webkit-overflow-scrolling: touch;
    }
    
    .direction-card-slide {
        flex-shrink: 0;
    }
}