body {
  margin: 0;
  background-image: url("../Images/background2.png");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  color: white;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: -1;
}

@font-face {
  font-family: Simpsons;
  src: local("Simpsons"),
    url("../Styles_CSS/Simpsons.otf") format("opentype") tech(color-COLRv1);
}

/* Main site title - repris du CSS original */
.main-site-title {
    display: flex;
    align-items: center;
    font-family: Simpsons, sans-serif;
    background: #ff0;
    border: 4px solid #000;
    color: #fff;
    text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
    height: 12%;
    justify-content: flex-start;
    box-sizing: border-box;
}

.main-site-title img {
    width: 9%;
    min-width: 50px;
    margin-right: 3%;
}

.main-site-title p {
    font-size: 36px;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transform: scale(1);
    text-align: left;
    padding-left: 10px;
    flex-grow: 1;
    box-sizing: border-box;
}

.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.page-title {
    text-align: center;
    font-size: 2.2rem;
    font-weight: 700;
    margin: 30px 0;
    color: #ffffff; /* Changé de #2c3e50 à blanc pour être visible */
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8); /* Ajout d'une ombre pour le contraste */
}

/* Boutons de tri */
.sort-buttons-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin: 30px 0;
}

.button-link {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 1px solid #d0d7de;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 600;
    color: #24292f;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.3, 0, 0.5, 1);
    text-align: center;
    min-width: 110px;
    box-shadow: 0 1px 3px rgba(27, 31, 35, 0.12), 0 0 0 1px rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
}

.button-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
    transition: left 0.6s;
}

.button-link:hover {
    background: linear-gradient(135deg, #f6f8fa 0%, #eaeef2 100%);
    border-color: #8c959f;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(27, 31, 35, 0.15), 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.button-link:hover::before {
    left: 100%;
}

.button-link:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(27, 31, 35, 0.12);
}

.button-link.active {
    background: linear-gradient(135deg, #0969da 0%, #0550ae 100%);
    border-color: #0550ae;
    color: white;
    box-shadow: 0 3px 10px rgba(9, 105, 218, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.button-link.active:hover {
    background: linear-gradient(135deg, #0860ca 0%, #044289 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(9, 105, 218, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

/* Toggle */
.toggle-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 25px auto;
    padding: 20px;
    background: rgba(255, 255, 255, 0.95); /* Ajout de transparence pour éviter le conflit */
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3); /* Ombre plus forte */
    max-width: 500px;
}

.toggle-text-left {
    font-size: 13px;
    color: #6c757d;
    margin-bottom: 12px;
    text-align: center;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #495057; /* Couleur explicite pour le texte du toggle */
}

.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    background: #dee2e6;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.toggle-switch::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

input[type="checkbox"] {
    display: none;
}

input[type="checkbox"]:checked + .toggle-switch {
    background: #28a745;
}

input[type="checkbox"]:checked + .toggle-switch::before {
    transform: translateX(20px);
}

/* Tableau */
.table-container {
    display: flex;
    justify-content: center;
    margin: 30px 0;
}

.table-wrapper {
    background: rgba(255, 255, 255, 0.98); /* Légère transparence */
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25); /* Ombre plus forte */
    width: 100%;
}

table {
    width: 100%;
    border-collapse: collapse;
    color: #333; /* Couleur de texte explicite pour tout le tableau */
    table-layout: fixed; /* Force les colonnes à garder leur taille */
}

th {
    background: #f8f9fa;
    color: #495057;
    padding: 16px 12px;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
    border-bottom: 2px solid #e9ecef;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Définition des largeurs fixes pour chaque colonne */
th:nth-child(1) { width: 5%; }   /* # */
th:nth-child(2) { width: 15%; }  /* Player */
th:nth-child(3) { width: 12%; }  /* All Story Missions */
th:nth-child(4) { width: 10%; }   /* Any% */
th:nth-child(5) { width: 10%; }   /* 100% */
th:nth-child(6) { width: 10%; }   /* NG+ */
th:nth-child(7) { width: 10%; }  /* No Mission Warps */
th:nth-child(8) { width: 10%; }  /* All Tasks NLR */
th:nth-child(9) { width: 12%; }  /* Sum Of All Cats */

td {
    padding: 14px 12px;
    text-align: center;
    font-size: 14px;
    border-bottom: 1px solid #f1f3f4;
    color: #333; /* Couleur de texte explicite pour les cellules */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

tbody tr {
    transition: background-color 0.1s ease;
}

tbody tr:hover {
    background: #f8f9fa;
}

tbody tr:nth-child(even) {
    background: #fdfdfd;
}

tbody tr:nth-child(even):hover {
    background: #f8f9fa;
}

/* Styles spéciaux pour les colonnes */
td:first-child {
    font-weight: 600;
    color: #6c757d;
}

td:nth-child(2) {
    font-weight: 600;
    color: #495057;
}

td:not(:first-child):not(:nth-child(2)) {
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    font-size: 13px;
    color: #333; /* Couleur explicite pour les cellules de données */
}

/* Responsive */
@media (max-width: 1024px) {
    .main-content {
        padding: 15px;
    }
    
    table {
        font-size: 13px;
    }
    
    th, td {
        padding: 12px 8px;
    }
}

@media (max-width: 768px) {
    .page-title {
        font-size: 1.8rem;
        margin: 20px 0;
    }

    .sort-buttons-container {
        gap: 8px;
        margin: 20px 0;
    }

    .button-link {
        min-width: 110px;
        padding: 12px 14px;
        font-size: 13px;
    }

    .toggle-container {
        margin: 20px 10px;
        padding: 16px;
    }

    .table-container {
        margin: 20px 0;
    }
    
    .table-wrapper {
        margin: 0 -5px;
        border-radius: 8px;
        overflow-x: auto;
        width: calc(100% + 10px);
    }

    table {
        min-width: 800px;
    }

    th, td {
        padding: 10px 6px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: 10px;
    }

    .sort-buttons-container {
        flex-direction: column;
        align-items: center;
        gap: 6px;
    }

    .button-link {
        width: 100%;
        max-width: 200px;
    }

    .page-title {
        font-size: 1.6rem;
    }
}

/* Animation de chargement */
.loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}