/* Import des polices Google Fonts (déjà chargées dans les templates) */
/* Amiri et Scheherazade New pour l'arabe */

/* Charte graphique */
/* Couleur principale : Vert #045104 */
/* Couleur d'accent : Jaune clair #FFE861 */

/* Style général */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: #f8f8f8;
  color: #222;
  margin: 0;
  padding: 0;
  text-align: center;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Polices arabes optimisées */
.arabic-text, .card h2, .verse-text, .sourate-arabe {
  font-family: 'Amiri', 'Scheherazade New', 'Noto Naskh Arabic', 'Arial Unicode MS', serif;
  font-feature-settings: "liga" 1, "kern" 1;
  -webkit-font-feature-settings: "liga" 1, "kern" 1;
  -moz-font-feature-settings: "liga" 1, "kern" 1;
  text-rendering: optimizeLegibility;
}

header {
  background: linear-gradient(135deg, #045104, #034403) !important;
  background-color: #045104 !important;
  color: white;
  padding: 2rem 1rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1), 0 0 20px rgba(255, 232, 97, 0.1);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  border: none !important;
}

/* Suppression de tout bleu potentiel */
header * {
  color: white !important;
}

header a {
  color: white !important;
}

header a:hover {
  color: #FFE861 !important;
}

header > * {
  position: relative;
  z-index: 1;
}

.logo-container {
  margin-bottom: 1rem;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.site-logo {
  max-width: 100%;
  width: auto;
  height: auto;
  max-height: 180px;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.3));
  display: block;
}

.site-logo-small {
  max-width: 100%;
  width: auto;
  height: auto;
  max-height: 150px;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.2));
}

header h1 {
  font-size: 2.2rem;
  margin-bottom: 0.5rem;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
  word-wrap: break-word;
  color: white;
}

header h2 {
  font-weight: 400;
  font-size: 1.1rem;
  opacity: 0.95;
  color: white;
}

header a {
  color: white;
  text-decoration: underline;
  transition: opacity 0.3s ease;
}

header a:hover {
  color: #FFE861;
  text-decoration: underline;
  text-shadow: 0 0 8px rgba(255, 232, 97, 0.6);
}

header .user-info {
  color: white;
  margin: 0.5rem 0;
}

header p {
  color: white;
  margin: 0.5rem 0;
}

/* Grille de cartes */
.cards-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  padding: 2rem;
  gap: 1.5rem;
}

.card {
  background: white;
  border-radius: 16px;
  width: 240px;
  min-width: 200px;
  flex: 0 1 auto;
  text-decoration: none;
  color: #222;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  box-sizing: border-box;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 15px rgba(4, 81, 4, 0.2), 0 0 20px rgba(255, 232, 97, 0.15);
  border: 2px solid rgba(255, 232, 97, 0.4);
}

.card:active {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(4, 81, 4, 0.3), 0 0 15px rgba(255, 232, 97, 0.2);
  border: 2px solid rgba(255, 232, 97, 0.6);
}

.card-content {
  padding: 1.5rem;
}

/* Texte arabe dans les cartes */
.card h2 {
  font-size: 2rem;
  direction: rtl;
  text-align: center;
  font-family: 'Amiri', 'Scheherazade New', 'Noto Naskh Arabic', serif;
  margin: 0.5rem 0;
  color: #045104;
  line-height: 1.6;
  font-weight: 700;
  word-wrap: break-word;
  overflow-wrap: break-word;
  -webkit-hyphens: auto;
  hyphens: auto;
  transition: color 0.3s ease, text-shadow 0.3s ease;
}

.card:hover h2 {
  color: #034403;
  text-shadow: 0 0 8px rgba(255, 232, 97, 0.3);
}

.card h3.arabic {
  font-size: 1.8rem;
  direction: rtl;
  text-align: center;
  font-family: 'Amiri', 'Scheherazade New', 'Noto Naskh Arabic', serif;
  margin: 0.5rem 0;
  color: #045104;
  line-height: 1.6;
}

