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

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    line-height: 1.5;
    background: #f5f5f5;
    color: #333;
}

.container {
    width: 100%;
    padding: 10px;
}

@media (min-width: 768px) {
    .container {
        max-width: 1200px;
        margin: 0 auto;
        padding: 20px;
    }
}

/* -----------------------------------------------
   MODE PUBLIC (par défaut) - TOUT VERT
   ----------------------------------------------- */
header {
    background: #9fc7b1;
    color: white;
    padding: 12px 15px;
    border-radius: 8px 8px 0 0;
    text-align: center;
}

nav {
    background: #9fc7b1;
    padding: 0;
    border-radius: 0 0 8px 8px;
    margin-bottom: 15px;
}

nav ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    margin: 0;
    padding: 0;
}

nav ul li a {
    color: white;
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 5px;
    font-size: 0.85rem;
    font-weight: bold;
    display: inline-block;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    transition: all 0.2s ease;
}

nav ul li a:hover {
    background: rgba(255,255,255,0.25);
    border-color: rgba(255,255,255,0.4);
    transform: translateY(-1px);
}

.btn {
    display: inline-block;
    padding: 10px 15px;
    background: #9fc7b1;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    margin: 3px;
    transition: background 0.3s;
}

.btn:hover {
    background: #7ba58a;
}

table th {
    background: #9fc7b1;
    color: white;
    padding: 8px 5px;
    text-align: left;
    white-space: nowrap;
}

.card-header {
    border-bottom: 2px solid #9fc7b1;
    padding-bottom: 10px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.app-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    padding: 25px 20px;
    transition: all 0.25s ease;
    border-left: 5px solid #9fc7b1;
    display: flex;
    flex-direction: column;
}

.app-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.15);
}

.app-titre {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 12px;
    line-height: 1.3;
    color: #2c3e50;
}

.app-description {
    color: #5a6a7a;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 20px;
    flex-grow: 1;
}

.app-btn {
    background: #9fc7b1;
    color: white;
    text-decoration: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: bold;
    text-align: center;
    transition: background 0.3s;
    display: inline-block;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.app-btn:hover {
    background: #7ba58a;
}

.apps-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin: 25px 0;
}

@media (min-width: 768px) {
    .apps-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .apps-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.link-primary {
    color: #9fc7b1;
    text-decoration: none;
}

.link-primary:hover {
    color: #7ba58a;
    text-decoration: underline;
}

.text-primary {
    color: #9fc7b1;
}

.seance-card {
    border-left: 5px solid #9fc7b1;
}

/* -----------------------------------------------
   MODE ADMIN - TOUT VIOLET
   ----------------------------------------------- */
body.mode-admin header {
    background: #764ba2;
}

body.mode-admin nav {
    background: #5a3780;
    padding: 0;
    border-radius: 0 0 8px 8px;
    margin-bottom: 15px;
}

body.mode-admin nav ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    margin: 0;
    padding: 0;
}

body.mode-admin nav ul li a {
    color: white;
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 5px;
    font-size: 0.85rem;
    font-weight: bold;
    display: inline-block;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    transition: all 0.2s ease;
}

body.mode-admin nav ul li a:hover {
    background: rgba(255,255,255,0.25);
    border-color: rgba(255,255,255,0.4);
    transform: translateY(-1px);
}

body.mode-admin .btn {
    background: #764ba2;
}

body.mode-admin .btn:hover {
    background: #5a3780;
}

body.mode-admin table th {
    background: #764ba2;
}

body.mode-admin .card-header {
    border-bottom-color: #764ba2;
}

body.mode-admin .app-card {
    border-left-color: #764ba2;
}

body.mode-admin .app-btn {
    background: #764ba2;
}

body.mode-admin .app-btn:hover {
    background: #5a3780;
}

body.mode-admin .link-primary {
    color: #764ba2;
}

body.mode-admin .link-primary:hover {
    color: #5a3780;
}

body.mode-admin .text-primary {
    color: #764ba2;
}

body.mode-admin .seance-card {
    border-left-color: #764ba2;
}

/* -----------------------------------------------
   ADMIN - Menu (spécifique admin, déjà violet)
   ----------------------------------------------- */
.admin-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.admin-menu li {
    width: 100%;
    margin: 0;
    padding: 0;
    position: relative;
}

.admin-menu-link {
    display: block;
    padding: 10px 15px;
    background: #5a3780;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: bold;
    text-align: left;
    transition: background 0.3s;
}

