/* Variables couleur */
body {
    --bg-light: #f8f8f8;
    --text-light: #333;
    --bg-dark: #121212;
    --text-dark: #eee;
    --accent-color: #3498db;
    --accent-hover: #2980b9;
    --error-color: #E40;
    --card-bg: #ffffff;
    --highlight-bg: #ffeaa7;
    font-size: 14px;
}

/* @media (prefers-color-scheme: dark) { */
    body.dark {
        --bg-light: #121212;
        --text-light: #eee;
        --card-bg: #1f1f1f;
    }
    body.dark .darkInvert { filter: invert(100%);}
/*}*/

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', sans-serif;
    background: var(--bg-light);
    color: var(--text-light);
    line-height: 1.6;
}

/* Header */
header {
    background: var(--card-bg);
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.logo {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--accent-color);
}

.social-links a {
    margin-left: 15px;
    color: var(--accent-color);
    text-decoration: none;
    font-size: 1rem;
}

.social-links a:hover {
    color: var(--accent-hover);
}
/* Sélecteurs flexibles qui s'ajustent en fonction de l'espace */
.selectors {
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
    margin: 30px 0;
    flex-wrap: wrap; /* Permet aux éléments de revenir à la ligne si nécessaire */
}

.popup .selectors .long { width:65%;}
.popup .selectors .short { width:calc(35% - 4px - 20px) ;}


.selectors select[disabled], .selectors input[disabled], .popup input[disabled], .SearchResult input[disabled]{
    color: var(--text-light);
    border-color: var(---text-light);
    opacity:0.6;
}

/* Sélecteurs individuels */
.selectors select, .selectors input, .popup input, .SearchResult input{
    transition: 0.3s;
    padding: 10px;
    font-size: 1rem;
    border: 1px solid var(--accent-color);
    border-radius: 8px;
    background: var(--card-bg);
    color: var(--accent-color);
    min-width: 50px;  /* Ajoute une largeur minimale */
    max-width: 250px;  /* Fixe une largeur maximale */
    font-weight:bold;
}
#searchbox {
    width: calc(100% - 52px - 1rem);
    margin-right:1rem;
}


.selectors button {
    background: var(--accent-color);
    color: white;
    cursor: pointer;
}

.selectors button:hover {
    background: var(--accent-hover);
}


/* Verset affiché */
.verset-display {
    text-align: justify;
    padding: 1em;
}

.verset-display h1 {
    font-size: 1.3rem;
    margin-bottom: 20px;
    color: var(--accent-color);
}

.verset-display p {
    font-size: 1.2rem;
}

/* Themes section */
.themes-section {
    margin-top: 50px;
    padding: 0 20px 50px;
}

.themes-title {
    font-size: 1.1rem;
    color: var(--accent-color);
    text-align: center;
    margin-bottom: 30px;
}
.themes-grid {
    column-count: 1;
    column-gap: 20px; /* Espace entre colonnes */
    margin: 40px 0;
}

/* Chaque carte */
.theme {
    display: inline-block; /* Très important pour que column fonctionne */
    width: 100%; /* Chaque carte occupe toute la largeur de sa colonne */
    margin: 0 0 20px; /* Espace sous chaque carte */
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 20px;
    box-sizing: border-box;
    transition: transform 0.3s, background 0.3s;
    break-inside: avoid; /* Évite que la carte soit coupée entre deux colonnes */
    text-align:justify;
}
.theme, #SearchResult{
    scrollbar-width: thin; /* Firefox */
    scrollbar-color: var(--accent-color) var(--bg-light); /* Firefox */
}

/* Chrome, Edge, Safari */
.theme::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.theme::-webkit-scrollbar-track {
    background: var(--bg-light);
    border-radius: 4px;
}

.theme::-webkit-scrollbar-thumb {
    background-color: var(--accent-color);
    border-radius: 4px;
    border: 2px solid var(--bg-light);
}

.theme::-webkit-scrollbar-thumb:hover {
    background-color: var(--accent-hover);
}

@media (min-width: 1100px) {
    .themes-grid {
        column-count: 2;
    }
    .theme{
      }
}

@media (min-width: 1500px) {
    .themes-grid {
        column-count: 3;
    }
}

