:root {
    --primary-color: rgb(51, 45, 81); 
    --secondary-color: #FF7043; 
    --accent-color: #4CAF50;
    --background-color: #f0f2f5; 
    --card-bg: white;
    --text-color: #333;
    --light-text: #666;
    --shadow-subtle: 0 4px 10px rgba(0, 0, 0, 0.08); 
    --header-height: 70px;
}

/* ACCENTS ORANGE PARSIMONIEUX */
::selection { background: rgba(255, 112, 67, 0.3); color: var(--primary-color); }
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: #ffccbc; border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--secondary-color); }

/* BASE & TYPOGRAPHIE */
* { box-sizing: border-box; }

body { 
    font-family: 'Poppins', sans-serif; 
    margin: 0; 
    padding: 0; 
    background-color: var(--background-color); 
    color: var(--text-color); 
    line-height: 1.6;
    background-image: radial-gradient(#e0e0e0 1px, transparent 1px);
    background-size: 20px 20px;
    padding-top: var(--header-height); /* Pour le header sticky */
    cursor: default; /* Curseur par défaut partout */
}

/* Curseur texte uniquement sur les champs de saisie */
input, textarea, [contenteditable="true"] {
    cursor: text;
}

/* HEADER & NAVIGATION */
header { 
    background: linear-gradient(90deg, var(--primary-color), #2c254a);
    color: white; 
    padding: 0 5%; 
    height: var(--header-height);
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    box-shadow: 0 4px 20px rgba(0,0,0,0.15); 
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    /* border-bottom: 3px solid var(--secondary-color); Supprimé pour éviter la double barre */
}

.header-logo { display: flex; align-items: center; gap: 15px; z-index: 1001; }
.header-logo img { max-height: 45px; }
.header-logo h1 { margin: 0; color: white; font-size: 1.4em; white-space: nowrap; }
.header-logo a { text-decoration: none; display: flex; align-items: center; gap: 15px; color: white; }

/* Navigation Desktop */
nav { display: flex; align-items: center; gap: 5px; }
nav a { 
    color: rgba(255, 255, 255, 0.8); 
    text-decoration: none; 
    font-weight: 500; 
    transition: all 0.3s ease; 
    padding: 8px 16px;
    border-radius: 50px; 
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9em;
    border: 1px solid transparent;
}
nav a:hover { 
    color: white;
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}
nav a.active { 
    background-color: var(--secondary-color); 
    color: white; 
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(255, 112, 67, 0.4);
}

/* Menu Toggle (Mobile) */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    cursor: pointer;
    z-index: 1002;
}
.menu-toggle span {
    display: block;
    height: 3px;
    width: 100%;
    background-color: white;
    border-radius: 3px;
    transition: all 0.3s ease;
}

/* RESPONSIVE HEADER */
@media (max-width: 992px) {
    .menu-toggle { display: flex; }
    
    nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background: linear-gradient(135deg, var(--primary-color), #2c254a);
        flex-direction: column;
        align-items: flex-start;
        padding: 80px 20px 20px 20px;
        transition: right 0.3s ease;
        box-shadow: -5px 0 15px rgba(0,0,0,0.2);
        overflow-y: auto;
    }
    nav.open { right: 0; }
    
    nav a {
        width: 100%;
        padding: 15px;
        border-radius: 10px;
        margin-bottom: 10px;
        font-size: 1.1em;
        justify-content: flex-start;
    }
    nav a:hover { transform: none; background-color: rgba(255,255,255,0.05); }
    nav a.active { background-color: var(--secondary-color); }

    /* Animation Hamburger */
    .menu-toggle.open span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
    .menu-toggle.open span:nth-child(2) { opacity: 0; }
    .menu-toggle.open span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }
    
    /* Overlay quand menu ouvert */
    .nav-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;
    }
    .nav-overlay.open { display: block; opacity: 1; }
}

