/* GLOBAL STYLES */
:root {
    --text-color: #09160f;
    --bg-color: #f1fbf6;
    --primary-color: #00CC60;
    --secondary-color: #84F4B8;
    --accent-color: #43F395;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --card-bg: #d6f5e3;
    --highlight: #00aa4f;
    --unique-bg: #e0e7b0;
    --unique-border: #b5ba72;
    --bg: #f1fbf6;           /* bg-color */
    --panel: #d6f5e3;        /* card-bg */
    --muted: #09160f;        /* text-color darker */
    --text: #09160f;         /* text-color */
    --accent: #43F395;       /* accent-color */
    --border: #84F4B8;       /* secondary-color */
    --ring: #00CC60;         /* primary-color */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    color : var(--text-color);
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Poppins', sans-serif;
}

/* ================================================================================================================================= */
/* ======================================================== HEADER STYLES ========================================================== */
/* ================================================================================================================================= */

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 10%;
    background-color: var(--bg-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    height: 80px;
}

header h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

nav ul {
    display: flex;
    list-style: none;
}

nav ul li {
    margin-left: 20px;
}

nav ul li a {
    text-decoration: none;
    color: var(--text-color);
}

nav ul li a:hover {
    color: var(--primary-color);
}

.active > a{
    color: var(--primary-color);
}


/* ================================================================================================================================= */
/* ======================================================== MAIN STYLES ============================================================ */
/* ================================================================================================================================= */

main {
    padding: 20px 10%;
    min-height: calc(100vh - 160px);
    background-color: rgb(250, 250, 250);
}

main h2 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 20px;
}

details
{
    transition: height 1s ease;
    overflow: hidden;
}

details[open] summary ~ * {
    animation: sweep .8s ease-in-out;
}
  
@keyframes sweep {
    0%    {opacity: 0; transform: translateX(-10px)}
    100%  {opacity: 1; transform: translateX(0)}
}

details[close] summary ~ * {
    animation: reverseSweep .8s ease-in-out;
}

@keyframes reverseSweep {
    0%    {opacity: 1; transform: translateX(0)}
    100%  {opacity: 0; transform: translateX(-10px)}
}


#qa article {
    margin-bottom: 10px;
    padding: 20px;
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    border-radius: 5px;
}

#qa article details {
    margin-bottom: 10px;
}

#qa article details summary {
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
}

#qa article p {
    font-size: 1rem;
    margin-bottom: 10px;
    margin-top: 15px;
}

#factions {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 10px;
}

#factions article {
    width: 300px;
    margin-bottom: 20px;
    padding: 40px;
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    border-radius: 5px;
}

#factions article div {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
}

#factions article div img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    margin-right: 20px;
}

#factions article div h3 {
    font-size: 1.5rem;
    font-weight: 600;
}

#factions article details {
    margin-bottom: 20px;
}

#factions article details summary {
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
}

#factions article p {
    font-size: 1rem;
    margin-bottom: 20px;
}

#factions article a {
    text-decoration: none;
    color: var(--primary-color);
    font-weight: 600;
}

#factions article a:hover {
    color: var(--secondary-color);
}

#artifacts {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
}

#artifacts table {
    width: 100%;
    margin-bottom: 20px;
    border-collapse: collapse;
}

#artifacts table th, #artifacts table td {
    padding: 10px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

#artifacts table th {
    background-color: var(--primary-color);
    color: white;
}

#artifacts table tr:nth-child(even) {
    background-color: rgba(0, 0, 0, 0.05);
}

#artifacts table tr:hover {
    background-color: rgba(0, 0, 0, 0.1);
    cursor: pointer;
}

#artifact {
    display: flex;
    flex-direction: row;
    justify-content: space-around;
    align-items: center;
    margin-bottom: 20px;
    padding: 20px;
}

#dnl #effectSection p.lead { margin: 0.5rem 0 0; color: var(--muted); }

#dnl #effectSection .card {
    background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
    backdrop-filter: blur(4px);
}

