/* ==========================================================
   STYLE: SEKARANG AKU HARUS NGAPAIN? (Mobile-First CSS)
   ========================================================== */
:root {
  --bg-dark: #0a0e17;
  --card-bg: #131b2a;
  --card-border: #1e293b;
  --accent: #10b981;
  --accent-light: #34d399;
  --accent-glow: rgba(16, 185, 129, 0.2);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --danger: #ef4444;
  --warning: #f59e0b;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-main);
  line-height: 1.5;
  padding-bottom: 90px;
}

/* Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(10, 14, 23, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--card-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
}
.badge-date {
  font-weight: 600;
  font-size: 0.9rem;
  color: #e2e8f0;
}
.badge-fasting {
  margin-left: 8px;
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: 20px;
  font-weight: 600;
}
.badge-fasting.fasting {
  background: rgba(16, 185, 129, 0.2);
  color: var(--accent-light);
  border: 1px solid rgba(16, 185, 129, 0.4);
}
.badge-fasting.not-fasting {
  background: rgba(148, 163, 184, 0.15);
  color: var(--text-muted);
}
.icon-btn {
  background: #1e293b;
  border: 1px solid #334155;
  font-size: 1.1rem;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Container */
.main-container {
  max-width: 520px;
  margin: 0 auto;
  padding: 16px;
}

.view-section {
  display: none;
}
.view-section.active {
  display: block;
}

.view-header {
  margin-bottom: 20px;
}
.view-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
}
.subtitle {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-top: 4px;
}

/* Card SEKARANG (Now Focus) */
.card-now {
  background: linear-gradient(180deg, #162234 0%, #101928 100%);
  border: 2px solid var(--accent);
  box-shadow: 0 0 25px var(--accent-glow);
  border-radius: 20px;
  padding: 20px;
  margin-bottom: 16px;
  position: relative;
}

.now-badge-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}
.pulse-dot {
  width: 10px;
  height: 10px;
  background-color: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--accent);
}
.now-title {
  font-weight: 800;
  letter-spacing: 0.08em;
  font-size: 0.9rem;
  color: var(--accent-light);
}
.now-time-range {
  margin-left: auto;
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
}

/* Section Group */
.section-group {
  margin-top: 14px;
}
.group-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.group-label-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.task-counter {
  font-size: 0.75rem;
  background: #1e293b;
  padding: 2px 8px;
  border-radius: 12px;
  color: var(--text-muted);
}

/* Routines List */
.routines-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.routine-pill {
  width: 100%;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(51, 65, 85, 0.8);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.92rem;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #e2e8f0;
  transition: border-color 0.15s ease, background 0.15s ease, opacity 0.15s ease;
}
.routine-pill:active {
  transform: scale(0.99);
}
.routine-pill.drink {
  border-color: rgba(56, 189, 248, 0.4);
  background: rgba(14, 116, 144, 0.2);
}
/* Rutine yang sudah dicentang: dicoret & diredupkan */
.routine-pill.done {
  background: rgba(15, 23, 42, 0.6);
  border-color: #1e293b;
  color: var(--text-dim);
}
.routine-pill.done .pill-text {
  text-decoration: line-through;
  text-decoration-color: #475569;
}
.pill-check {
  flex-shrink: 0;
  font-size: 0.95rem;
  line-height: 1;
}
.pill-text {
  flex: 1;
}
.pill-done-label {
  flex-shrink: 0;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
}
.group-hint {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin: -4px 0 8px;
}
.skeleton-pill {
  font-size: 0.8rem;
  color: var(--text-dim);
  padding: 8px 0;
}

/* Tasks List */
.tasks-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.task-card {
  background: #1a2538;
  border: 1px solid #2d3d57;
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.15s ease;
}
.task-card.completed {
  opacity: 0.6;
  text-decoration: line-through;
  border-color: #1e293b;
}
.task-header-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.task-checkbox {
  width: 22px;
  height: 22px;
  accent-color: var(--accent);
  cursor: pointer;
  margin-top: 2px;
}
.task-title-text {
  font-size: 1rem;
  font-weight: 500;
  color: #f8fafc;
  flex: 1;
}
.task-actions-row {
  display: flex;
  gap: 6px;
  margin-left: 32px;
  flex-wrap: wrap;
}
.btn-task-action {
  background: #0f172a;
  border: 1px solid #334155;
  color: var(--text-muted);
  font-size: 0.75rem;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
}
.btn-task-action:hover {
  background: #1e293b;
  color: #fff;
}
.btn-task-carry {
  color: var(--accent-light);
  border-color: rgba(16, 185, 129, 0.4);
}

