@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
  --bg-dark: #0f0a1c;
  --bg-gradient: linear-gradient(135deg, #0f0a1c 0%, #1e1338 50%, #140d2b 100%);
  --card-bg: rgba(30, 20, 52, 0.65);
  --card-bg-hover: rgba(45, 30, 78, 0.85);
  --card-border: rgba(255, 255, 255, 0.12);
  
  --gold-primary: #f3ce70;
  --gold-glow: rgba(243, 206, 112, 0.35);
  --purple-glow: rgba(192, 132, 252, 0.35);
  --purple-accent: #c084fc;
  --rose-accent: #f472b6;
  --teal-accent: #38bdf8;
  
  --text-main: #f8fafc;
  --text-sub: #cbd5e1;
  --text-muted: #94a3b8;
  
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  
  --shadow-card: 0 12px 32px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  --bottom-bar-height: 72px;
}

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

body {
  font-family: 'Outfit', sans-serif;
  background: var(--bg-dark);
  background-image: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text-main);
  min-height: 100vh;
  padding-bottom: calc(var(--bottom-bar-height) + 20px);
  overflow-x: hidden;
}

/* Glassmorphism utility */
.glass-card {
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 20px;
  margin-bottom: 20px;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.glass-card:active {
  transform: scale(0.99);
}

/* Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15, 10, 28, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--card-border);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.brand-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 0 16px var(--gold-glow);
}

.brand-title {
  font-size: 1.25rem;
  font-weight: 700;
  background: linear-gradient(135deg, #fff 0%, var(--gold-primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 0.5px;
}

.brand-subtitle {
  font-size: 0.75rem;
  color: var(--purple-accent);
  font-weight: 400;
}

.header-actions {
  display: flex;
  gap: 8px;
}

.icon-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--card-border);
  color: var(--text-main);
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.icon-btn:hover, .icon-btn:active {
  background: var(--gold-glow);
  border-color: var(--gold-primary);
  color: var(--gold-primary);
}

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

.tab-view {
  display: none;
  animation: fadeIn 0.35s ease-out forwards;
}

.tab-view.active {
  display: block;
}

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

/* Banner / Affirmation Cards */
.affirmation-banner {
  background: linear-gradient(135deg, rgba(192, 132, 252, 0.2) 0%, rgba(243, 206, 112, 0.15) 100%);
  border: 1px solid rgba(243, 206, 112, 0.3);
  position: relative;
  overflow: hidden;
}

.affirmation-banner::before {
  content: '✨';
  position: absolute;
  top: -10px;
  right: -10px;
  font-size: 4rem;
  opacity: 0.15;
}

.affirmation-tag {
  display: inline-block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--gold-primary);
  font-weight: 600;
  margin-bottom: 6px;
}

.affirmation-text {
  font-size: 1.15rem;
  font-weight: 500;
  font-style: italic;
  line-height: 1.5;
  color: #fff;
}

/* Section titles */
.section-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--gold-primary);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* To-Do Items */
.todo-input-row {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.custom-input {
  flex: 1;
  background: rgba(15, 10, 28, 0.6);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  color: #fff;
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.custom-input:focus {
  border-color: var(--gold-primary);
  box-shadow: 0 0 12px var(--gold-glow);
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold-primary) 0%, #e0b040 100%);
  color: #0f0a1c;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-md);
  padding: 12px 20px;
  font-family: inherit;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 4px 16px var(--gold-glow);
  transition: all 0.2s ease;
}

.btn-primary:active {
  transform: scale(0.96);
}

.todo-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.todo-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(15, 10, 28, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  transition: all 0.2s ease;
}

.todo-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.checkbox-custom {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 2px solid var(--purple-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.todo-item.completed .checkbox-custom {
  background: var(--gold-primary);
  border-color: var(--gold-primary);
  color: #0f0a1c;
}

.todo-text {
  font-size: 0.95rem;
  color: var(--text-main);
  transition: opacity 0.2s ease, text-decoration 0.2s ease;
}

.todo-item.completed .todo-text {
  text-decoration: line-through;
  opacity: 0.5;
}

.delete-btn {
  color: var(--text-muted);
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px;
}

.delete-btn:hover {
  color: var(--rose-accent);
}

/* Habit Quick Matrix */
.habit-quick-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 10px;
}

.habit-quick-card {
  background: rgba(15, 10, 28, 0.5);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 14px 10px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s ease;
}

.habit-quick-card.checked {
  background: linear-gradient(135deg, rgba(243, 206, 112, 0.25) 0%, rgba(192, 132, 252, 0.25) 100%);
  border-color: var(--gold-primary);
  box-shadow: 0 0 16px var(--gold-glow);
}

.habit-icon {
  font-size: 1.6rem;
  margin-bottom: 6px;
}

.habit-title {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-sub);
}

/* Values Grid */
.values-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.value-chip {
  background: rgba(15, 10, 28, 0.5);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 12px;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-sub);
  cursor: pointer;
  transition: all 0.2s ease;
}

.value-chip.selected {
  background: linear-gradient(135deg, var(--gold-primary) 0%, #e0b040 100%);
  color: #0f0a1c;
  font-weight: 700;
  border-color: var(--gold-primary);
  box-shadow: 0 0 16px var(--gold-glow);
}

/* Bottom Tab Navigation Bar */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--bottom-bar-height);
  background: rgba(15, 10, 28, 0.92);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border-top: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 10px;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 14px;
  transition: all 0.2s ease;
  cursor: pointer;
}

.nav-icon {
  font-size: 1.35rem;
  transition: transform 0.2s ease, color 0.2s ease;
}

.nav-item.active {
  color: var(--gold-primary);
  background: rgba(243, 206, 112, 0.1);
}

.nav-item.active .nav-icon {
  transform: translateY(-2px) scale(1.15);
  color: var(--gold-primary);
}

/* Selectors / Navigation Controls */
.nav-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.custom-select {
  background: rgba(15, 10, 28, 0.8);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  color: #fff;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(10px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background: var(--bg-dark);
  border: 1px solid var(--gold-primary);
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8);
}