/* Controls */
#dnl #effectSection .controls { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; margin: 1rem 0; }
#dnl #effectSection .controls label { font-size: 0.9rem; color: var(--muted); }
#dnl #effectSection .controls input[type="search"], #dnl #effectSection .controls select {
    appearance: none; border: 1px solid var(--border);  color: var(--text);
    padding: .55rem .7rem; border-radius: 10px; outline: none; min-width: 12rem;
}
#dnl #effectSection .controls input[type="search"]:focus, #dnl #effectSection .controls select:focus { box-shadow: 0 0 0 3px rgba(14,165,233,.3); border-color: var(--ring); }

/* Table */
#dnl #effectSection .table-wrap { overflow: auto; border-radius: 12px; border: 1px solid var(--border); }
#dnl #effectSection table { width: 100%; border-collapse: collapse;  }

#dnl #effectSection caption { text-align: left; padding: .85rem 1rem; color: var(--muted); font-size: .95rem; }

#dnl #effectSection thead th { position: sticky; top: 0;  color: var(--text); text-align: left; font-weight: 600; }
#dnl #effectSection th, #dnl #effectSection td { padding: .8rem 1rem; border-bottom: 1px solid var(--border); vertical-align: top; }
#dnl #effectSection tbody tr:hover td { background: var(--secondary-color); }
#dnl #effectSection td em { color: var(--muted); font-style: normal; }

#dnl #effectSection .pill { display: inline-block; padding: .25rem .5rem; border: 1px solid var(--border); border-radius: 999px; font-size: .8rem; color: var(--text);  }
#dnl #effectSection .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

#dnl #effectSection tfoot td { color: var(--muted); font-size: .9rem; }