.btn-add-inline {
  width: 100%;
  margin-top: 10px;
  background: transparent;
  border: 1px dashed #334155;
  color: var(--text-muted);
  padding: 10px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.88rem;
}
.btn-add-inline:hover {
  border-color: var(--accent);
  color: var(--accent-light);
}

/* Card Next */
.card-next {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 18px;
  padding: 16px 20px;
  margin-bottom: 20px;
}
.next-badge-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.next-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.next-time-range {
  font-weight: 700;
  color: #cbd5e1;
}

/* Strip Hour Scroll */
.time-block-strip-container {
  margin-top: 20px;
}
.strip-label {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-bottom: 8px;
}
.strip-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: none;
}
.strip-scroll::-webkit-scrollbar {
  display: none;
}
.strip-pill {
  flex-shrink: 0;
  background: #172132;
  border: 1px solid #28374d;
  color: var(--text-muted);
  padding: 8px 14px;
  border-radius: 12px;
  font-size: 0.82rem;
  cursor: pointer;
}
.strip-pill.active {
  background: var(--accent);
  color: #042f1a;
  font-weight: 700;
  border-color: var(--accent);
}

/* End of day banner */
.end-day-banner {
  margin-top: 24px;
  background: #1e1b4b;
  border: 1px solid #3730a3;
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.end-day-icon {
  font-size: 1.5rem;
}
.end-day-text strong {
  display: block;
  color: #e0e7ff;
}
.end-day-text span {
  font-size: 0.88rem;
  color: #a5b4fc;
}
.end-day-actions {
  display: flex;
  gap: 8px;
}

/* Forms & Settings */
.setting-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 14px;
}
.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.setting-row strong {
  color: #f1f5f9;
}
.setting-row p {
  font-size: 0.82rem;
  color: var(--text-muted);
}
.form-input {
  width: 100%;
  background: #0b111c;
  border: 1px solid #2d3d57;
  color: #fff;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 1rem;
  margin-top: 6px;
  box-sizing: border-box;
}
.form-input:focus {
  outline: none;
  border-color: var(--accent);
}
label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Buttons */
.btn-primary {
  background: var(--accent);
  color: #022c22;
  font-weight: 700;
  border: none;
  padding: 14px 20px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 1rem;
}
.btn-primary:hover {
  background: var(--accent-light);
}
.btn-ghost {
  background: #1e293b;
  color: #cbd5e1;
  border: 1px solid #334155;
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
}
.btn-accent {
  background: var(--accent);
  color: #022c22;
  border: none;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
}
.btn-cancel {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid #334155;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
}
.full-width {
  width: 100%;
}

/* Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #334155;
  transition: .3s;
  border-radius: 34px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}
input:checked + .slider {
  background-color: var(--accent);
}
input:checked + .slider:before {
  transform: translateX(22px);
}

/* Bottom Nav */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 72px;
  background: rgba(10, 14, 23, 0.95);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--card-border);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 50;
  max-width: 520px;
  margin: 0 auto;
}
.nav-item {
  background: transparent;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--text-dim);
  cursor: pointer;
  flex: 1;
}
.nav-icon {
  font-size: 1.25rem;
}
.nav-text {
  font-size: 0.72rem;
  font-weight: 600;
  margin-top: 2px;
}
.nav-item.active {
  color: var(--accent-light);
}

/* Modal */
.modal-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}
.modal-card {
  background: #172236;
  border: 1px solid #2c3e59;
  border-radius: 20px;
  padding: 24px;
  max-width: 400px;
  width: 100%;
  text-align: center;
}
.modal-icon {
  font-size: 2.5rem;
  margin-bottom: 10px;
}
.modal-card h3 {
  font-size: 1.2rem;
  margin-bottom: 8px;
  color: #fff;
}
.modal-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 18px;
}
.modal-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
