:root {
  --primary-color: #947128;
  --secondary-color: #c4a484;
  --background-color: #f2f2f7;
  --text-color: #1c1c1e;
  --card-background: #ffffff;
  --success-color: #34c759;
  --warning-color: #ff9500;
  --danger-color: #ff3b30;
  --border-radius: 12px;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}



/* Reset global pour éviter les débordements de calcul */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body, html {
  margin: 0;
  padding: 0;
  width: 100%; /* FIX : Force la largeur à 100% de l'écran */
  overflow-x: hidden; /* FIX : Empêche tout défilement horizontal parasite sur mobile */
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: linear-gradient(to bottom, var(--background-color), var(--secondary-color));
  min-height: 100vh;
  color: var(--text-color);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container {
  width: 100%;
  max-width: 100vw; /* Empêche le conteneur de dépasser la largeur de l'écran */
  padding: 15px; /* Réduire légèrement le padding global */
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-sizing: border-box;
  overflow-x: hidden; /* Clé pour empêcher le dépassement ! */
  padding-bottom: calc(200px + env(safe-area-inset-bottom)); /* Laisse de la place pour la barre de navigation du bas */
}

#main-content {
    width: 100%;
    /* On force une marge interne très généreuse à la fin du contenu */
    padding-bottom: 140px; 
display: flex;
    flex-direction: column;
    align-items: center; /* Centre parfaitement tout ce qui est à l'intérieur */
}

/* Logo */
.dashboard-logo {
  display: block;
  width: 120px;
  margin: 20px auto;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

/* Typographie */
h1, h2, h3, h4, h5, h6 {
  color: var(--primary-color);
  font-weight: 600;
}

h1 { font-size: 28px; }
h2 { font-size: 24px; }
h3 { font-size: 20px; }

/* Le conteneur principal */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    width: 100%;
    padding: 20px; /* Espace de sécurité sur les bords */
    background: #f4f7f6;
}