/* LAYOUT GÉNÉRAL */
.container { width: 95%; max-width: 1200px; margin: 30px auto; padding: 0 15px; }
h1, h2, h3 { color: var(--primary-color); padding-bottom: 5px; margin-bottom: 25px; font-weight: 600; }
h2 { border-bottom: 3px solid var(--secondary-color); display: inline-block; padding-right: 15px; }

.card {
    background: var(--card-bg); padding: 30px; border-radius: 12px; box-shadow: var(--shadow-subtle);
    max-width: 600px; margin: 0 auto; transition: transform 0.3s;
    border-top: 4px solid var(--secondary-color);
    width: 100%;
    overflow: hidden; /* Assure que le contenu ne dépasse pas les bords arrondis */
}
@media (max-width: 600px) {
    .card { padding: 20px; }
    h1 { font-size: 1.8em; }
    h2 { font-size: 1.5em; }
}

/* FORMULAIRES */
form label { display: block; margin-bottom: 8px; font-weight: 600; color: var(--light-text); }
form input:not([type="checkbox"]), form select, form textarea { 
    padding: 12px; margin-bottom: 20px; width: 100%; box-sizing: border-box; 
    border: 1px solid #ddd; border-radius: 6px; font-size: 1em;
    transition: border-color 0.3s, box-shadow 0.3s;
}
form input:focus, form select:focus, form textarea:focus { 
    border-color: var(--secondary-color); 
    box-shadow: 0 0 0 3px rgba(255, 112, 67, 0.2); 
    outline: none; 
}
form button { 
    background-color: var(--secondary-color); color: white; padding: 14px 20px; cursor: pointer; border: none; 
    border-radius: 6px; font-weight: 600; font-size: 1.05em; width: 100%;
    transition: background-color 0.3s, transform 0.1s;
}
form button:hover { background-color: #E64A19; transform: translateY(-1px); }

/* CALENDRIER */
#calendar {
    background: white;
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.08);
    font-family: 'Poppins', sans-serif;
    border: 1px solid rgba(0,0,0,0.03);
    overflow: hidden; /* Pour éviter débordement */
}
@media (max-width: 768px) {
    #calendar { padding: 10px; }
    .fc-toolbar { flex-direction: column; gap: 10px; }
    .fc-toolbar-title { font-size: 1.2em !important; }
}

.fc-toolbar-title {
    font-size: 1.4em !important;
    font-weight: 700;
    color: var(--primary-color);
    letter-spacing: -0.5px;
}
.fc-button-primary {
    background-color: white !important;
    color: var(--primary-color) !important;
    border: 2px solid var(--primary-color) !important;
    border-radius: 8px !important;
    text-transform: uppercase;
    font-weight: 700;
    font-size: 0.75em !important;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    box-shadow: none !important;
}
.fc-button-primary:hover, .fc-button-primary.fc-button-active {
    background-color: var(--primary-color) !important;
    color: white !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(51, 45, 81, 0.3) !important;
}
.fc-col-header-cell {
    background-color: #f8f9fa;
    padding: 15px 0 !important;
    border: none !important;
    border-bottom: 2px solid #eee !important;
}
.fc-col-header-cell-cushion {
    color: var(--light-text);
    text-transform: uppercase;
    font-size: 0.8em;
    font-weight: 700;
    letter-spacing: 1px;
}
.fc-theme-standard td, .fc-theme-standard th { border-color: #f4f4f4 !important; }
.fc-timegrid-slot { height: 3.5em !important; }
.fc-timegrid-slot-label { font-size: 0.8em; color: #999; font-weight: 500; }
.fc-event {
    border: none !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    padding: 4px 6px;
    font-size: 0.85em;
    transition: transform 0.2s, box-shadow 0.2s;
    opacity: 0.95;
}
.fc-event:hover {
    transform: scale(1.02) translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
    z-index: 10;
    opacity: 1;
}
.fc-timegrid-event .fc-event-time { font-weight: 800; font-size: 0.9em; margin-bottom: 2px; opacity: 0.9; }
.fc-timegrid-event .fc-event-title { font-weight: 600; line-height: 1.2; }
.tippy-content { 
    background-color: var(--primary-color) !important; color: white; padding: 10px; border-radius: 6px; 
    font-size: 0.9em; font-family: 'Poppins', sans-serif; text-align: left;
}
div[data-tippy-root] { z-index: 99999 !important; }
.fc-event-title-container { overflow: hidden; white-space: nowrap; }
.fc-day-past {
    background-color: #f5f5f5 !important;
    opacity: 0.6;
    pointer-events: none;
}

/* MODALS */
#planning-modal, #inscription-modal {
    position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); 
    z-index: 2000; display: none;
    max-width: 450px; padding: 30px; 
    background: white; border-radius: 16px; box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    width: 90%; border: 1px solid rgba(0,0,0,0.1);
    animation: modalFadeIn 0.3s ease-out;
    max-height: 90vh;
    overflow-y: auto;
}
@keyframes modalFadeIn {
    from { opacity: 0; transform: translate(-50%, -45%); }
    to { opacity: 1; transform: translate(-50%, -50%); }
}
#planning-modal #delete-seance-btn { background-color: #f44336; margin-top: 10px; }
#planning-modal #close-modal-btn { background-color: #ccc; margin-top: 10px; }