.card h4 {
  margin: 0;
  font-weight: 600;
  color: #111;
  font-size: 1rem;
}

.card p {
  font-size: 0.95rem;
  margin-top: 0.5rem;
  color: #555;
  line-height: 1.5;
}


h1, h2, h3, h4 {
  text-align: center;
  margin: 0.3em;
}

a {
  text-decoration: none;
  color: inherit;
}

.logout, .back {
  display: inline-block;
  margin: 1em;
  padding: 0.5em 1em;
  background: #045104;
  color: #fff;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.logout:hover, .back:hover {
  background: #034403;
  border-color: #FFE861;
  box-shadow: 0 4px 12px rgba(255, 232, 97, 0.3);
  color: #FFE861;
}

/* Suppression des doublons - les styles .card sont déjà définis plus haut */

/* --- Page de lecture --- */
.container {
    max-width: 900px;
    margin: 50px auto;
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.verset {
    font-size: 1.6em;
    text-align: right;
    margin: 0.5em 0;
}
.numero {
    color: #999;
    font-size: 0.8em;
    margin-left: 8px;
}

.verses {
  max-width: 800px;
  margin: 2em auto;
  background: #fff;
  border-radius: 10px;
  padding: 1.5em 2em;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.verse-line {
  display: flex;
  align-items: center;
  gap: 1em;
  padding: 0.5em 0;
  border-bottom: 1px solid #eee;
}

.verse-text {
  flex: 1;
  font-size: 1.2em;
  direction: rtl;
  font-family: 'Amiri', 'Scheherazade New', 'Noto Naskh Arabic', serif;
  color: #222;
  font-feature-settings: "liga" 1, "kern" 1;
  text-rendering: optimizeLegibility;
}

.verse-checkbox {
  transform: scale(1.3);
  accent-color: #045104;
}

.verse-checkbox:checked {
  filter: drop-shadow(0 0 4px rgba(255, 232, 97, 0.5));
}

.login-container {
  max-width: 400px;
  margin: 3rem auto;
  padding: 2rem;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  text-align: center;
}

.login-container h1 {
  margin-bottom: 1rem;
}

.login-container form {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.login-container input {
  padding: 0.6rem;
  border-radius: 6px;
  border: 1px solid #ccc;
}

.login-container button {
  background-color: #045104;
  color: white;
  border: 2px solid transparent;
  padding: 0.6rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 600;
}

.login-container button:hover {
  background-color: #034403;
  border-color: #FFE861;
  box-shadow: 0 4px 12px rgba(255, 232, 97, 0.3);
  color: #FFE861;
}

.back-link {
  display: inline-block;
  margin-top: 1rem;
  color: #045104;
  text-decoration: none;
}

.back-link:hover {
  color: #034403;
  text-decoration: underline;
}


.error {
  color: red;
  margin-top: 1em;
}

/* === STYLE DES PAGES SOURATES === */

/* === Style spécifique aux pages de sourates === */
.sourate-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem;
  direction: rtl; /* Pour lecture droite-gauche */
  text-align: right;
  font-family: 'Amiri', 'Scheherazade New', 'Noto Naskh Arabic', serif;
  line-height: 1.8;
  font-feature-settings: "liga" 1, "kern" 1;
  text-rendering: optimizeLegibility;
}

.sourate-arabe {
  font-family: 'Amiri', 'Scheherazade New', 'Noto Naskh Arabic', serif;
  font-weight: 700;
  font-size: 1.8rem;
  color: #045104;
  margin: 0.5rem 0;
}

.sourate-header {
  direction: ltr; /* Garde le titre et bouton "Retour" à gauche */
  text-align: left;
  margin-bottom: 2rem;
  background: linear-gradient(135deg, #045104, #034403);
  color: white;
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1), 0 0 20px rgba(255, 232, 97, 0.1);
  position: relative;
}

.sourate-header h1,
.sourate-header h2 {
  color: white;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.sourate-header h1 {
  text-align: center;
  margin-bottom: 0.5rem;
}

.sourate-header h2 {
  text-align: center;
  opacity: 0.95;
}

.sourate-header .back {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.sourate-header .back:hover {
  background: rgba(255, 232, 97, 0.3);
  border-color: #FFE861;
  color: #FFE861;
  box-shadow: 0 4px 12px rgba(255, 232, 97, 0.3);
}

.verses-form {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.verset-ligne {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.6rem;
}

.verset-ligne input[type="checkbox"] {
  transform: scale(1.3);
  cursor: pointer;
  accent-color: #045104;
}

.verset-ligne input[type="checkbox"]:checked {
  filter: drop-shadow(0 0 4px rgba(255, 232, 97, 0.5));
}

.verse-text {
  font-size: 2rem;
  line-height: 2.4;
  font-family: 'Amiri', 'Scheherazade New', 'Noto Naskh Arabic', serif;
  font-feature-settings: "liga" 1, "kern" 1;
  text-rendering: optimizeLegibility;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.numero {
  color: #777;
  margin-left: 0.6rem;
  font-size: 0.9rem;
  vertical-align: top;
}

.save-button {
  display: block;
  margin: 2rem auto 0;
  padding: 0.8rem 1.5rem;
  background: #045104;
  color: white;
  border: 2px solid transparent;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 600;
}

.save-button:hover {
  background: #034403;
  border-color: #FFE861;
  box-shadow: 0 4px 12px rgba(255, 232, 97, 0.3);
  color: #FFE861;
}

/* ========================================
   MEDIA QUERIES POUR RESPONSIVE MOBILE
   ======================================== */

/* Tablettes et petits écrans */
@media screen and (max-width: 768px) {
  header {
    padding: 1.5rem 1rem;
  }
  
  .logo-container {
    max-width: 80%;
    margin: 0 auto 1rem;
  }
  
  .site-logo {
    max-width: 100%;
    max-height: 150px;
  }
  
  header h1 {
    font-size: 1.8rem;
    margin-bottom: 0.3rem;
  }
  
  .logo-container {
    max-width: 80%;
    margin: 0 auto 1rem;
  }
  
  .site-logo {
    max-height: 140px;
  }
  
  .cards-container {
    padding: 1rem;
    gap: 1rem;
  }
  
  .card {
    width: calc(50% - 0.5rem);
    min-width: 150px;
    padding: 1.2rem;
  }
  
  .card h2 {
    font-size: 1.6rem;
    line-height: 1.5;
  }
  
  .card p {
    font-size: 0.85rem;
  }
  
  .sourate-page {
    padding: 1rem;
  }
  
  .verse-text {
    font-size: 1.6rem;
    line-height: 2;
  }
  
  .verset-ligne {
    gap: 0.5rem;
  }
  
  .verset-ligne input[type="checkbox"] {
    transform: scale(1.5);
    min-width: 24px;
    min-height: 24px;
  }
  
  .sourate-header h1 {
    font-size: 1.5rem;
  }
  
  .sourate-header h2 {
    font-size: 1rem;
  }
  
  .save-button {
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
  }
  
  .login-container,
  .register-container,
  .forgot-password-container,
  .reset-password-container {
    max-width: 90%;
    margin: 20px auto;
    padding: 20px;
  }
  
  .site-logo-small {
    max-width: 100%;
    max-height: 120px;
  }
}

/* Smartphones */
@media screen and (max-width: 480px) {
  body {
    font-size: 16px;
  }
  
  header {
    padding: 1rem 0.5rem;
  }
  
  .logo-container {
    max-width: 90%;
    margin: 0 auto 0.5rem;
  }
  
  .site-logo {
    max-width: 100%;
    max-height: 120px;
  }
  
  header h1 {
    font-size: 1.5rem;
    margin-bottom: 0.3rem;
  }
  
  .logo-container {
    max-width: 90%;
    margin: 0 auto 0.5rem;
  }
  
  .site-logo {
    max-height: 100px;
  }
  
  header .user-info {
    font-size: 0.85rem;
  }
  
  header p {
    font-size: 0.9rem;
  }
  
  .user-info {
    font-size: 0.9rem;
  }
  
  .user-info a {
    display: block;
    margin-top: 0.3rem;
  }
  
  .cards-container {
    padding: 0.5rem;
    gap: 0.75rem;
  }
  
  .card {
    width: calc(100% - 1rem);
    min-width: 0;
    padding: 1rem;
    margin: 0 0.5rem;
  }
  
  .card h2 {
    font-size: 1.5rem;
    line-height: 1.4;
    margin: 0.3rem 0;
  }
  
  .card p {
    font-size: 0.8rem;
    margin-top: 0.3rem;
  }
  
  .sourate-page {
    padding: 0.5rem;
  }
  
  .sourate-header {
    margin-bottom: 1rem;
  }
  
  .sourate-header h1 {
    font-size: 1.3rem;
    line-height: 1.4;
  }
  
  .sourate-header h2 {
    font-size: 0.9rem;
  }
  
  .verse-text {
    font-size: 1.4rem;
    line-height: 1.9;
    word-spacing: 0.1em;
  }
  
  .numero {
    font-size: 0.75rem;
    margin-left: 0.4rem;
  }
  
  .verset-ligne {
    padding: 0.6rem 0;
    gap: 0.5rem;
    align-items: flex-start;
  }
  
  .verset-ligne input[type="checkbox"] {
    transform: scale(1.6);
    margin-top: 0.3rem;
    flex-shrink: 0;
  }
  
  .verses-form {
    gap: 0.5rem;
  }
  
  .save-button {
    padding: 1.2rem;
    font-size: 1.2rem;
    margin-top: 1rem;
  }
  
  .login-container,
  .register-container,
  .forgot-password-container,
  .reset-password-container {
    margin: 10px auto;
    padding: 15px;
    border-radius: 8px;
  }
  
  .login-container h1,
  .register-container h1,
  .forgot-password-container h1,
  .reset-password-container h1 {
    font-size: 1.3rem;
    margin-bottom: 20px;
  }
  
  .site-logo-small {
    max-width: 80%;
    max-height: 100px;
  }
  
  .back {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    display: inline-block;
    margin-bottom: 1rem;
  }
  
  /* Amélioration de la lisibilité sur petits écrans */
  input[type="email"],
  input[type="password"],
  input[type="text"] {
    font-size: 16px; /* Empêche le zoom automatique sur iOS */
    padding: 14px;
    width: 100%;
    box-sizing: border-box;
  }
  
  button {
    font-size: 16px;
    padding: 14px;
    width: 100%;
  }
  
  /* Table de bilan responsive */
  table {
    font-size: 0.9rem;
  }
  
  th, td {
    padding: 10px 8px;
  }
}

/* Très petits écrans */
@media screen and (max-width: 360px) {
  .card h2 {
    font-size: 1.3rem;
  }
  
  .verse-text {
    font-size: 1.2rem;
    line-height: 1.8;
  }
  
  header h1 {
    font-size: 1.3rem;
  }
}

/* Orientation paysage sur mobile */
@media screen and (max-width: 768px) and (orientation: landscape) {
  .cards-container {
    padding: 1rem 0.5rem;
  }
  
  .card {
    width: calc(33.333% - 0.67rem);
    min-width: 140px;
  }
  
  .sourate-page {
    padding: 1rem 0.5rem;
  }
}

/* Amélioration de l'accessibilité tactile */
@media (hover: none) and (pointer: coarse) {
  /* Styles spécifiques pour les écrans tactiles */
  .card:hover {
    transform: none;
  }
  
  .card:active {
    transform: scale(0.98);
    background: #f5f5f5;
  }
  
  button, a, input[type="checkbox"] {
    min-height: 44px; /* Taille minimale recommandée pour le touch */
    min-width: 44px;
  }
}