/* La carte de connexion */
.login-card {
    background: white;
    width: 100%;
    max-width: 400px; /* Ne dépasse jamais 400px sur Desktop */
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* Les champs de saisie */
.input-group {
    width: 100%;
    margin-bottom: 1rem;
}

.input-group input {
    width: 100%; /* Prend toute la largeur interne du card */
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px; /* Évite le zoom automatique sur iPhone au clic */
}

/* Ajustements spécifiques Mobile */
@media (max-width: 480px) {
    .login-card {
        padding: 1.5rem;
        box-shadow: none; /* Look plus "app native" sur petit écran */
        border-radius: 10px;
    }
    
    .login-container {
        padding: 10px;
        background: white; /* Fond blanc sur mobile pour un look App */
    }
}
/* Bouton d'action */
.btn-login {
    width: 100%;
    padding: 12px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(102, 126, 234, 0.3);
}
/* Banner installation PWA */
.pwa-banner {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    width: 90%;
    max-width: 400px;
    padding: 15px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    z-index: 1000;
    animation: slideUp 0.5s ease-out;
}

.pwa-icon { width: 50px; height: 50px; border-radius: 10px; margin-right: 15px; }
.pwa-text { flex-grow: 1; font-size: 14px; }
.btn-install { background: #28a745; color: white; border: none; padding: 8px 15px; border-radius: 5px; cursor: pointer; }
.btn-close { background: none; border: none; font-size: 20px; margin-left: 10px; color: #999; }

@keyframes slideUp {
    from { transform: translate(-50%, 100%); }
    to { transform: translate(-50%, 0); }
}

/* Cartes */
.dashboard-section {
  background-color: var(--card-background);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  padding: 20px; /* Réduire le padding de 24px à 20px pour gagner de la place */
  margin-bottom: 24px;
  width: 100%; /* S'assure qu'il prend toute la place disponible... */
  max-width: 500px; /* ...sans jamais dépasser 500px sur Desktop */
  box-sizing: border-box; /* Crucial pour que le padding ne s'ajoute pas à la largeur de 100% */
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  overflow: hidden; /* Coupe tout contenu intérieur qui essaierait de déborder */
}

/* --- LE CHEMIN DE LA MAÎTRISE --- */
.mastery-path-card {
    text-align: center;

}

.mastery-subtitle {
    font-size: 14px;
    color: var(--text-color);
    margin-bottom: 20px;
    font-style: italic;
    opacity: 0.8;
}

.mastery-timeline {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
}

.mastery-line {
    flex-grow: 1;
    height: 3px;
    background-color: var(--secondary-color);
    opacity: 0.4;
    margin: 0 5px;
    border-radius: 5px;
}

.mastery-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: white;
    border: 3px solid var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    color: var(--text-color);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.mastery-node:hover, .mastery-node:active {
    transform: scale(1.15);
    background: var(--primary-color);
    color: white;
    box-shadow: 0 6px 15px rgba(148,113,40,0.3);
}

.node-number {
    font-weight: 800;
    font-size: 18px;
    line-height: 1.2;
}

.node-label {
    font-size: 10px;
    text-transform: uppercase;
    font-weight: 600;
}

.node-gold {
    border-color: #d4af37;
    background: linear-gradient(135deg, #fff, #fffdf0);
}
.node-gold:hover {
    background: #d4af37;
}

/* --- LE MODAL DE MAÎTRISE --- */
.mastery-modal-content {
    padding: 30px;
}

.mastery-modal-header {
    text-align: center;
    margin-bottom: 20px;
    border-bottom: 2px solid rgba(148,113,40,0.2);
    padding-bottom: 15px;
}

.mastery-modal-header h2 {
    font-size: 28px;
    color: var(--primary-color);
    margin: 0 0 5px 0;
}

.mastery-modal-subtitle {
    font-size: 18px;
    color: var(--secondary-color);
    font-weight: bold;
    margin: 0;
}

.modal-mantra-banner {
  width: 100%;
  overflow: hidden;
}

.modal-mantra-image {
  width: 100%;
  display: block;
  height: auto;
}

.modal-mantra-banner-mastery {
  margin: 0 -30px 20px;
  width: calc(100% + 60px);
}

.highlight-text {
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    color: var(--text-color);
    padding: 15px;
    background: rgba(148,113,40,0.05);
    border-radius: 10px;
    margin-bottom: 20px;
}

.mastery-general-text p {
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 15px;
}

.yogi-quote {
    background: linear-gradient(135deg, rgba(148,113,40,0.1), rgba(196,164,132,0.1));
    border-left: 4px solid var(--primary-color);
    padding: 15px;
    margin: 20px 0;
    font-style: italic;
    border-radius: 0 10px 10px 0;
    color: var(--text-color);
}


/* Citation */
.quote-card {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: var(--border-radius);
      padding: 24px;
  margin-bottom: 24px;
  width: 100%;
  color: white;
  position: relative;
  overflow: hidden;
    box-sizing: border-box;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.quote-text {
  font-style: italic;
  font-size: 18px;
  line-height: 1.6;
  margin-bottom: 10px;
  position: relative;
  z-index: 1;
}

.quote-author {
  text-align: right;
  font-weight: 500;
  position: relative;
  z-index: 1;
}

.quote-card::before {
  content: '"';
  position: absolute;
  top: -20px;
  left: 10px;
  font-size: 150px;
  opacity: 0.2;
  font-family: Georgia, serif;
  z-index: 0;
}


/* challenge action */
.challenge-action-btn {
    padding: 8px 16px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 5px;
}

.btn-success-hover {
    background-color: #28a745;
    color: white;
    transform: scale(1.05);
}

.btn-danger-hover {
    background-color: #dc3545;
    color: white;
    transform: scale(1.05);
}

.btn-primary-hover {
    background-color: #947128;
    color: white;
    transform: scale(1.05);
}

.challenge-card.completed {
    border-left: 4px solid #28a745;
}

.challenge-card.abandoned {
    border-left: 4px solid #dc3545;
}

.challenge-card.current {
    border-left: 4px solid #947128;
}

/* Boutons */
.btn-primary, .btn-secondary {
  display: inline-block;
  padding: 12px 24px;
  border: none;
  border-radius: 20px;
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  transition: all 0.3s ease;
  cursor: pointer;
}

.btn-primary {
  background-color: var(--primary-color);
  color: white;
}

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

.btn-primary:hover, .btn-secondary:hover {
  opacity: 0.9;
  transform: translateY(-2px);
}

/* Barre de navigation inférieure */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 75px;
  padding-bottom: calc(env(safe-area-inset-bottom) + 10px); /* Sécurité pour la barre d'accueil des iPhone modernes */
  background-color: #ffffff;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.08); /* Légère ombre au-dessus pour bien la délimiter */
}

.bottom-nav .nav-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: #5f4816;
  font-size: 12px;
  flex: 1; /* Aligne et centre parfaitement les 4 blocs */
  height: 100%;
  padding: 10px 0;
  opacity: 0.7;
  transition: all 0.3s ease;
}

.bottom-nav .nav-link img {
  width: 24px;
  height: 24px;
  margin-bottom: 4px;
  transition: transform 0.3s ease;
}

/* État actif (le menu sur lequel on se trouve) */
.bottom-nav .nav-link.active {
  color: var(--primary-color); /* Prend la couleur "or/marron" de votre thème */
  font-weight: 700;
  opacity: 1;
  background-color: transparent;
}

.bottom-nav .nav-link.active img {
  transform: scale(1.15); /* Fait grossir un peu l'icône */
}

/* Challenge en cours */
.current-challenge {
  text-align: center;
}

.challenge-image {
  width: 100%;
  max-width: 200px;  /* Réduire la largeur maximale */
  height: auto;  /* Maintenir le ratio d'aspect */
  border-radius: 12px;  /* Coins arrondis pour correspondre au style Apple */
  margin-bottom: 15px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  object-fit: cover;  /* Assure que l'image couvre bien la zone sans être déformée */
}

.challenge-description {
  font-size: 14px;
  color: var(--text-color);
  margin-bottom: 20px;
  opacity: 0.8;  /* Légère transparence pour le texte secondaire */
}

/* Pour les challenges disponibles dans la liste */
.challenge-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

.challenge-card {
  background-color: var(--card-background);
  border-radius: var(--border-radius);
  padding: 16px;
  box-shadow: var(--shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.challenge-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.challenge-card .challenge-image {
  width: 100%;
  height: 150px;  /* Hauteur fixe pour uniformité */
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 12px;
}

.challenge-card h3 {
  font-size: 18px;
  margin-bottom: 8px;
}

.challenge-card p {
  font-size: 14px;
  color: var(--text-color);
  opacity: 0.8;
  margin-bottom: 12px;
}

/* Calendrier */
.calendar-container {
  background-color: var(--card-background);
  border-radius: var(--border-radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.tracker-head-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.tracker-select {
  border: 1px solid rgba(148, 113, 40, 0.35);
  border-radius: 10px;
  background: #fff;
  color: #5f4816;
  padding: 8px 10px;
  font-size: 14px;
  min-width: 190px;
  max-width: 100%;
}

.tracker-meta {
  margin: 6px 0 10px;
  color: #6f5730;
  font-size: 13px;
}

.tracker-focus-card {
  margin-bottom: 14px;
}

.calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}

.calendar-empty {
  width: 100%;
  max-width: 40px;
  margin: 0 auto;
}

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #e5e5ea;
  border-radius: 50%;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
  width: 100%; /* S'assure que le jour s'adapte à sa cellule de grille */
  max-width: 40px; /* Évite qu'ils ne deviennent trop gros */
  margin: 0 auto;
}

.calendar-day.completed {
  background-color: var(--primary-color);
  color: white;
}

/* Hebdo calender : Empêcher le graphique Chart.js de déborder de la carte */
.weekly-stats {
  width: 100%;
  max-width: 100%;
  overflow-x: auto; /* Permet un léger défilement interne *uniquement* pour le graphique si besoin, sans bouger toute la page */
}

/* S'assurer que le canvas lui-même est responsive */
canvas#weeklyChart {
  width: 100% !important;
  max-width: 100%;
  height: auto !important;
}



/* Barre de progression */
.progress-container {
  margin: 20px 0;
}

.progress-bar {
  background-color: #e0e0e0;
  border-radius: 10px;
  height: 8px;
  overflow: hidden;
}

.progress {
  background-color: var(--primary-color);
  height: 100%;
  transition: width 0.3s ease;
}

.rep-counter {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 8px;
}

.rep-btn {
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 14px;
  font-size: 28px;
  line-height: 1;
  font-weight: 700;
  background: var(--primary-color);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 2px;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.rep-btn:active {
  transform: scale(0.97);
}

.rep-value {
  min-width: 70px;
  text-align: center;
  font-size: 30px;
  font-weight: 700;
  color: var(--text-color);
}

/* Profil */
.profile-image {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 20px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  border: 3px solid var(--primary-color);
}

.reminder-card {
  border: 1px solid rgba(148, 113, 40, 0.2);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(251, 247, 238, 0.96));
}

.reminder-help {
  margin: 6px 0 10px;
  color: #6f5730;
  font-size: 14px;
}

.reminder-toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  color: var(--text-color);
  margin: 8px 0 12px;
}

.reminder-toggle-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary-color);
}

.reminder-time-label {
  display: block;
  font-size: 13px;
  color: #7b6435;
  font-weight: 700;
  margin-bottom: 6px;
}

#dailyReminderTime {
  width: min(220px, 100%);
  border: 1px solid rgba(148, 113, 40, 0.3);
  border-radius: 12px;
  background: #fff;
  color: #5f4816;
  font-size: 15px;
  font-weight: 600;
  padding: 10px 12px;
}

