/* ====================================================
   TABLE DES MATIÈRES
   ====================================================
   1. RESET & BASE
   2. VARIABLES
   3. LAYOUT & GRILLE
   4. HEADER & NAVIGATION
   5. CONTENU PRINCIPAL
   6. COMPOSANTS
   7. FOOTER
   8. THÈMES (DARK/LIGHT)
   9. RESPONSIVE
   10. UTILITAIRES & ANIMATIONS
   ==================================================== */

/* ====================================================
   1. RESET & BASE
   ==================================================== */
body {
    font-family: 'Montserrat', Helvetica, Arial, Lucida, sans-serif;
    margin: 0;
    padding: 0;
    color: white;
    background-size: cover;
    line-height: 1.6;
    font-size: 18px;
}

/* ====================================================
   2. VARIABLES
   ==================================================== */
:root {
    /* Couleurs principales */
    --primary-color: #005eda;
    --secondary-color: #f3004e;
    --dark-bg: #00151f;
    --darker-bg: #222;
    --light-bg: #fff;
    --light-bg-transparent: rgba(255, 255, 255, 0.2);
    --light-text: #fff;
    --dark-text: #000;
    
    /* Espacements */
    --spacing-xs: 5px;
    --spacing-sm: 10px;
    --spacing-md: 20px;
    --spacing-lg: 30px;
    --spacing-xl: 40px;
    
    /* Bordures */
    --border-radius-sm: 5px;
    --border-radius-md: 10px;
    --border-radius-lg: 20px;
    --border-radius-xl: 30px;
    
    /* Transitions */
    --transition-speed: 0.3s;
}

/* ====================================================
   3. LAYOUT & GRILLE
   ==================================================== */
.container {
    width: 80%;
    max-width: 1200px;
    margin: auto;
    text-align: center;
}

/* Sections principales */
.main-content {
    padding-top: var(--spacing-xl);
    padding-bottom: var(--spacing-xl);
    background: url('img/pattern.png') repeat-x, url('img/color.png') no-repeat center center/cover;
    background-attachment: fixed;
    background-position: 0 0, center center;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Landing page */
.landing-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.landing-page {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: url('img/pattern.png') repeat-x, url('img/color.png') no-repeat center center/cover;
    background-attachment: fixed;
    background-position: 0 0, center center;
}

.landing-logo {
    max-width: 400px;
    width: 100%;
    height: auto;
}

/* ====================================================
   4. HEADER & NAVIGATION
   ==================================================== */
/* Barre de navigation fixe */
.top-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: black;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 1000;
    box-sizing: border-box;
}

.top-logo {
    display: block;
}

/* Navigation principale */
.top-bar nav {
    display: flex;
    justify-content: center;
    flex-grow: 1;
}

.top-bar nav ul {
    list-style: none;
    display: flex;
    gap: var(--spacing-lg);
    margin: 0;
    padding: 0;
}

.top-bar nav ul li {
    display: flex;
    align-items: center;
}

.top-bar nav ul li a {
    text-decoration: none;
    color: var(--light-text);
    font-size: 18px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: bold;
    line-height: 1;
}

.top-bar nav ul li a i {
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

/* Bouton de jeu principal */
.play-now-button {
    background: var(--secondary-color);
    color: var(--light-text);
    font-size: 18px;
    font-weight: bold;
    padding: var(--spacing-sm) var(--spacing-md);
    text-decoration: none;
    border-radius: var(--border-radius-md);
    transition: background var(--transition-speed);
    border: none;
}

/* Header principal */
header {
    position: relative;
    padding: var(--spacing-xl) 0 var(--spacing-md) 0;
    background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.3)), 
                url('img/bg.jpg') no-repeat center center/cover;
    background-size: 100%;
    background-attachment: fixed;
    text-align: center;
    border-bottom: 8px solid var(--secondary-color);
    padding-top: 120px;
    transition: background-size 0.1s ease-out;
}

