/* ---------- COLOR THEME ---------- */
:root {
  --bg: #020617;
  --card: #0b1220;
  --accent: #38bdf8;             /* calm blue theme */
  --accent-soft: rgba(56, 189, 248, 0.16);
  --text: #e5e7eb;
  --muted: #94a3b8;
  --border: #1f2937;
}

/* ---------- PAGE LAYOUT ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  padding: 2rem 1rem;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  font-family: system-ui, sans-serif;
  background: radial-gradient(circle at top, #1e293b, #020617 65%, #000);
  color: var(--text);
}

/* ---------- TRACKER CARD ---------- */
.tracker-app {
  width: 100%;
  max-width: 560px;
}

.tracker-card {
  background: linear-gradient(155deg, #0f172a, #020617);
  border-radius: 1.5rem;
  padding: 2rem;
  border: 1px solid var(--border);
  box-shadow: 0 26px 48px rgba(0, 0, 0, 0.95);
  animation: fadeIn 0.5s ease-out;
  text-align: center;
}

/* ---------- TITLES ---------- */
.tracker-title {
  margin-top: 0;
  font-size: 1.7rem;
}

.tracker-date {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 1.2rem;
}

/* ---------- PROGRESS BAR ---------- */
.progress-wrapper {
  margin-bottom: 1.4rem;
}

#progress-container {
  width: 100%;
  height: 14px;
  background: rgba(15,23,42,0.9);
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
}

#progress-bar,
.progress-bar-inner {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #22c55e, #38bdf8);
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.6);
  transition: width 0.3s ease-out;
}

/* ---------- HABITS LIST ---------- */
.habits-list,
#habit-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0 1.4rem;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.habits-list li,
#habit-list li {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.75rem;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  font-size: 0.95rem;
}

/* Checkbox styling */
input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
}

/* ---------- BUTTONS ---------- */
button {
  font-family: inherit;
  cursor: pointer;
  border: none;
}

.btn-secondary {
  padding: 0.65rem 1.4rem;
  background: rgba(15, 23, 42, 0.95);
  color: var(--text);
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 0.9rem;
  font-weight: 500;
  width: 100%;
  transition:
    background 0.18s ease,
    transform 0.12s ease,
    box-shadow 0.18s ease;
}

.btn-secondary:hover {
  background: rgba(15,23,42,1);
  transform: translateY(-1px);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.9);
}

/* ---------- FOOTER ---------- */
.tracker-footer {
  margin-top: 1rem;
  color: var(--muted);
  font-size: 0.85rem;
}
/* EXTRA TEXT CONTENT */
.tracker-intro {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0.4rem 0 0.9rem;
  text-align: left;
}

.tracker-howto {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  text-align: left;
  font-size: 0.85rem;
  color: var(--muted);
}

.tracker-howto li {
  margin-bottom: 0.25rem;
}

.tracker-hint {
  font-size: 0.85rem;
  color: var(--muted);
  text-align: left;
  margin: 0 0 0.7rem;
}

/* REFLECTION AREA */
.reflection {
  margin-top: 1.2rem;
  text-align: left;
}

.reflection h2 {
  margin: 0 0 0.3rem;
  font-size: 1rem;
}

.reflection-text {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.reflection textarea {
  width: 100%;
  border-radius: 0.9rem;
  border: 1px solid var(--border);
  background: #020617;
  color: var(--text);
  padding: 0.6rem 0.75rem;
  font-family: inherit;
  font-size: 0.9rem;
  resize: vertical;
}

.reflection textarea:focus {
  outline: 1px solid var(--accent);
  border-color: var(--accent);
}

.reflection-note {
  margin: 0.45rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}

/* ---------- ANIMATION ---------- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 600px) {
  .tracker-card {
    padding: 1.4rem 1.3rem;
  }
}
/* EXTRA TEXT CONTENT */
.tracker-intro {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0.4rem 0 0.9rem;
  text-align: left;
}

.tracker-howto {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  text-align: left;
  font-size: 0.85rem;
  color: var(--muted);
}

.tracker-howto li {
  margin-bottom: 0.25rem;
}

.tracker-hint {
  font-size: 0.85rem;
  color: var(--muted);
  text-align: left;
  margin: 0 0 0.7rem;
}

/* STATS ROW */
.stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 0.4rem 0 1rem;
}

.stat-pill {
  flex: 1 1 110px;
  padding: 0.45rem 0.65rem;
  border-radius: 0.9rem;
  background: rgba(15, 23, 42, 0.9);
  border: 1px dashed rgba(148, 163, 184, 0.7);
}

.stat-label {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
}

.stat-value {
  font-size: 0.95rem;
  font-weight: 600;
}

/* REFLECTION AREA */
.reflection {
  margin-top: 1.2rem;
  text-align: left;
}

.reflection h2 {
  margin: 0 0 0.3rem;
  font-size: 1rem;
}

.reflection-text {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.reflection textarea {
  width: 100%;
  border-radius: 0.9rem;
  border: 1px solid var(--border);
  background: #020617;
  color: var(--text);
  padding: 0.6rem 0.75rem;
  font-family: inherit;
  font-size: 0.9rem;
  resize: vertical;
}

.reflection textarea:focus {
  outline: 1px solid var(--accent);
  border-color: var(--accent);
}

.reflection-note {
  margin: 0.45rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}

/* HISTORY SECTION */
.history {
  margin-top: 1.2rem;
  text-align: left;
}

.history h2 {
  margin: 0 0 0.3rem;
  font-size: 1rem;
}

.history-text {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.history-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.history-item {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  padding: 0.4rem 0.55rem;
  border-radius: 0.7rem;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border);
  margin-bottom: 0.35rem;
}

.history-date {
  color: var(--muted);
}

.history-percent {
  font-weight: 600;
}

.history-strong {
  color: #4ade80;
}

/* PROGRESS LABEL (if missing) */
.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
}