#dailyReminderTime:disabled {
  opacity: 0.6;
}

.reminder-status {
  display: block;
  color: #6f5730;
  margin-top: 8px;
  font-size: 13px;
}

/* Messages */
.success-message, .error-message {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 24px;
  border-radius: 20px;
  color: white;
  font-weight: 600;
  text-align: center;
  z-index: 1000;
  animation: fadeInOut 3s ease-in-out;
}

.success-message {
  background-color: var(--success-color);
}

.error-message {
  background-color: var(--danger-color);
}

@keyframes fadeInOut {
  0%, 100% { opacity: 0; }
  10%, 90% { opacity: 1; }
}

/* Confettis */
.confetti {
  position: fixed;
  width: 10px;
  height: 10px;
  background-color: var(--primary-color);
  animation: fall 3s ease-in infinite;
}

@keyframes fall {
  to {
    transform: translateY(100vh) rotate(720deg);
  }
}

/* Minuteur de meditation */
.practice-timer-card {
  padding: 0;
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(242, 242, 247, 0.96));
  border: 1px solid rgba(148, 113, 40, 0.18);
  box-shadow: 0 12px 28px rgba(91, 67, 24, 0.12);
}

.meditation-timer-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  padding: 22px 18px 20px;
  background: radial-gradient(circle at top, rgba(196, 164, 132, 0.2), rgba(255, 255, 255, 0.85) 60%);
}