header p {
    color: var(--light-text);
    font-size: 28px;
}

header h1 {
    margin: 0;
}

/* ====================================================
   5. CONTENU PRINCIPAL
   ==================================================== */
/* Typographie */
h1 {
    color: var(--light-text);
    position: relative;
    z-index: 1;
    font-size: 54px;
    text-transform: uppercase;
}

.h1-red {
    color: var(--secondary-color);
    font-family: 'Roboto', sans-serif;
}

h2 {
    color: var(--light-text);
    position: relative;
    z-index: 1;
    font-size: 38px;
    text-align: center;
    margin: var(--spacing-md) 0 var(--spacing-md) 0;
}

h3 {
    color: var(--secondary-color);
    position: relative;
    z-index: 1;
    font-size: 34px;
    margin: 0;
}

h4 {
    color: var(--primary-color);
    position: relative;
    z-index: 1;
    font-size: 26px;
    margin: 0;
    padding: var(--spacing-md) 0 0 0;
}

/* Conteneurs de fonctionnalités */
.feature-container {
    position: relative;
    width: 60%;
    max-width: 800px;
    text-align: left;
    background: var(--light-bg-transparent);
    padding: var(--spacing-md);
    border-radius: var(--border-radius-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.feature-content {
    position: relative;
    width: 100%;
}

.feature-image,
.rules-image {
    width: 100%;
    border-radius: var(--border-radius-md);
    display: block;
    margin-bottom: var(--spacing-md);
}

.feature-text {
    margin-top: var(--spacing-md);
    color: var(--dark-text);
    padding: 15px;
    background: var(--light-bg);
    border-radius: var(--border-radius-md);
}

.feature-text:first-of-type {
    margin-top: 0;
}

/* Éléments dépliables */
.toggle-feature {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    margin: 0;
}

.toggle-arrow {
    width: 19px;
    height: 11px;
    transition: transform var(--transition-speed) ease-in-out;
}

.collapsible-content {
    display: none;
    margin-top: var(--spacing-sm);
    transition: all var(--transition-speed) ease-in-out;
}

.feature-text.active .toggle-arrow {
    transform: rotate(180deg);
}

/* ====================================================
   6. COMPOSANTS
   ==================================================== */
/* Boutons et liens */
.feature-navigation {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-top: var(--spacing-md);
}

.feature-button,
.block-button {
    width: 48%;
    background: var(--primary-color);
    color: var(--light-text);
    font-size: 18px;
    padding: 15px;
    border: none;
    cursor: pointer;
    text-transform: uppercase;
    border-radius: var(--border-radius-md);
    text-align: center;
    text-decoration: none;
    transition: background var(--transition-speed);
    display: inline-block;
}

.feature-button:hover {
    background: #0045a5;
}

.btn {
    display: inline-block;
    margin: var(--spacing-sm);
    padding: 15px 60px;
    color: var(--light-text);
    text-decoration: none;
    border-radius: var(--border-radius-md);
    font-weight: bold;
}

.btn.ios,
.btn.android {
    background: var(--primary-color);
}

.btn.online {
    background: var(--secondary-color);
}

/* Conteneurs spéciaux */
.button-container {
    background: #f0f0f0;
    border-radius: var(--border-radius-md);
    padding: var(--spacing-md);
    text-align: center;
    margin-top: var(--spacing-md);
}

.store-buttons {
    margin-top: var(--spacing-md);
    position: relative;
    z-index: 1;
}

/* Images et icônes */
.logo {
    position: relative;
    max-width: 450px;
    margin-bottom: var(--spacing-md);
    z-index: 1;
}

.store-icon {
    width: 150px;
    height: 150px;
    border-radius: var(--border-radius-lg);
    border: solid 6px white;
    margin-top: var(--spacing-xl);
}

.rule-image {
    width: 100%; 
    height: auto; 
    border-radius: var(--border-radius-md); 
    display: block; 
    margin: var(--spacing-md) 0 0 0; 
}

.lang-top {
    width: 20px; 
    margin: 0 var(--spacing-xs);
}

/* Ensemble de cartes */
.card-set {
    display: flex;
    justify-content: left;
    align-items: center;
    flex-wrap: wrap;
    max-width: 100%;
    padding-bottom: var(--spacing-sm);
}

.card-set img {
    width: 70px;
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius-sm);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin: var(--spacing-xs);
}

/* Tapis de cartes */
.carpet-active {
    background: url("/img/cards/carpet.jpg") no-repeat center center;
    background-size: cover;
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-xl);
    box-shadow: inset 0 0 0 10px rgba(255,255,255,0.2);
    text-align: center;
    margin: var(--spacing-md) 0;
    position: relative;
    z-index: 1;
}