#inscription-modal h3 {
    color: var(--primary-color); margin-top: 0; font-size: 1.5em;
    border-bottom: 2px solid var(--secondary-color); display: inline-block; padding-bottom: 5px;
}
#insc-modal-details {
    background: #f8f9fa; padding: 15px; border-radius: 8px; margin: 20px 0;
    text-align: left; font-size: 0.95em; color: #444; border-left: 4px solid var(--primary-color);
}
#insc-modal-details p { margin: 8px 0; }
#insc-modal-details strong { color: var(--primary-color); }
#insc-modal-actions button {
    width: 100%; padding: 12px; border: none; border-radius: 8px; font-weight: 600; font-size: 1em;
    cursor: pointer; transition: transform 0.2s, opacity 0.2s; margin-bottom: 10px; color: white;
}
#insc-modal-actions button:hover { transform: translateY(-2px); opacity: 0.9; }
.btn-close-modal {
    background: transparent !important; color: #888 !important; border: 1px solid #ddd !important; margin-top: 10px;
}
.btn-close-modal:hover { background: #f1f1f1 !important; color: #333 !important; }

/* TABLES & STATUS */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-top: 30px;
    border-radius: 8px;
    box-shadow: var(--shadow-subtle);
}
.data-table { 
    border-collapse: separate; border-spacing: 0; width: 100%; background: var(--card-bg); 
    min-width: 600px; /* Force scroll on small screens */
}
.data-table th, .data-table td { border: 1px solid #f0f0f0; padding: 15px; text-align: left; }
.data-table th { 
    background-color: #e8eaf6; 
    font-weight: 600; 
    color: var(--primary-color); 
    border-bottom: 3px solid var(--secondary-color);
}
.status-active { color: var(--accent-color); font-weight: bold; background-color: #e8f5e9; padding: 4px 8px; border-radius: 4px; font-size: 0.9em; white-space: nowrap; }
.status-pending { color: var(--secondary-color); font-weight: bold; background-color: #fff3e0; padding: 4px 8px; border-radius: 4px; font-size: 0.9em; white-space: nowrap; }

/* ONLINE USERS WIDGET */
.online-users-container {
    position: fixed; bottom: 15px; right: 15px; display: none;
    flex-direction: row-reverse; align-items: flex-end; z-index: 9999; pointer-events: none; padding: 10px;
}
.online-users-container .user-bubble {
    pointer-events: auto; width: 34px; height: 34px; margin-left: -12px;
    transition: all 0.3s ease; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2)); position: relative;
}
.online-users-container .user-bubble:hover { transform: translateY(-5px); margin-left: 2px; margin-right: 2px; z-index: 100; }
.online-users-container .user-bubble img {
    width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; border: 2px solid white; background: white;
}
.online-users-container .user-bubble-initials {
    width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--secondary-color), #ff9e80); color: white;
    font-weight: bold; font-size: 0.8em; border-radius: 50%; border: 2px solid white;
}
.online-users-container .user-bubble .online-dot {
    position: absolute; bottom: 0; right: 0; width: 9px; height: 9px;
    background-color: #4CAF50; border: 1.5px solid white; border-radius: 50%; box-shadow: 0 0 2px rgba(0,0,0,0.2);
}
.online-users-header, .user-name, .online-user-row { display: contents; }
.online-users-header, .user-name { display: none !important; }
.online-user-row { display: block; }