.theme {
    background: var(--card-bg);
    padding: 20px 20px 30px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.theme h4{
    font-size: 1rem;
    color: var(--accent-color);
    border-top: 1px solid;
}

.theme h3, .popup h2, .bigPopup h2 {
    font-size: 1.1rem;
    color: var(--accent-color);
    margin-bottom: 10px;
    padding-left: 2em;
}

.theme p {
    font-size: 1.05rem;
    line-height: 1.6;
}

.theme a, .verset-display a , .SearchResult a {
    color: var(--accent-color);
    text-decoration-line: underline;
    text-decoration-thickness: 3px;
    transition: color 0.3s;
}

.theme a:hover {
    color: var(--accent-hover);
}

.theme p.islam::before, .theme p.Bible::before, .theme p.Vatican::before {
  content: "";
  float:left;
  width: 1em;
  height: 1em;
  border-radius: 50%;
  margin-top: 0.2em;
  margin-right:0.2em;
}

.theme p.islam::before {
  background: #094;
  border-radius: 50%;}
.theme p.Bible::before {
  background: #47A;
}
.theme p.Vatican::before {
  background: #F90;
}
/*
.theme p {text-indent: 2em; }
.theme p::first-letter {
  initial-letter: 2;
  font-weight: bold;
  color: var(--accent-color);
}*/

mark {
    background-color: var(--highlight-bg);
    padding: 0 4px;
    border-radius: 5px;
}

/* Animation */
.fade-in.show {
    opacity: 1;
    transform: translateY(0);
}

footer {
  background-color: var(--bg-light);
  color: var(--text-light);
  padding: 40px 20px;
  font-size: 0.9rem;
  line-height: 1.6;
}

/* Titre dans le footer */
footer h2, footer h3 {
  margin-top: 0;
  font-size: 1.2rem;
  color: var(--accent-color);
}

/* Pour le changelog */
footer ul {
  list-style-type: disc;
  padding-left: 20px;
}

/* Chaque élément du changelog */
footer ul li {
  margin-bottom: 0px;
  padding-left: 5px;
}

/* Si tu veux aussi des liens dans le footer */
footer a {
  color: var(--accent-color);
  text-decoration: underline;
  transition: color 0.3s;
}

footer a:hover {
  color: var(--accent-hover);
}

/* Séparation visuelle si beaucoup de textes */
footer section {
  margin-bottom: 30px;
}

footer section.footer-notes {
    flex:2;
}
footer section.changelog {
    flex:1;
    box-sizing: border-box;
    overflow:hidden;
    font-size:smaller;
    position:relative;
    z-index:2;
}

/* Pour un peu d'alignement "grid" si tu as plusieurs sections */
footer .footer-grid {
    display:flex;
    align-items: flex-start; /* Important pour ne pas étirer la hauteur */
    gap: 1rem;
}


.checkbox-group label { width: 70%; }
.checkbox-group {
  padding-left: 10px;
  padding-right: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}
.checkbox-group.multiline {
  flex-wrap: wrap; /* Permet aux éléments de revenir à la ligne si nécessaire */
}

/* Masquer la vraie checkbox */
.checkbox-group input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid var(--accent-color);
  border-radius: 6px;
  background-color: var(--bg-light);
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

/* Style quand cochée */
.checkbox-group input[type="checkbox"]:checked {
  background-color: var(--accent-color);
  border-color: var(--accent-color);
}

/* Petit check mark */
.checkbox-group input[type="checkbox"]::after {
  content: "";
  position: absolute;
  display: none;
  top: 4px;
  left: 6px;
  width: 5px;
  height: 10px;
  border: solid var(--card-bg); /* Blanc par défaut */
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* Montrer le check mark au clic */
.checkbox-group input[type="checkbox"]:checked::after {
  display: block;
}

/* Label ou texte dans ton span */
.checkbox-group span {
  font-size: 1rem;
  color: var(--text-light);
}

ul.Amis{
    column-count: 3;
    column-gap: 1em; /* Espace entre colonnes */
    margin: 1em;
}

.Amis li {
    display: inline-block; /* Très important pour que column fonctionne */
    width: 100%; /* Chaque carte occupe toute la largeur de sa colonne */
    margin-bottom: 10px; /* Espace sous chaque carte */
    border: 1px solid var(--accent-color);
    border-radius: 12px;
    padding: 10px;
    box-sizing: border-box;
    transition: transform 0.3s, background 0.3s;
    break-inside: avoid; /* Évite que la carte soit coupée entre deux colonnes */
    text-align:justify;
    min-height: 6em;
}
.hints li{
  display: flex;
  justify-content: space-between;
  align-items: center;
  column-gap: 1em; /* Espace entre colonnes */
  padding: 1em;
}
.Amis li.cols{
  display: grid;
  grid-template-columns: 1fr 3em 3em;
  align-items: center;
}
.Amis li.cols .cell{ display:block; width:100%;}

.hints li button {
  background-color: var(--accent-color);
  color: var(--card-bg);
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background-color 0.3s;
}

.hints li button:hover {
  background-color: var(--accent-hover);
}

.verset-display-container.twoCols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.verset-display-container.oneCol {
  grid-template-columns: 1fr;
}
.SearchResult.hidden { display:none; }
.SearchResult {
    font-size: 1.2rem;
    padding: 1em;
    border-right:1px solid var(--accent-color);
} .SearchResult a { font-weight: bold; }
.SearchResult h2 {
    color:var(--accent-color);
}

       .popup ul {
	   padding:0;
	   margin-block-start: 0em;
	   margin-block-end: 0em;
	   margin-left:0px; list-style-type: none;
       }
       #SourcesGroupsC ul { margin-block-start: 0em;
			    margin-block-end: 0em;
			    margin-left:0px; list-style-type: none;
			    padding-inline-start: 1em;}
       #SourcesGroupsC { margin-left: 1em; }
       #SourcesGroupsC li{
	   border-left: 2px solid var(--accent-color);
	   margin-bottom:0px;
       }

       .ref {
	   font-style:italic;
	   font-size:smaller;
	   text-decoration:underline;
	   cursor: pointer;
       }
       
       .Question {
	   font-weight:bold;
       }
       .Narrator {
	   font-weight:bold;
       }
       .HadithGrade {
	   font-weight:bold;
	   float:right;
       }
       .HadithId {
	   font-weight:bold;
       }
       .Response {
	   font-style:italic;
       }
       .VersetsBox select{
	   max-width:10em;
       }

       .btnBible{
	   text-decoration-color:#47A;
       }
       .btnCoran{
         text-decoration-color:#074;
       }
       .btnHadiths{
	   text-decoration-color:#094;
       }
       .btnRael{
	   text-decoration-color:#0A0;
       }
       .btnVatican{
	   text-decoration-color:#760;
           font-size:smaller;
       }
       .btnCatComp{
           text-decoration-color:#970;
       }
       .btnCat{
	   text-decoration-color:#A40;
       }
       .btnCatE{
	   text-decoration-color:#A70;
       }
       .btnCatX{
	   text-decoration-color:#D70;
       }
       .btnCatT{
	   text-decoration-color:#F70;
       }
       .btnCan{
	   text-decoration-color:#F90;
       }
       .btnSocial{
	   text-decoration-color:#FA0;
       }
       .btnDH{
	   text-decoration-color:#FB0;
       }


       table.bordered > tr{ border:1px solid var(--accent-color);}
       table.bordered {
	   border-collapse: collapse;
	   color: var(--accent-color);
       }
       table.bordered > tr:first-child{
	   background-color:var(--accent-color);
	   font-weight:bold;
	   color: var(--text-dark);
       }
       table.bordered2 {
	   border-collapse: collapse;
	   color: var(--accent-color)
       }
       table.bordered2 > tr:first-child{
	   border-bottom:1px solid var(--accent-color);
       }
       table.bordered2 > tr > td:first-child{
	   border-left:0px solid var(--accent-color);
       }
       table.bordered2 > tr > td {
	   border-left:1px solid var(--accent-color);
       }

       td a{
           word-wrap: break-word;        /* Force le texte long à se casser */
           overflow-wrap: break-word;    /* Si 'word-wrap' ne fonctionne pas seul, ajoute cette propriété */
           word-break: break-all;
}

       .searchDone {
	   text-decoration-line: line-through !important;
       }
       .friseleft {
	   background: linear-gradient(0.25turn, var(--card-bg), var(--accent-color));
	   width : 3em;
       }
       .friseright {
	   background: linear-gradient(0.25turn, var(--accent-color),var(--card-bg));
	   width : 3em;
       }
       .frisemid {
	   background-color:var(--accent-color);
       }


.dark .theme-toggle{
  background: black;
}
.theme-toggle {
  background: white;
  border: none;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  cursor: pointer;
  position: relative;
  transition: background 0.3s ease, transform 0.3s ease;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.theme-toggle:hover {
  transform: scale(1.1);
}

/* L’icône (soleil/lune stylisée) */
.theme-toggle .icon {
  display: block;
  width: 24px;
  height: 24px;
  margin: auto;
  background-color: #f39c12;
  border-radius: 50%;
  position: relative;
  box-shadow:
    0 -12px 0 #f39c12,
    0 12px 0 #f39c12,
    -12px 0 0 #f39c12,
    12px 0 0 #f39c12,
    -8px -8px 0 #f39c12,
    8px -8px 0 #f39c12,
    -8px 8px 0 #f39c12,
    8px 8px 0 #f39c12;
  transition: all 0.4s ease;
}

/* Quand en mode sombre, on change l’icône pour une lune */
body.dark .theme-toggle .icon {
  background-color: #f1c40f;
  box-shadow: none;
}

body.dark .theme-toggle .icon::before {
  content: "";
  position: absolute;
  width: 24px;
  height: 24px;
  background: black;
  border-radius: 50%;
  top: -6px;
  left: -6px;
}