.meditation-timer-container h3 {
  margin: 0;
  font-size: 20px;
}

.timer-caption {
  margin: -4px 0 4px;
  color: #6f5730;
  font-size: 13px;
  font-weight: 500;
}

.timer-display {
  min-width: 190px;
  padding: 14px 22px;
  border-radius: 16px;
  background: linear-gradient(140deg, #ffffff, rgba(196, 164, 132, 0.2));
  border: 1px solid rgba(148, 113, 40, 0.28);
  color: #5f4816;
  font-size: clamp(34px, 8vw, 44px);
  line-height: 1;
  font-weight: 700;
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 8px 18px rgba(95, 72, 22, 0.14);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.meditation-timer-container.timer-running .timer-display {
  transform: translateY(-1px);
  border-color: rgba(148, 113, 40, 0.5);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 12px 24px rgba(95, 72, 22, 0.2);
}

.meditation-timer-container.timer-completed .timer-display {
  background: linear-gradient(140deg, #ffffff, rgba(52, 199, 89, 0.2));
  border-color: rgba(52, 199, 89, 0.45);
}

.timer-controls {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 8px 0 2px;
}

.timer-btn {
  border: 1px solid rgba(148, 113, 40, 0.25);
  border-radius: 14px;
  padding: 11px 6px;
  font-size: 13px;
  font-weight: 600;
  color: #5f4816;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(242, 242, 247, 0.92));
  box-shadow: 0 4px 10px rgba(95, 72, 22, 0.11);
  cursor: pointer;
  min-height: 44px;
  white-space: nowrap;
}

.timer-btn:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 1);
  box-shadow: 0 8px 14px rgba(95, 72, 22, 0.16);
}

.timer-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(95, 72, 22, 0.16);
}

