:root {
  --primary-green: #3a6b40;
  --primary-green-dark: #274f2e;
  --primary-green-light: #6c9673;

  --secondary-blue: #2a6f8f;
  --secondary-orange: #b46617;
  --secondary-pink: #c2556f;
  --secondary-purple: #8255a1;

  --warning-red: #a83232;
  --success-green: #58cc02;

  --edmoi-forest: #0c3b2e;
  --edmoi-sage: #6c9673;
  --edmoi-gold: #ffba00;
  --edmoi-wood: #b46617;

  /* Neutres modernes - Thème clair */
  --bg-primary: #f5f5f5;
  --bg-secondary: #e8e8e8;
  --bg-elevated: #ffffff;
  --text-primary: #2c2c2c;
  --text-secondary: #666666;
  --border-light: #d0d0d0;
  --shadow: rgba(0, 0, 0, 0.12);
}

/* Thème sombre */
[data-theme="dark"] {
  --bg-primary: #1a1a1a;
  --bg-secondary: #242424;
  --bg-elevated: #2d2d2d;
  --text-primary: #e8e8e8;
  --text-secondary: #a0a0a0;
  --border-light: #3d3d3d;
  --shadow: rgba(0, 0, 0, 0.4);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto",
    "Helvetica", "Arial", sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* ==================== BOUTON THÈME DANS PARAMÈTRES ==================== */
#theme-toggle-btn {
  background: var(--primary-green) !important;
  color: white !important;
  border: none !important;
  border-radius: 8px !important;
  padding: 8px 16px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
}

#theme-toggle-btn:hover {
  background: var(--primary-green-dark) !important;
  transform: scale(1.05) !important;
}

/* ==================== LOGO HOME (PAGE PROFIL) ==================== */
[data-theme="light"] header div#pp img[alt="logo home"] {
  filter: invert(100%);
}

[data-theme="dark"] header div#pp img[alt="logo home"] {
  filter: invert(0%);
}

/* ==================== FLECHE RETOUR (PAGE CUISINE) ==================== */
[data-theme="light"] img#fleche-gauche {
  filter: invert(100%);
}

[data-theme="dark"] img#fleche-gauche {
  filter: invert(0%);
}

/* ==================== HEADER ==================== */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 32px;
  background: var(--bg-elevated);
  box-shadow: 0 2px 8px var(--shadow);
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 3px solid var(--primary-green);
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

header div#logo-container {
  flex: 0 0 auto;
  transition: transform 0.2s ease;
}

header div#logo-container:hover {
  transform: scale(1.05);
}

header div#logo-container img {
  height: 50px;
  width: auto;
}

header div#titre {
  flex: 1;
  text-align: center;
}

header div#titre h1 {
  font-size: 32px;
  font-weight: 800;
  background: linear-gradient(
    135deg,
    var(--primary-green) 0%,
    var(--edmoi-sage) 100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}

header div#pp {
  flex: 0 0 auto;
}

header div#pp img#pp {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 3px solid var(--primary-green);
  cursor: pointer;
  transition: all 0.2s ease;
  object-fit: cover;
}

header div#pp img#pp:hover {
  transform: scale(1.1);
  border-color: var(--edmoi-gold);
  box-shadow: 0 4px 12px rgba(88, 204, 2, 0.3);
}

/* ==================== STREAK CALENDAR ==================== */
container#semaine {
  display: flex;
  justify-content: center;
  padding: 40px 20px;
  margin-top: 20px;
}

.calendar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  background: var(--bg-elevated);
  padding: 24px 32px;
  border-radius: 20px;
  box-shadow: 0 4px 20px var(--shadow);
  border: 2px solid var(--border-light);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: transform 0.2s ease;
}

.day:hover {
  transform: translateY(-4px);
}

.day p {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg-secondary);
  border: 3px solid var(--border-light);
  position: relative;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.circle.filled {
  background: linear-gradient(
    135deg,
    var(--edmoi-gold) 0%,
    var(--secondary-orange) 100%
  );
  border-color: var(--edmoi-gold);
  box-shadow: 0 4px 12px rgba(255, 186, 0, 0.4);
}

