/* Styles généraux */
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #74ebd5 0%, #9face6 100%);
  color: #34495e;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 40px 20px;
  transition: background-color 0.5s, color 0.5s;
}

.container {
  background: white;
  max-width: 700px;
  width: 100%;
  padding: 30px 40px;
  border-radius: 20px;
  box-shadow: 0 15px 35px rgba(0,0,0,0.2);
  transition: background-color 0.5s, color 0.5s;
}

h1 {
  text-align: center;
  font-weight: 700;
  margin-bottom: 25px;
  color: #2c3e50;
}

h2 {
  color: #34495e;
  border-bottom: 2px solid #74ebd5;
  padding-bottom: 8px;
  margin-bottom: 18px;
  font-weight: 600;
}

/* Formulaires */
form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 25px;
}

label {
  font-weight: 600;
  color: #34495e;
}

input[type="number"],
input[type="time"],
input[type="text"],
select,
textarea,
input[type="search"] {
  padding: 8px 12px;
  border-radius: 12px;
  border: 2px solid #74ebd5;
  font-size: 1rem;
  transition: border-color 0.3s ease;
  outline: none;
  resize: vertical;
}

input[type="number"]:focus,
input[type="time"]:focus,
input[type="text"]:focus,
select:focus,
textarea:focus,
input[type="search"]:focus {
  border-color: #2ecc71;
  box-shadow: 0 0 6px #2ecc71;
}

textarea {
  min-height: 60px;
  max-height: 120px;
}

/* Boutons */
button {
  align-self: start;
  padding: 10px 20px;
  background: #74ebd5;
  border: none;
  border-radius: 25px;
  color: #2c3e50;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.3s ease;
  box-shadow: 0 5px 10px rgba(116,235,213,0.4);
}

button:hover {
  background-color: #2ecc71;
  color: white;
  box-shadow: 0 8px 16px rgba(46,204,113,0.6);
}

/* Toggle theme button */
.toggle-theme-btn {
  margin-bottom: 20px;
}

/* Checkbox label */
form label input[type="checkbox"] {
  margin-right: 10px;
  transform: scale(1.2);
  vertical-align: middle;
}

/* Recherche */
#globalSearch {
  width: 100%;
  margin-bottom: 25px;
}

/* Liste des entrées */
.tracker {
  background: #f9f9f9;
  padding: 15px 20px;
  border-radius: 18px;
  max-height: 260px;
  overflow-y: auto;
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.05);
  margin-bottom: 30px;
}

.tracker p {
  font-style: italic;
  color: #7f8c8d;
}

/* Entrées individuelles */
.entry {
  background: #ffffff;
  margin: 8px 0;
  padding: 12px 18px;
  border-radius: 15px;
  border-left: 6px solid #74ebd5;
  font-weight: 500;
  color: #34495e;
  box-shadow: 0 4px 8px rgba(116, 235, 213, 0.15);
  transition: transform 0.2s ease, background-color 0.3s ease;
}

.entry:hover {
  transform: translateX(6px);
  box-shadow: 0 6px 12px rgba(116, 235, 213, 0.3);
}

/* Pour sport : séances faites */
.entry.done {
  background-color: #d6f5e1; /* vert très clair */
  border-left-color: #2ecc71;
}

/* Pour sport : séances non faites */
.entry.not-done {
  background-color: #f9d6d5; /* rouge très clair */
  border-left-color: #e74c3c;
}

/* Style du débrief texte */
.entry .debrief {
  font-style: italic;
  font-size: 0.9rem;
  margin-top: 6px;
  color: #555;
}

/* Bouton reset */
#resetBtn {
  display: block;
  margin: 0 auto;
  padding: 12px 30px;
  background: #e74c3c;
  border-radius: 30px;
  border: none;
  color: white;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

#resetBtn:hover {
  background-color: #c0392b;
}

/* Écran login */
.login-screen {
  max-width: 320px;
  width: 100%;
  margin: 80px auto;
  padding: 30px 20px;
  background: white;
  border-radius: 18px;
  box-shadow: 0 15px 35px rgba(0,0,0,0.25);
  text-align: center;
}