.start-btn {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: #fff;
  border-color: transparent;
}

.meditation-timer-container.timer-running .start-btn {
  opacity: 0.65;
}

.meditation-timer-container.timer-paused .pause-btn,
.meditation-timer-container.timer-completed .reset-btn {
  border-color: rgba(148, 113, 40, 0.45);
  box-shadow: 0 0 0 2px rgba(148, 113, 40, 0.18);
}

.duration-label {
  margin-top: 2px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #7b6435;
  font-weight: 700;
}

.duration-select {
  width: min(220px, 100%);
  border: 1px solid rgba(148, 113, 40, 0.3);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.95);
  color: #5f4816;
  font-size: 15px;
  font-weight: 600;
  padding: 11px 14px;
  text-align: center;
  text-align-last: center;
}

.duration-select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(148, 113, 40, 0.2);
}

@media (max-width: 520px) {
  .timer-controls {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .timer-btn {
    width: 100%;
    font-size: 12px;
    padding: 10px 4px;
  }
}

.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.4);
}

.modal-content {
  background-color: #fefefe;
  margin: 15% auto;
  padding: 20px;
  border: 1px solid #888;
  width: 80%;
  max-width: 500px;
}

.close {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}

.close:hover,
.close:focus {
  color: #000;
  text-decoration: none;
  cursor: pointer;
}

.btn-edit, .btn-delete {
  padding: 5px 10px;
  margin: 2px;
  border: none;
  border-radius: 3px;
  cursor: pointer;
}

.btn-edit {
  background-color: #4CAF50;
  color: white;
}

.btn-delete {
  background-color: #f44336;
  color: white;
}

.btn-delete:hover {
  background-color: #d32f2f;
}

.success {
  color: #4CAF50;
  background-color: #e8f5e9;
  padding: 10px;
  border-radius: 5px;
  margin-bottom: 10px;
}

.error {
  color: #f44336;
  background-color: #ffebee;
  padding: 10px;
  border-radius: 5px;
  margin-bottom: 10px;
}

.popup-feedback {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: rgba(255, 255, 255, 0.95);
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  max-width: 80%;
  text-align: center;
  animation: fadeIn 0.5s ease-out;
}

.popup-content h3 {
  color: #947128;
  margin-bottom: 10px;
}

.popup-content p {
  margin-bottom: 5px;
}

.encouragement {
  font-style: italic;
  color: #4a4a4a;
  margin-top: 10px;
}

@keyframes breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

#breathing-animation {
  width: 100px;
  height: 100px;
  background-color: var(--primary-color);
  border-radius: 50%;
  margin: 20px auto;
}