.circle.filled::after {
  content: "✓";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 20px;
  font-weight: bold;
}

.circle.current {
  background: linear-gradient(
    135deg,
    var(--primary-green) 0%,
    var(--primary-green-light) 100%
  );
  border-color: var(--primary-green);
  box-shadow: 0 4px 16px rgba(88, 204, 2, 0.5);
  animation: pulse-ring 2s infinite;
}

.circle.current::after {
  content: "🔥";
  position: absolute;
  bottom: -32px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 20px;
  animation: flame 1s infinite alternate;
}

@keyframes pulse-ring {
  0%,
  100% {
    box-shadow: 0 4px 16px rgba(88, 204, 2, 0.5);
  }
  50% {
    box-shadow: 0 4px 24px rgba(88, 204, 2, 0.8),
      0 0 0 8px rgba(88, 204, 2, 0.1);
  }
}

@keyframes flame {
  from {
    transform: translateX(-50%) scale(1);
  }
  to {
    transform: translateX(-50%) scale(1.15);
  }
}

/* ==================== MAIN BUTTONS ==================== */
container#buttons {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 24px;
  padding: 60px 20px;
  flex-wrap: wrap;
}

#button1,
#button2 {
  min-width: 280px;
  padding: 20px 40px;
  font-size: 17px;
  font-weight: 700;
  border: none;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.15);
  position: relative;
  overflow: hidden;
}

#button1 {
  background: linear-gradient(
    180deg,
    var(--primary-green) 0%,
    var(--primary-green-dark) 100%
  );
  color: white;
  border-bottom: 4px solid var(--primary-green-dark);
}

#button2 {
  background: linear-gradient(180deg, var(--secondary-blue) 0%, #1899d6 100%);
  color: white;
  border-bottom: 4px solid #1899d6;
}

#button1:hover,
#button2:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.15);
}

#button1:active,
#button2:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.15);
}

#button1::before,
#button2::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  transition: left 0.5s ease;
}

#button1:hover::before,
#button2:hover::before {
  left: 100%;
}

/* ==================== PROGRESS FOOTER ==================== */
#progression-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: var(--bg-elevated);
  padding: 20px 24px;
  box-shadow: 0 -4px 20px var(--shadow);
  border-top: 3px solid var(--primary-green);
  z-index: 999;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

div#titre-footer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

#progression-footer h2 {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

img#fleche-formation {
  width: 32px;
  height: 32px;
  cursor: pointer;
  transition: transform 0.3s ease;
}

[data-theme="light"] img#fleche-formation {
  filter: invert(48%) sepia(13%) saturate(1500%) hue-rotate(86deg)
    brightness(95%) contrast(90%);
}

[data-theme="dark"] img#fleche-formation {
  filter: invert(88%) sepia(13%) saturate(200%) hue-rotate(86deg)
    brightness(95%) contrast(90%);
}

img#fleche-formation:hover {
  transform: scale(1.1);
}

.progress-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  max-width: 1200px;
  margin: 0 auto;
}

.category {
  background: var(--bg-secondary);
  padding: 16px;
  border-radius: 16px;
  border: 2px solid var(--border-light);
  transition: all 0.2s ease;
}

.category:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--shadow);
  border-color: var(--primary-green);
}

.category p {
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 8px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.progress-bar {
  background: var(--border-light);
  width: 100%;
  height: 16px;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  border-radius: 12px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  background: linear-gradient(
    90deg,
    var(--primary-green) 0%,
    var(--primary-green-light) 100%
  );
}

.progress-fill::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.4),
    transparent
  );
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

/* ==================== PROFILE PAGE ==================== */
container#profile {
  display: flex;
  justify-content: center;
  padding: 40px 20px;
  min-height: calc(100vh - 200px);
}

