:root {
  --bg: #0a0a0f;
  --bg-card: #13131a;
  --bg-card-hover: #1a1a24;
  --bg-input: #1a1a24;
  --border: #2a2a3a;
  --text: #e8e8f0;
  --text-muted: #8888a0;
  --text-dim: #555566;
  --accent: #6c5ce7;
  --accent-glow: rgba(108, 92, 231, 0.3);
  --green: #00d2a0;
  --green-glow: rgba(0, 210, 160, 0.3);
  --red: #ff6b6b;
  --red-glow: rgba(255, 107, 107, 0.2);
  --yellow: #ffd93d;
  --blue: #4dabf7;
  --pink: #f06595;
  --orange: #ff922b;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0,0,0,0.3);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ===== LOGIN ===== */
.login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.login-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow);
}

.login-box h1 {
  text-align: center;
  margin-bottom: 8px;
  font-size: 24px;
  background: linear-gradient(135deg, var(--accent), var(--pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.login-box p {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 32px;
  font-size: 14px;
}

/* ===== FORMS ===== */
input, textarea, select {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
}

input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

textarea {
  resize: vertical;
  min-height: 80px;
}

label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group {
  margin-bottom: 16px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  color: white;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px var(--accent-glow);
}

.btn-green {
  background: linear-gradient(135deg, var(--green), #00b894);
  color: white;
}

.btn-green:hover {
  box-shadow: 0 4px 16px var(--green-glow);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 13px;
  width: auto;
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--text);
}

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

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  font-size: 18px;
}

/* ===== APP LAYOUT ===== */
.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.app-header h1 {
  font-size: 18px;
  background: linear-gradient(135deg, var(--accent), var(--pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-badge {
  padding: 6px 14px;
  background: var(--bg-input);
  border-radius: 20px;
  font-size: 13px;
  color: var(--text-muted);
}

.app-content {
  flex: 1;
  padding: 20px;
  padding-bottom: 100px;
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
}

/* ===== BOTTOM NAV ===== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom);
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 4px;
  font-size: 10px;
  color: var(--text-dim);
  text-decoration: none;
  cursor: pointer;
  transition: color 0.2s;
  gap: 4px;
  border: none;
  background: none;
}

.nav-item.active {
  color: var(--accent);
}

.nav-item:hover {
  color: var(--text);
}

.nav-icon {
  font-size: 20px;
}

/* ===== CARDS ===== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  transition: border-color 0.2s;
}

.card:hover {
  border-color: #3a3a4a;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.card-title {
  font-size: 16px;
  font-weight: 600;
}

.card-icon {
  font-size: 24px;
}

/* ===== DASHBOARD CARDS ===== */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  margin: 4px 0;
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-card.accent .stat-value { color: var(--accent); }
.stat-card.green .stat-value { color: var(--green); }
.stat-card.yellow .stat-value { color: var(--yellow); }
.stat-card.red .stat-value { color: var(--red); }
.stat-card.blue .stat-value { color: var(--blue); }
.stat-card.pink .stat-value { color: var(--pink); }

/* ===== USER TABS ===== */
.user-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.user-tab {
  flex: 1;
  padding: 12px;
  text-align: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s;
  color: var(--text-muted);
}

.user-tab.active {
  border-color: var(--accent);
  color: var(--text);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* ===== STREAK BAR ===== */
.streak-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}

.streak-emoji { font-size: 20px; }
.streak-name { flex: 1; font-size: 14px; }
.streak-count {
  font-weight: 700;
  color: var(--orange);
  font-size: 16px;
}
.streak-fire { color: var(--orange); }

/* ===== HABIT CHECK ===== */
.habit-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

.habit-row:hover {
  background: var(--bg-card-hover);
}

.habit-check {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  font-size: 14px;
}

.habit-check.done {
  background: var(--green);
  border-color: var(--green);
  color: white;
}

.habit-name { flex: 1; font-size: 14px; }
.habit-icon { font-size: 18px; }

/* ===== MOOD SELECTOR ===== */
.mood-selector {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 16px 0;
}

.mood-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--bg-input);
  font-size: 22px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mood-btn.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  transform: scale(1.1);
}

/* ===== WATER COUNTER ===== */
.water-counter {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 20px;
}

.water-count {
  font-size: 48px;
  font-weight: 700;
  color: var(--blue);
}

.water-label {
  font-size: 14px;
  color: var(--text-muted);
}

.water-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 2px solid var(--blue);
  background: transparent;
  color: var(--blue);
  font-size: 24px;
  cursor: pointer;
  transition: all 0.2s;
}

.water-btn:hover {
  background: var(--blue);
  color: white;
}

/* ===== SCOREBOARD ===== */
.scoreboard {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
}

.score-card {
  flex: 1;
  text-align: center;
  padding: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  position: relative;
}

.score-card.winner {
  border-color: var(--yellow);
  box-shadow: 0 0 20px rgba(255, 217, 61, 0.15);
}

.score-card .crown {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 24px;
}

.score-name {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 4px;
}

.score-points {
  font-size: 36px;
  font-weight: 700;
  color: var(--accent);
}

.score-label {
  font-size: 12px;
  color: var(--text-muted);
}

/* ===== PENALTY JAR ===== */
.penalty-total {
  text-align: center;
  padding: 20px;
}

.penalty-amount {
  font-size: 48px;
  font-weight: 700;
  color: var(--red);
}

/* ===== LOG ENTRIES ===== */
.log-entry {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}

.log-entry .time {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

.log-entry .content {
  flex: 1;
  font-size: 14px;
}

.log-entry .delete-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 16px;
  padding: 0;
  opacity: 0;
  transition: opacity 0.2s;
}

.log-entry:hover .delete-btn {
  opacity: 1;
}

.log-entry .delete-btn:hover {
  color: var(--red);
}

/* ===== QUICK ADD ===== */
.quick-add {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.quick-add input {
  flex: 1;
}

.quick-add .btn {
  width: auto;
  white-space: nowrap;
}

/* ===== SECTION HEADER ===== */
.section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  margin-top: 24px;
}

.section-header h2 {
  font-size: 18px;
}

.section-header:first-child {
  margin-top: 0;
}

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--green);
  color: white;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  z-index: 1000;
  animation: fadeInUp 0.3s, fadeOut 0.3s 2s forwards;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateX(-50%) translateY(20px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

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

/* ===== LOADING ===== */
.loading {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 12px;
}

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

/* ===== EMPTY STATE ===== */
.empty {
  text-align: center;
  padding: 32px;
  color: var(--text-muted);
  font-size: 14px;
}

/* ===== DATE PICKER ===== */
.date-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 20px;
}

.date-nav button {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.date-nav .date-label {
  font-weight: 600;
  min-width: 160px;
  text-align: center;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
  .app-content { padding: 16px; padding-bottom: 100px; }
  .dashboard-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat-card { padding: 12px; }
  .stat-value { font-size: 22px; }
  .form-row { grid-template-columns: 1fr; }
  .scoreboard { flex-direction: column; }
}

/* ===== CLIP ART / FUN GRAPHICS ===== */
.login-illustration {
  text-align: center;
  margin-bottom: 24px;
  font-size: 64px;
  line-height: 1;
}

.login-illustration .couple-art {
  display: inline-block;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.section-art {
  font-size: 32px;
  display: inline-block;
}

.dashboard-mascot {
  text-align: center;
  font-size: 48px;
  margin-bottom: 12px;
  animation: wave 2s ease-in-out infinite;
}

@keyframes wave {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(10deg); }
  75% { transform: rotate(-10deg); }
}

.greeting-text {
  text-align: center;
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.achievement-popup {
  text-align: center;
  padding: 20px;
  font-size: 48px;
  animation: bounceIn 0.5s;
}

@keyframes bounceIn {
  0% { transform: scale(0); }
  60% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.empty-state-art {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.6;
}

.score-card .player-art {
  font-size: 36px;
  margin-bottom: 8px;
}

.penalty-art {
  font-size: 56px;
  margin-bottom: 8px;
  animation: shake 0.5s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.streak-fire-art {
  display: inline-block;
  animation: pulse 1s ease-in-out infinite;
}

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

.gratitude-art {
  font-size: 40px;
  text-align: center;
  margin-bottom: 12px;
}

/* ===== HIDDEN ===== */
.hidden { display: none !important; }

/* ===== TABS ===== */
.tab-group {
  display: flex;
  gap: 4px;
  background: var(--bg-input);
  padding: 4px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
}

.tab-btn {
  flex: 1;
  padding: 8px 12px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s;
}

.tab-btn.active {
  background: var(--accent);
  color: white;
}

/* ===== GOAL CARD ===== */
.goal-card {
  padding: 16px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  border-left: 3px solid var(--accent);
}

.goal-card h4 {
  font-size: 15px;
  margin-bottom: 4px;
}

.goal-card p {
  font-size: 13px;
  color: var(--text-muted);
}

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  width: 100%;
  max-width: 480px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: var(--shadow);
}

.modal h3 {
  margin-bottom: 16px;
}

.modal-actions {
  display: flex;
  gap: 8px;
  margin-top: 20px;
}

.modal-actions .btn { flex: 1; }

/* ===== PROGRESS BAR ===== */
.progress-bar {
  height: 8px;
  background: var(--bg-input);
  border-radius: 4px;
  overflow: hidden;
  margin: 8px 0;
}

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