.admin-menu-link:hover {
    background: #764ba2;
}

.admin-menu-link.active {
    background: #28a745;
}

.site-link {
    background: #28a745;
}

.site-link:hover {
    background: #218838;
}

/* Menu paramètres déroulant */
.menu-param-container {
    position: relative;
}

.menu-param-btn {
    cursor: pointer;
}

.menu-param-dropdown {
    display: none;
    list-style: none;
    padding: 5px 0 5px 20px;
    margin: 2px 0 5px 0;
    background: rgba(90,55,128,0.3);
    border-radius: 5px;
}

.menu-param-dropdown.active {
    display: block;
}

.menu-param-dropdown li {
    width: 100%;
    margin: 2px 0;
}

.admin-menu-link-sub {
    display: block;
    padding: 8px 15px;
    background: #6a4890;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-size: 0.95rem;
    transition: background 0.3s;
}

.admin-menu-link-sub:hover {
    background: #8a66b0;
}

.admin-menu-link-sub.active {
    background: #28a745;
}

.menu-param-section {
    padding: 10px 15px 5px 15px;
    color: #ccc;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Mode desktop */
@media (min-width: 769px) {
    .admin-menu {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
        align-items: center;
    }
    .admin-menu li {
        width: auto;
    }
    .admin-menu-link {
        padding: 8px 12px;
        font-size: 0.9rem;
    }
    
    .menu-param-container:hover .menu-param-dropdown {
        display: block;
        position: absolute;
        top: 100%;
        left: 0;
        min-width: 200px;
        background: #5a3780;
        padding: 10px;
        border-radius: 5px;
        box-shadow: 0 5px 15px rgba(0,0,0,0.3);
        z-index: 1000;
    }
    
    .menu-param-dropdown {
        display: none;
    }
}

/* -----------------------------------------------
   TITRES
   ----------------------------------------------- */
h1 {
    font-size: 1.5rem;
    margin: 0;
}

h2 {
    font-size: 1.3rem;
    margin-bottom: 15px;
}

h3 {
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.footer {
    margin-top: 30px;
    padding: 20px;
    background: white;
    border-radius: 10px;
    text-align: center;
    color: #666;
}

/* -----------------------------------------------
   TABLEAUX (suite)
   ----------------------------------------------- */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

table td {
    padding: 8px 5px;
    border-bottom: 1px solid #ddd;
    white-space: nowrap;
}

@media (max-width: 480px) {
    table {
        font-size: 0.75rem;
    }
    table th, table td {
        padding: 6px 3px;
    }
}

.sort-link {
    color: white;
    text-decoration: none;
    font-weight: bold;
}

.header-icon {
    color: white !important;
    font-size: 1.3rem;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* -----------------------------------------------
   BOUTONS (compléments)
   ----------------------------------------------- */
.btn-success {
    background: #28a745;
}
.btn-success:hover {
    background: #218838;
}

.btn-danger {
    background: #dc3545;
}
.btn-danger:hover {
    background: #c82333;
}

.btn-warning {
    background: #ffc107;
    color: #333;
}
.btn-warning:hover {
    background: #e0a800;
}

.btn-info {
    background: #17a2b8;
    color: white;
}
.btn-info:hover {
    background: #138496;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 0.8rem;
}

/* -----------------------------------------------
   FORMULAIRES
   ----------------------------------------------- */
.form-group {
    margin-bottom: 15px;
}

.form-label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 0.95rem;
}

.form-control:focus {
    outline: none;
    border-color: #764ba2;
    box-shadow: 0 0 0 3px rgba(118,75,162,0.1);
}

/* -----------------------------------------------
   ALERTES
   ----------------------------------------------- */
.alert {
    padding: 12px;
    border-radius: 5px;
    margin-bottom: 15px;
    font-size: 0.9rem;
}

.alert-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.alert-danger {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.alert-info {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

.alert-warning {
    background: #fff3cd;
    border: 1px solid #ffeeba;
    color: #856404;
}

/* -----------------------------------------------
   GRILLE
   ----------------------------------------------- */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

@media (min-width: 768px) {
    .grid-2 {
        grid-template-columns: 1fr 1fr;
    }
}

/* -----------------------------------------------
   JEUX - Ronds de disponibilité
   ----------------------------------------------- */
.dispo-vert {
    color: #28a745;
    font-size: 1.4rem;
    line-height: 1;
}
.dispo-rouge {
    color: #dc3545;
    font-size: 1.4rem;
    line-height: 1;
}
.dispo-gris {
    color: #6c757d;
    font-size: 1.4rem;
    line-height: 1;
}
.game-name {
    font-weight: bold;
}
.game-name a {
    color: #333;
    text-decoration: none;
}
.game-name a:hover {
    color: #764ba2;
    text-decoration: underline;
}

/* -----------------------------------------------
   ADMIN - Jeux (icônes et boutons)
   ----------------------------------------------- */
.statut-vert {
    color: #28a745;
    font-size: 1.2rem;
    line-height: 1;
}

.statut-rouge {
    color: #dc3545;
    font-size: 1.2rem;
    line-height: 1;
}

.statut-gris {
    color: #6c757d;
    font-size: 1.2rem;
    line-height: 1;
}

.toggle-link {
    text-decoration: none;
    display: inline-block;
    padding: 5px 8px;
    border-radius: 4px;
    transition: background 0.2s;
}

.toggle-link:hover {
    background: rgba(0,0,0,0.05);
}

.btn-pret-direct {
    display: inline-block;
    padding: 5px 10px;
    background: #28a745;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.btn-pret-direct.warning {
    background: #ffc107;
    color: #333;
}

.btn-pret-direct:hover {
    opacity: 0.8;
}

/* -----------------------------------------------
   APPLICATIONS - Version admin
   ----------------------------------------------- */
.apps-grid-admin {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin: 20px 0;
}

@media (min-width: 768px) {
    .apps-grid-admin {
        grid-template-columns: repeat(2, 1fr);
    }
}

.app-card-admin {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border-left: 5px solid #6c757d;
    display: flex;
    flex-direction: column;
}

.app-card-admin.validee {
    border-left-color: #28a745;
}

.app-card-admin.non-validee {
    border-left-color: #dc3545;
    opacity: 0.9;
}

.app-card-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 10px;
}

.app-titre-admin {
    font-size: 1.2rem;
    font-weight: bold;
    color: #333;
}

.app-description-admin {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.4;
    margin-bottom: 15px;
    word-break: break-word;
}

.app-url-admin {
    background: #f8f9fa;
    padding: 8px 12px;
    border-radius: 5px;
    font-size: 0.85rem;
    word-break: break-all;
    margin-bottom: 10px;
}

.app-meta-admin {
    margin-bottom: 15px;
}

.app-actions-admin {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.mode-edition {
    background: #fff3cd;
    border-left: 5px solid #ffc107;
}

/* -----------------------------------------------
   ADMIN - Adhérents
   ----------------------------------------------- */
.bg-light {
    background: #f8f9fa;
}

.rounded-8 {
    border-radius: 8px;
}

.p-20 {
    padding: 20px;
}

.mb-30 {
    margin-bottom: 30px;
}

.mb-20 {
    margin-bottom: 20px;
}

.mb-15 {
    margin-bottom: 15px;
}

.mb-10 {
    margin-bottom: 10px;
}

.mt-30 {
    margin-top: 30px;
}

.mt-20 {
    margin-top: 20px;
}

.mt-15 {
    margin-top: 15px;
}

.mt-10 {
    margin-top: 10px;
}

.ml-10 {
    margin-left: 10px;
}

.gap-15 {
    gap: 15px;
}

.gap-10 {
    gap: 10px;
}

.gap-8 {
    gap: 8px;
}

.flex {
    display: flex;
}

.flex-wrap {
    flex-wrap: wrap;
}

.flex-2 {
    flex: 2;
}

.flex-1 {
    flex: 1;
}

.min-width-250 {
    min-width: 250px;
}

.min-width-150 {
    min-width: 150px;
}

.flex-align-center {
    display: flex;
    align-items: center;
}

.flex-align-end {
    display: flex;
    align-items: flex-end;
}

.inline {
    display: inline;
}

.text-muted {
    color: #6c757d;
}

.text-success {
    color: #28a745;
}

.text-danger {
    color: #dc3545;
}

.text-info {
    color: #17a2b8;
}

.text-warning {
    color: #ffc107;
}

.small {
    font-size: 0.85rem;
}

.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
}

.badge-success {
    background: #28a745;
    color: white;
}

.badge-warning {
    background: #ffc107;
    color: #333;
}

.badge-secondary {
    background: #6c757d;
    color: white;
}

/* -----------------------------------------------
   ADMIN - Tableau de bord
   ----------------------------------------------- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

@media (min-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: bold;
    line-height: 1;
    margin-bottom: 10px;
}

.stat-label {
    color: #666;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* -----------------------------------------------
   AIDE POPUP
   ----------------------------------------------- */
.help-icon {
    display: inline-block;
    width: 28px;
    height: 28px;
    background: #17a2b8;
    color: white;
    border-radius: 50%;
    text-align: center;
    line-height: 28px;
    font-weight: bold;
    cursor: pointer;
    margin-left: 10px;
}

.help-popup {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 5px 30px rgba(0,0,0,0.3);
    z-index: 1000;
    max-width: 90%;
    width: 400px;
}

.help-popup.active {
    display: block;
}

.help-popup h3 {
    color: #764ba2;
    margin-bottom: 15px;
}

.help-popup p {
    margin-bottom: 15px;
    line-height: 1.6;
}

.help-popup ul {
    margin-left: 20px;
    color: #555;
    line-height: 1.6;
}

.help-popup li {
    margin-bottom: 10px;
}

.help-popup .btn {
    width: 100%;
    margin-top: 15px;
}

.help-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}

.help-overlay.active {
    display: block;
}

/* -----------------------------------------------
   LÉGENDES
   ----------------------------------------------- */
.legend-jeux, .legend-jeux-public {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    font-size: 0.9rem;
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

/* -----------------------------------------------
   UTILITAIRES - Espacements
   ----------------------------------------------- */
.mt-5 { margin-top: 5px; }
.mt-10 { margin-top: 10px; }
.mt-15 { margin-top: 15px; }
.mt-20 { margin-top: 20px; }
.mt-30 { margin-top: 30px; }
.mt-50 { margin-top: 50px; }
.mb-5 { margin-bottom: 5px; }
.mb-10 { margin-bottom: 10px; }
.mb-15 { margin-bottom: 15px; }
.mb-20 { margin-bottom: 20px; }
.mb-30 { margin-bottom: 30px; }
.mb-50 { margin-bottom: 50px; }
.p-10 { padding: 10px; }
.p-15 { padding: 15px; }
.p-20 { padding: 20px; }
.p-30 { padding: 30px; }
.p-50 { padding: 50px; }

/* -----------------------------------------------
   UTILITAIRES - Alignement & Texte
   ----------------------------------------------- */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.list-unstyled {
    list-style: none;
    padding-left: 0;
}
.text-pre-line { white-space: pre-line; }
.btn-link {
    color: white;
    text-decoration: none;
}
.btn-link:hover {
    text-decoration: underline;
}
.w-100 { width: 100%; }

/* -----------------------------------------------
   CONTENEURS
   ----------------------------------------------- */
.container-sm {
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* -----------------------------------------------
   ADMIN - Séances - Lignes cliquables
   ----------------------------------------------- */
.date-row {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.date-row:hover {
    background-color: #e1d9f2;
}

.date-row td:first-child {
    position: relative;
}

.date-row td:first-child::before {
    content: "✏️";
    position: absolute;
    left: -25px;
    opacity: 0;
    transition: opacity 0.2s ease;
    font-size: 0.9rem;
}

.date-row:hover td:first-child::before {
    opacity: 1;
}

@media (max-width: 768px) {
    .date-row td:first-child::before {
        left: -18px;
        font-size: 0.8rem;
    }
}

/* -----------------------------------------------
   ÉTATS VIDES
   ----------------------------------------------- */
.empty-state {
    text-align: center;
    padding: 50px 30px;
    background: #fafbfc;
    border-radius: 16px;
    color: #6c757d;
    border: 2px dashed #dee2e6;
}

.empty-state span {
    font-size: 3.5rem;
    display: block;
    margin-bottom: 15px;
}

.empty-state p {
    font-size: 1.2rem;
    margin: 0;
}
/* Version et copyright */
.copyright-footer {
    text-align: center;
    font-size: 0.75rem;
    color: #999;
    margin-top: 30px;
    padding: 10px 0;
    border-top: 1px solid #eee;
}
.copyright-footer a {
    color: #999;
    text-decoration: none;
}
.copyright-footer a:hover {
    color: #666;
}
.grid-3 {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 20px;
}
@media (min-width: 768px) {
    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (min-width: 1024px) {
    .grid-3 {
        grid-template-columns: repeat(3, 1fr);
    }
}
.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 0.75rem;
    background: #f0f0f0;
    margin: 2px;
}
.badge-secondary { background: #6c757d; color: white; }
.badge-info { background: #17a2b8; color: white; }