#profile-container {
  max-width: 800px;
  width: 100%;
  background: var(--bg-elevated);
  border-radius: 24px;
  padding: 32px;
  box-shadow: 0 8px 32px var(--shadow);
  border: 2px solid var(--border-light);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

#profile-header {
  display: flex;
  align-items: center;
  gap: 24px;
  padding-bottom: 24px;
  margin-bottom: 24px;
  border-bottom: 2px solid var(--border-light);
}

#profile-pic {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 4px solid var(--primary-green);
  object-fit: cover;
}

#user-info h1 {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.tasks {
  font-size: 16px;
  color: var(--text-secondary);
  font-weight: 600;
}

#trophies {
  background: linear-gradient(
    135deg,
    var(--primary-green) 0%,
    var(--primary-green-dark) 100%
  );
  border-radius: 20px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 4px 16px rgba(88, 204, 2, 0.3);
}

#trophies h2 {
  font-size: 20px;
  font-weight: 800;
  color: white;
  text-align: center;
  margin-bottom: 16px;
  text-transform: uppercase;
}

.trophies-container {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.trophy {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  color: white;
  padding: 12px 20px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 14px;
  transition: all 0.2s ease;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.trophy:hover {
  transform: translateY(-4px);
  background: rgba(255, 255, 255, 0.3);
}

.trophy.highlighted {
  background: linear-gradient(
    135deg,
    var(--edmoi-gold) 0%,
    var(--secondary-orange) 100%
  );
  color: white;
  border-color: var(--edmoi-gold);
  box-shadow: 0 4px 12px rgba(255, 186, 0, 0.4);
}

div#button_view-all {
  text-align: center;
}

#view-all {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 2px solid white;
  padding: 10px 24px;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

#view-all:hover {
  background: white;
  color: var(--primary-green);
}

#settings h2 {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 16px;
  color: var(--text-primary);
  text-transform: uppercase;
}

#settings ul {
  list-style: none;
}

#settings li {
  background: var(--bg-secondary);
  padding: 16px;
  margin-bottom: 8px;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 2px solid var(--border-light);
}

#settings li:hover {
  background: var(--primary-green);
  color: white;
  transform: translateX(8px);
  border-color: var(--primary-green);
}

/* Style spécial pour l'item du thème */
#theme-setting:hover {
  background: var(--bg-secondary) !important;
  color: var(--text-primary) !important;
  transform: none !important;
}

#logout {
  width: 100%;
  background: linear-gradient(180deg, var(--warning-red) 0%, #e63946 100%);
  color: white;
  border: none;
  border-radius: 16px;
  padding: 16px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 24px;
  transition: all 0.2s ease;
  text-transform: uppercase;
  box-shadow: 0 4px 0 #e63946;
}

#logout:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 0 #e63946;
}

#logout:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #e63946;
}

/* ==================== FORMATION PAGES ==================== */
div#en-tete {
  text-align: center;
  margin: 40px 0;
}

h2 {
  font-size: 32px;
  font-weight: 800;
  color: var(--text-primary);
  text-transform: none;
  letter-spacing: -0.5px;
}

div#button {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  padding: 40px 20px;
  max-width: 1200px;
  margin: 0 auto;
}

button.button_formation1,
button.button_formation2 {
  width: 100%;
  padding: 24px;
  font-size: 18px;
  font-weight: 700;
  border: none;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.15);
}

button.button_formation1 {
  background: linear-gradient(180deg, var(--secondary-blue) 0%, #1899d6 100%);
  color: white;
  border-bottom: 4px solid #1899d6;
}

button.button_formation2 {
  background: linear-gradient(180deg, var(--secondary-pink) 0%, #e63576 100%);
  color: white;
  border-bottom: 4px solid #e63576;
}

button.button_formation1:hover,
button.button_formation2:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.15);
}

button.button_formation1:active,
button.button_formation2:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.15);
}

/* ==================== CREATE FORMATION ==================== */
div#creer_une_formation {
  margin-top: 40px;
  text-align: center;
}