.carpet-active::after {
    content: "";
    background: url("/img/logo.png") no-repeat center center;
    background-size: contain;
    opacity: 0.2;
    position: absolute;
    top: 50%;
    left: 50%;
    width: 200px;
    height: 50px;
    transform: translate(-50%, -50%);
    z-index: -1;
}

.carpet-active img {
    position: relative;
    z-index: 2;
}

.carpet-active .card-set {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: var(--spacing-xs);
}

/* iFrame et animations téléphone */
.iframe-container {
    position: relative;
    width: 1160px;
    height: 640px;
    margin: auto;
    z-index: 1;
}

.custom-iframe {
    width: 100%;
    height: 100%;
    border: none;
    position: relative;
    z-index: 1;
}

.phone-animation {
    position: relative;
    width: 60vw;
    max-width: 750px;
    height: 370px;
    aspect-ratio: 16 / 9;
    margin: auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

.phone-frame {
    position: absolute;
    opacity: 0;
    width: 100%;
    transform-origin: center center;
}

/* Formulaire de contact */
.contact-textarea {
    width: 100%; 
    padding: 15px; 
    box-sizing: border-box;
    border-radius: var(--border-radius-sm);
    border: none;
    background-color: #eee;
    font-size: 16px;
}

.contact-label {
    display: block;
}

/* Styles pour le tableau de classement */

/* Titre de zone */
.ranking-area-title {
  padding: 10px;
  color: #fff;
  font-weight: bold;
  text-align: center;
  font-size: 1.2em;
  border-top-left-radius: 5px;
  border-top-right-radius: 5px;
}

/* Styles spécifiques pour chaque zone */
.promotion-area-title {
  background: #7bb82d;
}

.holding-area-title {
  background: #ea5f28;
}

.relegation-area-title {
  background: #d31105;
}

/* Conteneur de tableau pour permettre le défilement sur mobile */
.ranking-table-container {
  width: 100%;
  overflow-x: auto;
}

/* Tableau de ranking */
.ranking-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 30px;
  table-layout: auto; /* Auto au lieu de fixed pour le responsive */
}