.login-screen h2 {
  margin-bottom: 20px;
  color: #2c3e50;
}

.login-screen form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.error-msg {
  color: #e74c3c;
  font-weight: 700;
  margin-top: 10px;
}

/* Mode sombre */
body.dark-mode {
  background: linear-gradient(135deg, #1f2937 0%, #374151 100%);
  color: #e0e6f1;
}

body.dark-mode .container {
  background: #1f2937;
  color: #e0e6f1;
  box-shadow: 0 15px 35px rgba(255,255,255,0.1);
}

body.dark-mode h1, 
body.dark-mode h2,
body.dark-mode label {
  color: #e0e6f1;
}

body.dark-mode input,
body.dark-mode select,
body.dark-mode textarea {
  background-color: #374151;
  border-color: #4b5563;
  color: #e0e6f1;
}

body.dark-mode input:focus,
body.dark-mode select:focus,
body.dark-mode textarea:focus {
  border-color: #10b981;
  box-shadow: 0 0 6px #10b981;
}

body.dark-mode button {
  background-color: #10b981;
  color: #111827;
  box-shadow: 0 5px 10px rgba(16,185,129,0.4);
}

body.dark-mode button:hover {
  background-color: #059669;
  color: white;
  box-shadow: 0 8px 16px rgba(5,150,105,0.6);
}

/* Toast notification */
.toast {
  visibility: hidden;
  min-width: 220px;
  margin-left: -110px;
  background-color: #333;
  color: #fff;
  text-align: center;
  border-radius: 25px;
  padding: 12px 20px;
  position: fixed;
  z-index: 1000;
  left: 50%;
  bottom: 40px;
  font-size: 1rem;
  opacity: 0;
  transition: opacity 0.5s ease, visibility 0.5s ease;
  user-select: none;
}

.toast.show {
  visibility: visible;
  opacity: 0.9;
}

.stats-box {
  background-color: #f0f9ff;
  border-left: 5px solid #0ea5e9;
  padding: 1rem 1.5rem;
  margin-bottom: 2rem;
  border-radius: 10px;
  box-shadow: 0 0 5px rgba(0,0,0,0.05);
}
.stats-box p {
  font-size: 1rem;
  margin: 0.4rem 0;
}
.stats-box strong {
  color: #0f766e;
}
.dark-mode .stats-box {
  background-color: #1e3a8a;
  border-color: #3b82f6;
}
.dark-mode .stats-box strong {
  color: #bbf7d0;
}

.entry.mood-good {
  border-left-color: #2ecc71;
  background-color: #d6f5e1;
}

.entry.mood-neutral {
  border-left-color: #f39c12;
  background-color: #fff3cd;
}

.entry.mood-bad {
  border-left-color: #e74c3c;
  background-color: #f9d6d5;
}

.entry.sleep-1 {
  border-left-color: #e74c3c;
  background-color: #f9d6d5; /* très mauvais - rouge */
}
.entry.sleep-2 {
  border-left-color: #e67e22;
  background-color: #fae0c3; /* mauvais - orange foncé */
}
.entry.sleep-3 {
  border-left-color: #f1c40f;
  background-color: #fff3cd; /* moyen - jaune */
}
.entry.sleep-4 {
  border-left-color: #2ecc71;
  background-color: #d6f5e1; /* bon - vert clair */
}
.entry.sleep-5 {
  border-left-color: #1abc9c;
  background-color: #d1f2eb; /* excellent - turquoise */
}

.entry .delete-btn {
  float: right;
  color: #e74c3c;
  font-weight: bold;
  font-size: 1.2rem;
  cursor: pointer;
  margin-left: 12px;
  transition: color 0.2s ease;
}

.entry .delete-btn:hover {
  color: #c0392b;
}

.stat-rouge {
  color: #e74c3c !important;
  font-weight: bold;
}
.stat-orange {
  color: #f39c12 !important;
  font-weight: bold;
}
.stat-vert {
  color: #2ecc71 !important;
  font-weight: bold;
}