.breathing {
  animation: breathe 4s infinite ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.fade-out {
  animation: fadeOut 0.5s ease-in;
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}


/* Responsive design */
@media (max-width: 768px) {
  .container {
    padding: 10px;
  }

  h1 { font-size: 24px; }
  h2 { font-size: 20px; }
  h3 { font-size: 18px; }

  .btn-primary, .btn-secondary {
    padding: 10px 16px;
    font-size: 14px;
  }

  .calendar-day {
    font-size: 12px;
  }

  .meditation-timer {
    font-size: 48px;
  }
.dashboard-section {
    padding: 15px; /* Marges internes encore plus petites sur mobile */
    border-radius: 12px;
  }
  
  /* Permettre aux citations longues de s'adapter sans déborder */
  .quote-card {
    padding: 15px;
    word-wrap: break-word;
  }

  /* Ajuster la taille de l'image de profil */
  .profile-image {
    width: 90px;
    height: 90px;
  }

  /* Les longs mots (emails, titres de challenge) ne casseront pas la mise en page */
  p, h1, h2, h3, h4 {
    word-wrap: break-word;
    overflow-wrap: break-word;
  }
}



/* ===== ANIMATIONS ===== */
@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

@keyframes spin {
  to {
    transform: rotateZ(360deg);
  }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.dashboard-section {
  animation: slideInUp 0.3s ease-out;
}

/* ===== LOADERS ===== */
.loader {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(148, 113, 40, 0.3);
  border-top-color: #947128;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ===== MESSAGES D'ERREUR ET DE SUCCÈS ===== */
.error-message {
  background-color: #ff3b30;
  color: white;
  padding: 12px;
  border-radius: 8px;
  margin-top: 12px;
  animation: slideInUp 0.3s ease-out;
}

.success-message {
  background-color: #34c759;
  color: white;
  padding: 12px;
  border-radius: 8px;
  margin-top: 12px;
  animation: slideInUp 0.3s ease-out;
}

.warning-message {
  background-color: #ff9500;
  color: white;
  padding: 12px;
  border-radius: 8px;
  margin-top: 12px;
  animation: slideInUp 0.3s ease-out;
}

/* ===== POPUP FEEDBACK ===== */
.popup-feedback {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: white;
  border-radius: 12px;
  padding: 32px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  z-index: 2000;
  animation: slideInUp 0.3s ease-out;
  max-width: 90%;
}

.popup-content {
  text-align: center;
}

.popup-content h3 {
  margin-top: 0;
  color: #947128;
}

.encouragement {
  font-style: italic;
  color: #947128;
  margin-top: 16px;
  font-weight: 600;
}

.fade-out {
  animation: fadeOut 0.5s ease-out forwards;
}

/* ===== CONFETTI ===== */
.confetti {
  position: fixed;
  width: 10px;
  height: 10px;
  pointer-events: none;
  animation: confettiFall linear forwards;
}

@keyframes confettiFall {
  to {
    transform: translateY(100vh) rotateZ(360deg);
    opacity: 0;
  }
}

/* ===== INDICATEUR DE CONNEXION ===== */
.connection-indicator {
  position: fixed;
  top: 10px;
  right: 10px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  z-index: 1500;
}

.connection-indicator.online {
  background-color: #34c759;
  box-shadow: 0 0 8px rgba(52, 199, 89, 0.5);
}

.connection-indicator.offline {
  background-color: #ff3b30;
  box-shadow: 0 0 8px rgba(255, 59, 48, 0.5);
  animation: pulse 1s infinite;
}

/* ===== TRANSITIONS FLUIDES ===== */
.dashboard-section {
  transition: all 0.3s ease;
}

.bottom-nav {
  transition: all 0.3s ease;
}

.nav-link {
  transition: all 0.3s ease;
}

.nav-link.active {
  background-color: rgba(148, 113, 40, 0.1);
  color: #947128;
  font-weight: 700;
}

/* ===== ACCESSIBILITÉ ===== */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid #947128;
  outline-offset: 2px;
}

/* ===== ADMIN HEADER NAVIGATION ===== */
.admin-header-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}

.admin-header-nav h1 {
  margin: 0;
  flex: 1;
  min-width: 200px;
}

.btn-back-to-dashboard {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background-color: #947128;
  color: white;
  text-decoration: none;
  border-radius: 20px;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.btn-back-to-dashboard:hover {
  background-color: #7a5a1f;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(148, 113, 40, 0.3);
}

.btn-back-to-dashboard:active {
  transform: translateY(0);
}

@media (max-width: 600px) {
  .admin-header-nav {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-header-nav h1 {
    text-align: center;
  }

  .btn-back-to-dashboard {
    justify-content: center;
    width: 100%;
  }
}

/* ===== BOUTON ADMIN (dans le profil) ===== */
.btn-admin {
  display: inline-block;
  width: 100%;
  padding: 12px 24px;
  margin-top: 12px;
  background: linear-gradient(135deg, #947128, #7a5a1f);
  color: white;
  text-decoration: none;
  border-radius: 20px;
  font-weight: 600;
  text-align: center;
  transition: all 0.3s ease;
  border: 2px solid transparent;
  cursor: pointer;
}

.btn-admin:hover {
  background: linear-gradient(135deg, #7a5a1f, #5f4816);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(148, 113, 40, 0.4);
}

.btn-admin:active {
  transform: translateY(0);
}

/* ===== BADGE ADMIN ===== */
.admin-badge {
  position: fixed;
  top: 10px;
  left: 10px;
  background: linear-gradient(135deg, #947128, #7a5a1f);
  color: white;
  padding: 8px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  z-index: 999;
  box-shadow: 0 2px 8px rgba(148, 113, 40, 0.3);
  animation: slideInDown 0.3s ease-out;
}

@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Challenge Detail Modal */
.challenge-detail-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 10000;
  overflow-y: auto;
  padding: 20px;
  animation: fadeIn 0.3s ease-in;
}

.challenge-detail-modal.show {
  display: flex;
  align-items: center;
  justify-content: center;
}

.challenge-detail-content {
  background: white;
  border-radius: 16px;
  max-width: 700px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.3s ease-out;
}

.close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: var(--text-color);
  z-index: 10001;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-btn:hover {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 50%;
}

.error-banner {
  background: var(--danger-color);
  color: white;
  padding: 12px 16px;
  margin: 0;
  text-align: center;
  border-radius: 16px 16px 0 0;
}

.challenge-detail-header {
  position: relative;
  height: 280px;
  overflow: hidden;
  border-radius: 16px 16px 0 0;
}

.detail-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-header-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.8));
  color: white;
  padding: 20px;
}

.detail-header-info h1 {
  color: white;
  margin: 0 0 10px 0;
  font-size: 28px;
}

.detail-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.detail-status,
.detail-duration {
  display: inline-block;
  background: rgba(255, 255, 255, 0.2);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 14px;
  backdrop-filter: blur(10px);
}

.challenge-detail-body {
  padding: 24px;
}

.modal-mantra-banner-detail {
  margin: -24px -24px 20px;
  width: calc(100% + 48px);
}

.detail-section {
  margin-bottom: 24px;
}

.detail-section h3 {
  color: var(--primary-color);
  margin-top: 0;
  margin-bottom: 12px;
  font-size: 18px;
}

.detail-section p {
  margin: 0;
  line-height: 1.6;
  color: var(--text-color);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.detail-card {
  background: linear-gradient(135deg, var(--background-color), rgba(196, 164, 132, 0.1));
  padding: 16px;
  border-radius: 12px;
  text-align: center;
  border-left: 4px solid var(--primary-color);
}

.detail-card strong {
  display: block;
  color: var(--primary-color);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.detail-card p {
  margin: 0;
  color: var(--text-color);
  font-size: 16px;
  font-weight: 500;
}

.progress-info {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--background-color);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--success-color), var(--primary-color));
  border-radius: 4px;
  transition: width 0.3s ease;
}

.detail-actions {
  display: flex;
  gap: 14px;
  margin-top: 24px;
  border-top: 1px solid var(--background-color);
  padding-top: 24px;
}

.challenge-action-form + .challenge-action-form {
  margin-top: 10px;
}

.btn-action {
  flex: 1;
  padding: 12px 20px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-action.btn-primary {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
}

.btn-action.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(148, 113, 40, 0.3);
}

.btn-action.btn-secondary {
  background: var(--background-color);
  color: var(--text-color);
  border: 1px solid var(--secondary-color);
}

.btn-action.btn-secondary:hover {
  background: var(--secondary-color);
  color: white;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}



/* Video Container pour YouTube */
.video-container {
  width: 100%;
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: 8px;
  background: var(--background-color);
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 8px;
}

.video-container p {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  padding: 20px;
}

.practice-video-frame {
  width: calc(100% - 48px);
  margin: 0 24px 12px;
  border-radius: 14px;
  box-shadow: 0 10px 24px rgba(95, 72, 22, 0.2);
  border: 1px solid rgba(148, 113, 40, 0.22);
}

.practice-video-fallback {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 120px;
  height: 120px;
  transform: translate(-50%, -50%);
  object-fit: contain;
}

@media (max-width: 768px) {
  .practice-video-frame {
    width: calc(100% - 32px);
    margin: 0 16px 10px;
  }
}

/* Smooth transition between themes */
* {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.page-credit {
  text-align: center;
  margin: 20px 0 12px;
  font-size: 13px;
  color: var(--text-color);
  opacity: 0.8;
}

/* Bouton d'accueil */
.btn-practice { width: 100%; padding: 16px; font-size: 18px; margin: 20px 0; border-radius: 15px; }

/* Carte de validation dans le modal */
.practice-validation-card { background: rgba(148, 113, 40, 0.05); border: 2px solid rgba(148, 113, 40, 0.2); border-radius: 12px; padding: 20px; text-align: center; margin-top: 30px; }
.large-input { width: 100%; padding: 12px; border-radius: 8px; border: 1px solid #ccc; font-size: 18px; text-align: center; margin: 10px 0 20px 0; box-sizing: border-box; }

.slide-validate {
  --slide-progress: 0;
  width: 100%;
  border-radius: 999px;
  border: 1px solid rgba(148, 113, 40, 0.25);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(242, 242, 247, 0.98));
  padding: 4px;
  position: relative;
  overflow: hidden;
}

.slide-validate::before {
  content: "";
  position: absolute;
  inset: 0;
  width: calc(var(--slide-progress) * 100%);
  background: linear-gradient(90deg, rgba(148, 113, 40, 0.22), rgba(196, 164, 132, 0.35));
  transition: width 0.12s linear;
  pointer-events: none;
}

.slide-validate-track {
  position: relative;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.slide-validate-text {
  font-weight: 700;
  color: #6a5428;
  font-size: 15px;
  letter-spacing: 0.01em;
  user-select: none;
  pointer-events: none;
}

.slide-validate-thumb {
  position: absolute;
  left: 3px;
  top: 3px;
  bottom: 3px;
  width: 56px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  cursor: grab;
  box-shadow: 0 8px 16px rgba(95, 72, 22, 0.25);
  touch-action: none;
  z-index: 1;
}

.slide-validate.is-dragging .slide-validate-thumb {
  cursor: grabbing;
}

.slide-validate.is-resetting .slide-validate-thumb {
  transition: transform 0.18s ease-out;
}

.slide-validate.is-complete .slide-validate-thumb {
  cursor: default;
}

.slide-validate.is-complete::before,
.slide-validate.is-success::before {
  width: 100%;
  background: linear-gradient(90deg, rgba(40, 167, 69, 0.25), rgba(32, 201, 151, 0.34));
}

.slide-validate.is-success {
  border-color: rgba(40, 167, 69, 0.45);
}

.slide-validate.timer-ready-pulse {
  animation: slideValidatePulse 1.35s ease-in-out infinite;
  border-color: rgba(148, 113, 40, 0.5);
}

.slide-validate.timer-ready-pulse .slide-validate-text {
  color: #5f4816;
}

.slide-validate.timer-ready-pulse .slide-validate-thumb {
  box-shadow: 0 10px 20px rgba(95, 72, 22, 0.33);
}

@keyframes slideValidatePulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(148, 113, 40, 0.3);
  }
  50% {
    transform: scale(1.01);
    box-shadow: 0 0 0 7px rgba(148, 113, 40, 0.12);
  }
}

@media (max-width: 520px) {
  .slide-validate-track {
    min-height: 52px;
  }

  .slide-validate-text {
    font-size: 13px;
  }

  .slide-validate-thumb {
    width: 50px;
    font-size: 20px;
  }
}

/* État Validé (Vert) */
.btn-success-validated {
    background: linear-gradient(135deg, #28a745, #20c997) !important;
    color: white !important; border: none;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.4) !important;
    cursor: default !important; pointer-events: none;
    transition: all 0.4s ease-out;
}

.btn-update-today {
  width: 100%;
  padding: 12px 20px;
  border: none;
  border-radius: 20px;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(135deg, #28a745, #20c997);
  box-shadow: 0 4px 15px rgba(40, 167, 69, 0.35);
}

.btn-update-today:hover {
  transform: translateY(-1px);
}

.zen-practice-image {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}

#practiceModal {
  z-index: 10002;
}

.practice-timer-image {
  width: 120px;
  height: 120px;
  object-fit: contain;
  display: block;
  margin: 0 auto 12px;
  transform-origin: center;
  animation: timerPulse 5s ease-in-out infinite;
}

.no-challenge-timer-image {
  width: 110px;
  height: 110px;
  object-fit: contain;
  display: block;
  margin: 6px auto 12px;
}

.no-challenge-state {
  width: 100%;
  text-align: center;
}

.no-challenge-message {
  text-align: center;
}

@keyframes timerPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}