.ranking-table th,
.ranking-table td {
  border-bottom: 1px solid #ddd;
  padding: 8px;
  text-align: center;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.ranking-table th {
  background-color: #f2f2f2;
  font-weight: bold;
}

/* Définition des largeurs de colonnes */
.rank-col {
  width: 60px;
}

.avatar-col {
  width: 70px;
}

.flag-col {
  width: 50px;
}

.name-col {
  width: 120px;
}

.level-col {
  width: 180px; /* Colonne agrandie davantage */
}

.points-col {
  width: 180px; /* Colonne agrandie davantage */
}

.graph-col {
  width: 70px;
}

/* Images */
.avatar {
  border-radius: 10px;
  width: 50px;
  height: auto;
}

.flag {
  width: 30px;
  height: auto;
}

/* Boîtes de niveau et de points */
.level-box {
  background: #ea5f28;
  border-radius: 10px;
  color: #fff;
  font-weight: bold;
  text-align: center;
  padding: 5px;
  display: inline-block;
  width: 100%;
}

.points-box {
  background: #45bfe6;
  border-radius: 10px;
  color: #fff;
  font-weight: bold;
  text-align: center;
  padding: 5px;
  display: inline-block;
  width: 100%;
}

/* Style pour le bouton de graph */
.graph-toggle-btn {
  cursor: pointer;
  padding: 4px 8px;
  font-size: 16px;
  background-color: #f0f0f0;
  border: 1px solid #ccc;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.graph-toggle-btn:hover {
  background-color: #e0e0e0;
}

.graph-row {
  display: none;
}

.graph-row td {
  padding: 0 !important;
  border: none !important;
  background-color: transparent !important;
}

/* Style pour le conteneur de graphique */
.graph-container {
  width: 100%;
  height: 270px;
  position: relative;
  border-radius: 4px;
  background-color: #fff;
  margin: 10px 0;
  padding: 10px;
  box-sizing: border-box;
}

/* Media queries pour le responsive */
@media screen and (max-width: 992px) {
  .ranking-table {
    width: 100%;
  }
  
  /* Ajuster les largeurs des colonnes */
  .level-col, .points-col {
    width: 120px;
  }
}

@media screen and (max-width: 768px) {
  .ranking-table th,
  .ranking-table td {
    padding: 5px;
  }
  
  .avatar {
    width: 40px;
  }
  
  .flag {
    width: 25px;
  }
  
  .level-box, .points-box {
    padding: 3px;
    font-size: 0.9em;
  }
  
  .graph-container {
    height: 200px;
  }
  
  /* Ajuster les largeurs des colonnes */
  .rank-col {
    width: 50px;
  }
  
  .avatar-col {
    width: 60px;
  }
  
  .flag-col {
    width: 40px;
  }
  
  .name-col {
    width: 100px;
  }
  
  .level-col, .points-col {
    width: 110px;
  }
  
  .graph-col {
    width: 60px;
  }
}

@media screen and (max-width: 576px) {
  /* Masquer certaines colonnes sur mobile */
  .flag-col, .avatar-col {
    display: none;
  }
  
  .ranking-area-title {
    font-size: 1em;
  }
  
  .level-box, .points-box {
    font-size: 0.8em;
  }
  
  .ranking-table th,
  .ranking-table td {
    font-size: 0.9em;
    padding: 3px;
  }
  
  .graph-container {
    height: 180px;
  }
  
  /* Agrandir les colonnes LEVEL et LEAGUE PTS sur mobile */
  .level-col, .points-col {
    width: 130px;
  }
}

/* Styles pour l'impression */
@media print {
  .graph-toggle-btn, 
  .graph-row {
    display: none !important;
  }
  
  .ranking-table {
    page-break-inside: avoid;
  }
}
/* ====================================================
   7. FOOTER
   ==================================================== */
footer {
    padding-bottom: var(--spacing-sm);
    background: var(--dark-bg);
    text-align: center;
}

.footer-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md);
    background-color: var(--darker-bg);
    color: var(--light-text);
    border-top: 8px solid var(--primary-color);
}

.footer-game-icon {
    width: 120px;
    height: 120px;
    border-radius: var(--border-radius-lg);
}

.footer-top-middle {
    flex: 1;
    text-align: center;
    padding: 0 60px;
    font-size: 14px;
    line-height: 1.6;
}

.footer-top-right {
    display: flex;
    gap: var(--spacing-sm);
}

.store-button {
    width: 120px;
    height: auto;
    display: block;
}

.footer-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 80%;
    max-width: 1200px;
    margin: auto;
}

.footer-left {
    color: var(--light-text);
    font-weight: bold;
}

.footer-right {
    display: flex;
    gap: 15px;
}

.footer-right a {
    color: var(--light-text);
    text-decoration: none;
    font-weight: bold;
}

.landing-footer {
    background-color: var(--dark-bg);
    color: var(--light-text);
    text-align: center;
    padding: var(--spacing-sm);
}

.language-flags a {
    text-decoration: none;
}

/* ====================================================
   8. THÈMES (DARK/LIGHT)
   ==================================================== */