/* BOUTONS ICONES ADMIN */
.btn-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border-radius: 4px; color: white; text-decoration: none;
    transition: opacity 0.2s;
}
.btn-icon:hover { opacity: 0.8; }
.btn-success { background-color: #4CAF50; }
.btn-warning { background-color: #FF9800; }
.btn-info { background-color: var(--primary-color); }
.btn-secondary { background-color: #607D8B; }
.btn-danger { background-color: #f44336; }

/* ANIMATEUR DASHBOARD */
.sessions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}
.session-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow-subtle);
    border-left: 5px solid var(--primary-color);
    transition: transform 0.2s;
}
.session-card:hover { transform: translateY(-3px); }
.session-card h4 { margin: 0 0 10px 0; color: var(--primary-color); font-size: 1.2em; }
.session-meta { font-size: 0.9em; color: #666; margin-bottom: 15px; }
.session-meta i { width: 20px; color: var(--secondary-color); }
.session-stat {
    display: flex; justify-content: space-between; align-items: center;
    background: #f8f9fa; padding: 10px; border-radius: 6px; margin-bottom: 15px;
}
.session-stat .count { font-weight: bold; color: var(--accent-color); }

/* PROFILE PAGE GRID */
.profile-dashboard-grid {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 30px;
    align-items: start;
}
@media (max-width: 900px) {
    .profile-dashboard-grid { grid-template-columns: 1fr; }
    .profile-sidebar { position: static !important; margin-bottom: 20px; }
}

.member-card-container {
    display: flex; align-items: center; gap: 30px; flex-wrap: wrap;
}
@media (max-width: 600px) {
    .member-card-container { justify-content: center; }
    .member-card { transform: scale(0.9); transform-origin: center; }
}

/* ADMIN RESTORE BUTTON */
.admin-restore-btn {
    position: fixed; 
    bottom: 20px; 
    right: 20px; 
    background: #d32f2f; 
    color: white; 
    padding: 15px 25px; 
    border-radius: 50px; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.3); 
    text-decoration: none; 
    font-weight: bold; 
    z-index: 100000; 
    display: flex; 
    align-items: center; 
    gap: 10px; 
    font-family: sans-serif;
    transition: transform 0.2s;
}
.admin-restore-btn:hover {
    transform: scale(1.05);
    background: #b71c1c;
}
@media (max-width: 600px) {
    .admin-restore-btn {
        bottom: 70px; /* Au-dessus du widget online users si besoin */
        right: 10px;
        padding: 10px 20px;
        font-size: 0.9em;
    }
}

/* ACCUEIL */
.hero-section {
    text-align: center;
    padding: 60px 20px;
    background: linear-gradient(135deg, var(--primary-color), #2c254a);
    color: white;
    border-radius: 12px;
    margin-bottom: 40px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.hero-section h1 {
    font-size: 3em;
    margin-bottom: 20px;
    color: white;
}

.hero-section p {
    font-size: 1.2em;
    max-width: 800px;
    margin: 0 auto 30px auto;
    opacity: 0.9;
}

.btn-hero {
    background-color: var(--secondary-color);
    color: white;
    padding: 15px 30px;
    text-decoration: none;
    border-radius: 50px;
    font-weight: bold;
    font-size: 1.1em;
    transition: transform 0.2s;
    display: inline-block;
}

.btn-hero:hover {
    transform: scale(1.05);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

.feature-card {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow-subtle);
    text-align: center;
}

.objectives-section {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: var(--shadow-subtle);
}

@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 2em;
    }
    .hero-section {
        padding: 40px 15px;
    }
}
