/* Styles globaux */
*, *::before, *::after {
    box-sizing: border-box; /* Garantit un calcul cohérent des dimensions */
}

html {
    scroll-padding-top: 200px; /* Décalage pour le scroll vers les ancres */
}

/* ====== PAGE PRINCIPALE - SÉLECTION DES CARTES ====== */

/* Container principal */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    padding-bottom: 80px;
    box-sizing: border-box;
}

/* En-tête de la page */
.page-header {
    text-align: center;
    padding: 20px;
    margin-bottom: 30px;
    background: white;
    border-bottom: 2px solid black;
}

.header-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.title-row {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-title {
    font-size: 36px;
    color: #333;
    margin: 0;
}

.profile-picture {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
}

.github-link {
    color: blue;
    text-decoration: none;
    font-size: 21px;
    transition: color 0.3s ease;
}

.github-link:hover {
    color: #45a049;
    text-decoration: underline;
}

/* Barre de navigation sticky */
.sticky-nav-container {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 100;
    width: 100%;
    background: #f5f5f5;
    padding: 10px;
    margin-bottom: 20px;
    border-radius: 15px;
}

/* Navigation des extensions */
.expansions-nav {
    position: relative;
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 15px;
    background: white;
    border-radius: 15px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.expansion-link {
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 20px;
    transition: all 0.3s ease;
    font-weight: bold;
}

/* Couleurs spécifiques pour chaque extension */
.expansion-link[data-expansion="A3"] {
    color: #0e46ae;
    border: 2px solid #0e46ae;
}

.expansion-link[data-expansion="A2b"] {
    color: #f6cce3;
    border: 2px solid #f6cce3;
}

.expansion-link[data-expansion="A2a"] {
    color: #fcb038;
    border: 2px solid #fcb038;
}

.expansion-link[data-expansion="A2"] {
    color: #a4afbd;
    border: 2px solid #a4afbd;
}

.expansion-link[data-expansion="A1a"] {
    color: #49dcb1;
    border: 2px solid #49dcb1;
}

.expansion-link[data-expansion="A1"] {
    color: #8431d1;
    border: 2px solid #8431d1;
}

.expansion-link:hover {
    background-color: currentColor;
    color: white;
}

/* Barre de recherche */
.search-container {
    position: relative;
    background: white;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    z-index: 100;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 40px;
    width: 100%;
    border-radius: 15px;
    box-sizing: border-box;
}

.search-input {
    width: 100%;
    max-width: 500px;
    padding: 10px 15px;
    font-size: 16px;
    border: 2px solid black;
    border-radius: 25px;
    outline: none;
    margin: 0;
}

.id-search-group {
    display: flex;
    gap: 20px;
    max-width: 400px;
    width: 100%;
    justify-content: flex-start;
    align-items: center;
    margin-left: auto;
}

.expansion-select {
    padding: 10px 15px;
    font-size: 16px;
    border: 2px solid black;
    border-radius: 25px;
    outline: none;
    background-color: white;
    cursor: pointer;
    flex: 1;
    min-width: 150px;
}

.number-input {
    width: 100px;
    padding: 10px 15px;
    font-size: 16px;
    border: 2px solid black;
    border-radius: 25px;
    outline: none;
}

/* Sections d'extension */
.expansion-section h2 {
    margin: 0;
    padding: 0;
    text-align: left;
    flex-grow: 1;
}

.expansion-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin: 20px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid black;
    justify-content: space-between;
}

.expansion-logo {
    width: 100px;
    height: 100px;
    object-fit: contain;
}

.select-all-btn {
    padding: 12px 24px;
    font-size: 16px;
    color: white;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-left: auto;
}

/* Grille de cartes */
.cards-grid {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

#cards-grid {
    display: flex;
    flex-direction: column;
    gap: 50px;
}

.card-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
    border-radius: 10px;
    background: #f5f5f5;
    width: 100%;
    max-width: 200px;
    margin: 0 auto;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.card-container.selected {
    background: #90EE90;
}

.card-container:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.card-container.hidden {
    display: none;
}

.card-image {
    width: 150px;
    height: 200px;
    object-fit: contain;
    margin: 10px 0;
    position: relative;
}

.card-number {
    font-weight: bold;
    margin-bottom: 5px;
}

/* Tooltip */
.card-tooltip {
    position: fixed;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 15px;
    border-radius: 8px;
    font-size: 14px;
    max-width: 300px;
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s, transform 0.2s;
    transform: translateY(10px);
}

.card-tooltip.visible {
    opacity: 1;
    transform: translateY(0);
}

.tooltip-title {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 10px;
    color: gold;
}

.tooltip-info {
    margin: 5px 0;
    display: flex;
    justify-content: space-between;
}

.tooltip-label {
    color: white;
    margin-right: 10px;
}

.tooltip-section {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #444;
}

/* Boutons d'action */
.action-buttons {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 99;
}

.calculate-btn {
    position: static;
    transform: none;
    padding: 15px 30px;
    font-size: 16px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
    z-index: 99;
    transition: all 0.3s ease;
}

.calculate-btn:hover {
    background: #45a049;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.reset-btn {
    padding: 15px 30px;
    font-size: 16px;
    background: #ff4444;
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

.reset-btn:hover {
    background: #cc0000;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    transform: translateY(-2px);
}

/* Style pour la zone de chargement de fichier */
.upload-container {
    margin: 15px 0;
    padding: 10px;
    background: #f5f5f5;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.upload-container label {
    font-weight: bold;
    color: #333;
}

.upload-container input[type="file"] {
    padding: 8px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
}

.upload-container input[type="file"]:hover {
    background: #f8f8f8;
}

/* ====== PAGE DE RÉSULTATS ====== */

/* En-tête des statistiques */
.stats-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid #eee;
}

.main-header h1 {
    margin: 0;
    padding: 0;
    border: none;
}

/* Statistiques */
.stats-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.total-ratio {
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

.stats-section {
    background: #f5f5f5;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 8px;
}

.ratio {
    color: #666;
    font-weight: normal;
}

/* Barres de progression */
.progress-container {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 8px 0;
}

.progress-bar {
    flex-grow: 1;
    height: 12px;
    background: #eee;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    width: 0;
    transition: width 0.5s ease;
    background: #4CAF50;
}

.progress-text {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    min-width: 160px;
    text-align: right;
}

/* Statistiques par rareté */
.rarity-stats {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
}

.rarity-label {
    min-width: 100px;
    font-weight: bold;
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
    text-align: left;
    background: rgba(0, 0, 0, 0.1);
}

.rarity-icon {
    width: 16px;
    height: 16px;
    vertical-align: middle;
    margin: 0 1px;
    filter: brightness(1.2);
}

/* Scores des boosters */
.pack-results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.pack-result {
    display: flex;
    align-items: center;
    gap: 15px;
    background: #f8f8f8;
    padding: 20px;
    border-radius: 8px;
}

.pack-illustration {
    width: 60px;
    height: 60px;
    object-fit: contain;
}

.pack-score {
    font-size: 20px;
    font-weight: bold;
}