/* Sélecteur de thème */
.theme-switcher {
    position: absolute;
    top: var(--spacing-sm);
    right: var(--spacing-sm);
    z-index: 100;
}

.theme-icon {
    display: inline-block;
    border-radius: 50%;
    padding: var(--spacing-xs);
    border: 2px solid transparent;
    cursor: pointer;
    margin-left: var(--spacing-xs);
}

.theme-icon.active {
    border-color: #ccc;
}

.theme-icon img {
    width: 20px;
    height: 20px;
    display: block;
}

/* Thème dark (défaut) */
body.dark-theme .main-content {
    background: url('img/pattern.png') repeat-x, url('img/color.png') no-repeat center center/cover;
    background-attachment: fixed;
    background-position: 0 0, center center;
}

body.dark-theme h2 {
    color: var(--light-text);
}

/* Thème light */
body.light-theme .main-content {
    background: url('img/pattern.png') repeat-x;
    background-attachment: fixed;
    background-position: 0 0, center center;
}

body.light-theme .toggle-feature {
    border: 1px solid #ccc;
    padding: var(--spacing-md);
    border-radius: var(--border-radius-lg);
}

body.light-theme h2 {
    color: var(--primary-color);
    border-bottom: solid 4px var(--primary-color);
}

body.light-theme .collapsible-content {
    padding: var(--spacing-md);
    border-radius: var(--border-radius-lg);
    border: 1px solid #ccc;
}

/* ====================================================
   9. RESPONSIVE
   ==================================================== */
@media (max-width: 768px) {
    /* Navigation mobile */
    .top-bar {
        padding: var(--spacing-sm) 15px;
    }

    .top-logo {
        max-width: 140px;
    }

    .top-bar nav ul {
        display: none;
        flex-direction: column;
        background: rgba(0, 0, 0, 0.9);
        position: absolute;
        top: 60px;
        left: 0;
        width: 100%;
        padding: var(--spacing-sm) 0;
        text-align: center;
    }

    .top-bar nav ul li {
        margin: var(--spacing-sm) 0;
    }

    .menu-toggle {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 30px;
        height: 22px;
        cursor: pointer;
    }

    .menu-toggle span {
        display: block;
        height: 3px;
        width: 100%;
        background: var(--light-text);
        transition: var(--transition-speed);
    }

    .top-bar nav ul.active {
        display: flex;
    }
    
    /* Disposition pour mobile */
    .feature-container {
        width: 90%;
    }
    
    .phone-animation {
        width: 80vw;
        max-width: 500px;
    }
    
    .card-set img {
        width: 45px;
    }
}

/* ====================================================
   10. UTILITAIRES & ANIMATIONS
   ==================================================== */
/* Animation des téléphones */
.phone-frame:nth-child(1) { 
    animation: phone-1 var(--transition-speed) ease-in-out;
    animation-delay: 0s;
    transform: scale(0.4);
}

.phone-frame:nth-child(2) { 
    animation: phone-2 var(--transition-speed) ease-in-out;
    animation-delay: var(--transition-speed);
    transform: scale(0.6);
}

.phone-frame:nth-child(3) { 
    animation: phone-3 var(--transition-speed) ease-in-out;
    animation-delay: calc(var(--transition-speed) * 2);
    transform: scale(0.8);
}

.phone-frame:nth-child(4) { 
    animation: phone-4 var(--transition-speed) ease-in-out forwards;
    animation-delay: calc(var(--transition-speed) * 3);
    transform: scale(1);
}

@keyframes phone-1 {
    0% { opacity: 0; }
    100% { opacity: 0.25; }
}

@keyframes phone-2 {
    0% { opacity: 0; }
    100% { opacity: 0.5; }
}

@keyframes phone-3 {
    0% { opacity: 0; }
    100% { opacity: 0.75; }
}

@keyframes phone-4 {
    0% { opacity: 0; }
    100% { opacity: 1; }
}