div#creer_une_formation h2 {
  margin-bottom: 30px;
}

div#form {
  display: flex;
  justify-content: center;
  padding: 40px 20px;
}

form {
  max-width: 800px;
  width: 100%;
  background: var(--bg-elevated);
  padding: 32px;
  border-radius: 24px;
  box-shadow: 0 8px 32px var(--shadow);
  border: 2px solid var(--border-light);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

form label {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
  color: var(--text-primary);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

form input[type="text"],
form textarea {
  width: 100%;
  padding: 14px 16px;
  margin-bottom: 20px;
  border: 2px solid var(--border-light);
  border-radius: 12px;
  font-size: 16px;
  font-family: inherit;
  transition: all 0.2s ease;
  background: var(--bg-secondary);
  color: var(--text-primary);
}

form input[type="text"]:focus,
form textarea:focus {
  outline: none;
  border-color: var(--primary-green);
  background: var(--bg-elevated);
  box-shadow: 0 0 0 4px rgba(88, 204, 2, 0.1);
}

form textarea {
  resize: vertical;
  min-height: 120px;
}

input#upload {
  padding: 12px 24px;
  background: var(--bg-secondary);
  border: 2px solid var(--border-light);
  border-radius: 12px;
  cursor: pointer;
  font-weight: 700;
  transition: all 0.2s ease;
  margin: 10px 0 20px 0;
  color: var(--text-primary);
}

input#upload:hover {
  border-color: var(--primary-green);
  background: var(--bg-elevated);
}

form button {
  width: 100%;
  padding: 18px;
  background: linear-gradient(
    180deg,
    var(--primary-green) 0%,
    var(--primary-green-dark) 100%
  );
  color: white;
  border: none;
  border-radius: 16px;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  text-transform: uppercase;
  transition: all 0.2s ease;
  box-shadow: 0 4px 0 var(--primary-green-dark);
}

form button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 0 var(--primary-green-dark);
}

form button:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--primary-green-dark);
}

/* ==================== CUISINE PAGE ==================== */
div#titre-cusine {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 40px 0;
  position: relative;
}

img#fleche-gauche {
  position: absolute;
  left: 20px;
  width: 40px;
  height: 40px;
  cursor: pointer;
  transition: transform 0.2s ease;
}

#videos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 24px;
  padding: 40px 20px;
  max-width: 1400px;
  margin: 0 auto;
}

.video-container {
  background: var(--bg-elevated);
  padding: 20px;
  border-radius: 20px;
  box-shadow: 0 4px 16px var(--shadow);
  border: 2px solid var(--border-light);
  transition: all 0.2s ease;
}

.video-container:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px var(--shadow);
  border-color: var(--primary-green);
}

.video-container h3 {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.video-container iframe {
  width: 100%;
  border-radius: 12px;
  border: none;
  margin-bottom: 12px;
}

.video-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.video-info p {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin: 0;
}

.rating {
  color: var(--edmoi-gold);
  font-size: 16px;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
  header {
    padding: 12px 16px;
  }

  header div#titre h1 {
    font-size: 24px;
  }

  .calendar {
    gap: 8px;
    padding: 16px;
  }

  .circle {
    width: 40px;
    height: 40px;
  }

  container#buttons {
    flex-direction: column;
    padding: 40px 20px;
  }

  #button1,
  #button2 {
    width: 100%;
    max-width: 400px;
  }

  .progress-section {
    grid-template-columns: 1fr;
  }

  #videos {
    grid-template-columns: 1fr;
  }

  div#button {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  header div#titre h1 {
    font-size: 20px;
  }

  header div#pp img#pp {
    width: 40px;
    height: 40px;
  }

  .calendar {
    gap: 6px;
    padding: 12px;
  }

  .circle {
    width: 36px;
    height: 36px;
  }

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

  h2 {
    font-size: 24px;
  }

  #profile-container {
    padding: 20px;
  }

  #profile-header {
    flex-direction: column;
    text-align: center;
  }
}