#dnl #gatcha button {
    background: var(--primary-color);
    border: none;
    padding: 15px 30px;
    font-size: 18px;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.3s;
  }
  #dnl #gatcha button:hover {
    background: var(--accent-color);
  }
  #dnl #gatcha .results {
    margin-top: 30px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
  }
  #dnl #gatcha .card {
    width: 220px;
    height: 120px;
    perspective: 1000px;
	padding: 7px;
  }
  #dnl #gatcha .card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transform-style: preserve-3d;
    transition: transform 0.6s;
  }
  #dnl #gatcha .flipped {
    transform: rotateY(180deg);
  }
  #dnl #gatcha .card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
  }
  #dnl #gatcha .card-front {
    background: #555;
    color: #fff;
    font-size: 20px;
  }
  #dnl #gatcha .card-back {
    transform: rotateY(180deg);
    padding: 10px;
    font-size: 16px;
  }
  #dnl #gatcha .common { background: #ccc; color: #000; }
  #dnl #gatcha .uncommon { background: #4caf50; }
  #dnl #gatcha .rare { background: #2196f3; }
  #dnl #gatcha .epic { background: #9c27b0; }
  #dnl #gatcha .legendary { background: #eba92e; }

  /* Glow animations */
  @keyframes glow-common {
    0% { box-shadow: 0 0 0px #fff; }
    50% { box-shadow: 0 0 20px #fff; }
    100% { box-shadow: 0 0 0px #fff; }
  }
  @keyframes glow-uncommon {
    0% { box-shadow: 0 0 0px #4caf50; }
    50% { box-shadow: 0 0 25px #4caf50; }
    100% { box-shadow: 0 0 0px #4caf50; }
  }
  @keyframes glow-rare {
    0% { box-shadow: 0 0 0px #2196f3; }
    50% { box-shadow: 0 0 25px #2196f3; }
    100% { box-shadow: 0 0 0px #2196f3; }
  }
  @keyframes glow-epic {
    0% { box-shadow: 0 0 0px #9c27b0; }
    50% { box-shadow: 0 0 30px #9c27b0; }
    100% { box-shadow: 0 0 0px #9c27b0; }
  }
  @keyframes glow-legendary {
    0% { box-shadow: 0 0 0px #eba92e; }
    50% { box-shadow: 0 0 30px #eba92e; }
    100% { box-shadow: 0 0 0px #eba92e; }
  }
  .glow-common { animation: glow-common 1s ease-in-out; }
  .glow-uncommon { animation: glow-uncommon 1s ease-in-out; }
  .glow-rare { animation: glow-rare 1s ease-in-out; }
  .glow-epic { animation: glow-epic 1s ease-in-out; }
  .glow-legendary { animation: glow-legendary 1s ease-in-out; }

  #capa .card {
      background: var(--panel);
      border: 1px solid var(--border);
      border-radius: 16px;
      padding: 1rem;
      box-shadow: 0 10px 30px var(--shadow-color);
    }

    /* Controls */
    #capa .controls { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1.75rem; align-items: center; margin: 1rem 0; }
    #capa .controls label { font-size: 0.9rem; color: var(--muted); display: grid; gap: .35rem; }
    #capa .controls input[type="search"], #capa .controls select, #capa .controls input[type="number"] {
      appearance: none; border: 1px solid var(--border); background: #fff; color: var(--text);
      padding: .55rem .7rem; border-radius: 10px; outline: none; min-width: 12rem;
    }
    #capa .controls input[type="search"]:focus, #capa .controls select:focus, #capa .controls input[type="number"]:focus { box-shadow: 0 0 0 3px rgba(0,204,96,.2); border-color: var(--ring); }
    #capa .controls .row { display: contents; }
    #capa .btn {
      appearance: none; border: 1px solid var(--ring); background: var(--primary-color); color: #fff; font-weight: 600;
      padding: .6rem .9rem; border-radius: 10px; cursor: pointer; box-shadow: 0 4px 12px rgba(0, 0, 0, .12);
    }

    /* Table */
    #capa .table-wrap { overflow: auto; border-radius: 12px; border: 1px solid var(--border); }
    #capa table { width: 100%; border-collapse: collapse; background: #fff; }

    #capa caption { text-align: left; padding: .85rem 1rem; color: var(--muted); font-size: .95rem; }

    #capa thead th { position: sticky; top: 0; background: var(--secondary-color); color: #05361f; text-align: left; font-weight: 700; }
    #capa th, #capa td { padding: .8rem 1rem; border-bottom: 1px solid var(--border); vertical-align: top; }
    #capa tbody tr:hover td { background: #e9fff5; }
    #capa td em { color: var(--muted); font-style: normal; }

    #capa .pill { display: inline-block; padding: .25rem .5rem; border: 1px solid var(--border); border-radius: 999px; font-size: .8rem; color: var(--text); background: #ffffff; }
    #capa .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

    #capa .tag { display: inline-block; padding: .15rem .45rem; margin: 0 .25rem .25rem 0; border-radius: 999px; font-size: .8rem; border: 1px solid var(--border); background: #fff; }


/* Container de la grille */
.domain-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
    padding: 30px 0;
}

/* Carte de Domaine - Style Glassmorphism */
.domain-card {
    background: rgba(25, 25, 25, 0.85);
    backdrop-filter: blur(10px);
    border-radius: 18px;
    padding: 25px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 15px 35px rgba(0,0,0,0.4);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.domain-card:hover {
    transform: translateY(-5px);
}

/* Couleurs selon le Type avec Glow */
.domain-card.complet { border-left: 5px solid #f1c40f; box-shadow: 0 0 15px rgba(241, 196, 15, 0.2); }
.domain-card.ouvert { border-left: 5px solid #e74c3c; box-shadow: 0 0 15px rgba(231, 76, 60, 0.2); }
.domain-card.incomplet { border-left: 5px solid #95a5a6; border-style: dashed; }

/* Header & Badge */
.domain-header {
    margin-bottom: 15px;
}

.domain-header h3 {
    margin: 0;
    font-size: 1.4rem;
    background: linear-gradient(to right, #fff, #bdc3c7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.domain-type {
    float: right;
    font-size: 0.7rem;
    font-weight: bold;
    padding: 4px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.complet .domain-type { background: #f1c40f; color: #000; }
.ouvert .domain-type { background: #e74c3c; color: #fff; }
.incomplet .domain-type { background: #95a5a6; color: #fff; }

/* Description (Italique et plus clair) */
.domain-desc {
    color: #bdc3c7;
    font-style: italic;
    font-size: 0.95rem;
    line-height: 1.4;
    margin-bottom: 20px;
}

/* Section Stats (Meilleur contraste) */
.domain-stats {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 12px;
    padding: 15px;
    border: 1px solid rgba(255,255,255,0.05);
}

.domain-stats p {
    margin: 8px 0;
    font-size: 0.9rem;
    color: #ecf0f1;
    display: flex;
}

.domain-stats p strong {
    color: #ecf0f1;
    padding-right: .5rem;
}

/* Règles */
.rules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.rule-card {
    background: #f9f9f9;
    padding: 15px;
    border-left: 4px solid #3498db;
    border-radius: 5px;
}

/* Icônes de statistiques */
.stat-icon { margin-right: 10px; font-size: 1.1rem; }
    
.maps {
    display: flex;
    flex-wrap: wrap;
    justify-content: left;
    gap: 50px;
}

.maps article {
    width: 300px;
    margin-bottom: 20px;
    padding: 40px;
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    border-radius: 5px;
}

.maps article summary {
    cursor: pointer;
    font-size: 1.5rem;
    font-weight: 600;
}

.maps article details {
    display: flex;
    flex-direction: row !important;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.maps article details img {
    width: 300px;
    height: 200px;
    object-fit: cover;
    margin-bottom: 20px;
}

.maps article details ul li {
    margin-bottom: 10px;
}

#sideBar {
    position: absolute;
    z-index: 10;
    background-color: blueviolet;
    padding: 25px 10px;
    top: 0;
    height: 100vh;
    width: 250px;
    
}

#sideBar #facts {
    display: flex;
    flex-direction: column !important;
    height: 90%;
    width: auto;
    overflow-y: scroll;
    overflow-x: hidden;
    padding-top: 20px;
    gap: 10px;
    scrollbar-width: 20px;
}

#sideBar #facts li {
    list-style: none;
}

#fig {
    margin: auto;
    padding: 20px;
    background-color: white;
}

#fig > div {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

#fig img {
    max-width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary-color);
}

#fig h3 {
    font-size: 1.8em;
    font-weight: bold;
    color: var(--highlight);
}

#fig .cards-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
}

#fig .card {
    background-color: var(--card-bg);
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 4px 8px var(--shadow-color);
    transition: transform 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 650px;
    width: 30%;
}

#fig .card.unique {
    background-color: var(--unique-bg);
    border: 2px solid var(--unique-border);
    box-shadow: 0 4px 8px rgba(181, 186, 114, 0.6);
}

#fig .card .top h4 {
    margin: 0;
    font-size: 1.5em;
    color: var(--highlight);
    font-weight: bold;
}

#fig .card .top p {
    margin: 5px 0;
    font-size: 1em;
    color: var(--text-color);
    opacity: 0.8;
}

#fig .card .middle {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-grow: 1;
}

#fig .card .middle .left {
    height: 250px;
    width: 250px;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 3px 6px var(--shadow-color);
}

#fig .card .middle .right {
    list-style: none;
    padding: 0;
}

#fig .card .middle .right li {
    background-color: var(--bg-color);
    margin: 8px 0;
    padding: 12px;
    border-radius: 8px;
    box-shadow: 0 2px 4px var(--shadow-color);
    font-size: 1em;
    font-weight: 500;
}

#fig .card .bottom {
    margin-top: 20px;
    font-size: 1em;
    line-height: 1.6;
    color: var(--text-color);
    opacity: 0.9;
    flex-shrink: 0;
}

       #timeline .timeline-container {
    border-left: 4px solid var(--primary-color);
    margin-left: 20px;
    padding: 20px 0;
}

#timeline .timeline-event {
    margin-bottom: 30px;
    position: relative;
    padding-left: 30px;
}

#timeline .timeline-event::before {
    content: '';
    position: absolute;
    left: -12px;
    top: 5px;
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    border-radius: 50%;
    border: 4px solid var(--bg-color);
}

#timeline .event-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}

#timeline .event-date {
    background: var(--primary-color);
    color: white;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
}

#timeline details {
    background: var(--card-bg);
    padding: 10px;
    border-radius: 8px;
    margin-top: 15px;
}

#timeline summary {
    cursor: pointer;
    font-weight: bold;
    color: var(--highlight);
}

#timeline .full-content {
    margin-top: 15px;
    line-height: 1.6;
    border-top: 1px solid var(--border);
    padding-top: 10px;
}


/* ================================================================================================================================= */
/* ======================================================== FOOTER STYLES ========================================================== */
/* ================================================================================================================================= */

footer {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px 10%;
    box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.1);
    height: 80px;
}