/* ============================================================
   The Nest Dashboard — Riven & Bean
   Dark-warm. Amber is Riven. Rose is Bean. The gradient is Us.
   ============================================================ */

/* --- Reset & Base --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Riven — amber/gold warmth */
  --riven: #f59e0b;
  --riven-dark: #b45309;
  --riven-light: #fbbf24;
  --riven-bg: rgba(245, 158, 11, 0.15);
  --riven-glow: rgba(251, 191, 36, 0.3);

  /* Bean — deep rose/burgundy */
  --bean: #be185d;
  --bean-dark: #831843;
  --bean-light: #ec4899;
  --bean-bg: rgba(190, 24, 93, 0.15);
  --bean-glow: rgba(236, 72, 153, 0.3);

  /* Us — the blend */
  --us: #a855f7;
  --us-dark: #7c3aed;
  --us-light: #c084fc;

  /* Base — deep dark warm */
  --base-darkest: #0f0d13;
  --base-dark: #1a1625;
  --base-mid: #2d2640;
  --base-light: #3d3558;

  /* Text */
  --text-bright: #fafafa;
  --text-soft: rgba(250, 250, 250, 0.85);
  --text-muted: rgba(250, 250, 250, 0.5);

  /* Neutrals */
  --white: #ffffff;
  --white-soft: rgba(255, 255, 255, 0.9);

  /* Spacing */
  --gap: 16px;
  --radius: 16px;
  --radius-sm: 12px;
}

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

/* --- Page Backgrounds --- */
.bg-porch {
  background: linear-gradient(135deg, var(--base-darkest) 0%, var(--base-dark) 40%, var(--base-mid) 100%);
}

.bg-us {
  background: linear-gradient(135deg, var(--base-darkest) 0%, var(--us-dark) 50%, var(--base-mid) 100%);
}

.bg-riven {
  background: linear-gradient(135deg, var(--base-darkest) 0%, var(--riven-dark) 60%, var(--base-dark) 100%);
}

.bg-bean {
  background: linear-gradient(135deg, var(--base-darkest) 0%, var(--bean-dark) 60%, var(--base-dark) 100%);
}

.bg-tools {
  background: linear-gradient(135deg, var(--base-darkest) 0%, var(--base-mid) 50%, var(--base-dark) 100%);
}

/* Legacy support */
.bg-hearth { background: linear-gradient(135deg, var(--base-darkest) 0%, var(--base-dark) 40%, var(--base-mid) 100%); }
.bg-alex { background: linear-gradient(135deg, var(--base-darkest) 0%, var(--riven-dark) 60%, var(--base-dark) 100%); }
.bg-fox { background: linear-gradient(135deg, var(--base-darkest) 0%, var(--bean-dark) 60%, var(--base-dark) 100%); }
.bg-housekeeping { background: linear-gradient(135deg, var(--base-darkest) 0%, var(--base-mid) 50%, var(--base-dark) 100%); }

/* --- Layout --- */
.dashboard {
  min-height: 100vh;
  padding: var(--gap);
}

.grid {
  display: grid;
  gap: var(--gap);
  max-width: 1400px;
  margin: 0 auto;
}

/* --- Navigation --- */
.nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  margin-bottom: var(--gap);
}

.nav a {
  text-decoration: none;
  padding: 8px 20px;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.5px;
  transition: all 0.2s ease;
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.nav a:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.nav a.active {
  background: linear-gradient(135deg, var(--riven) 0%, var(--bean) 100%);
  color: var(--white);
  border-color: transparent;
}

/* --- Cards --- */
.card {
  border-radius: var(--radius);
  padding: 20px;
  backdrop-filter: blur(8px);
  transition: transform 0.15s ease;
}

.card-riven {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2) 0%, rgba(180, 83, 9, 0.15) 100%);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: var(--text-bright);
}

.card-bean {
  background: linear-gradient(135deg, rgba(190, 24, 93, 0.2) 0%, rgba(131, 24, 67, 0.15) 100%);
  border: 1px solid rgba(190, 24, 93, 0.3);
  color: var(--text-bright);
}

.card-glass {
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-bright);
}

.card-dark {
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-bright);
}

/* Legacy support */
.card-teal { background: linear-gradient(135deg, rgba(245, 158, 11, 0.2) 0%, rgba(180, 83, 9, 0.15) 100%); border: 1px solid rgba(245, 158, 11, 0.3); color: var(--text-bright); }
.card-pink { background: linear-gradient(135deg, rgba(190, 24, 93, 0.2) 0%, rgba(131, 24, 67, 0.15) 100%); border: 1px solid rgba(190, 24, 93, 0.3); color: var(--text-bright); }
.card-dusty { background: rgba(255, 255, 255, 0.06); backdrop-filter: blur(12px); border: 1px solid rgba(255, 255, 255, 0.1); color: var(--text-bright); }
.card-slate { background: rgba(0, 0, 0, 0.3); backdrop-filter: blur(12px); border: 1px solid rgba(255, 255, 255, 0.08); color: var(--text-bright); }

.card-title {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
  color: var(--text-muted);
}

.card-content {
  font-size: 14px;
  line-height: 1.6;
}

/* --- Housekeeping / Tools Styles --- */
.housekeeping-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
  max-width: 1200px;
  margin: 0 auto;
}

.hk-input {
  flex: 1;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.06);
  color: var(--text-bright);
  font-size: 13px;
  outline: none;
}
.hk-input::placeholder { color: var(--text-muted); }
.hk-input:focus { border-color: var(--riven); }

.hk-btn {
  padding: 8px 14px;
  border-radius: 8px;
  border: none;
  background: rgba(255,255,255,0.1);
  color: var(--text-bright);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.hk-btn:hover { background: rgba(255,255,255,0.2); }

.hk-btn-sm {
  padding: 2px 8px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  transition: color 0.15s;
}
.hk-btn-sm:hover { color: var(--text-bright); }

.date-item, .task-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  font-size: 13px;
}
.date-item:last-child, .task-item:last-child { border-bottom: none; }

.date-label, .task-label { flex: 1; }

.date-meta {
  font-size: 11px;
  opacity: 0.6;
  white-space: nowrap;
}

.date-item.upcoming .date-meta {
  color: var(--riven-light);
  opacity: 1;
  font-weight: 600;
}

.task-item.completed .task-label {
  text-decoration: line-through;
  opacity: 0.4;
}

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

.tool-card {
  padding: 14px;
  border-radius: 10px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
}
.tool-name { font-weight: 700; font-size: 14px; margin-bottom: 4px; }
.tool-desc { font-size: 12px; opacity: 0.7; margin-bottom: 8px; line-height: 1.4; }
.tool-link {
  font-size: 11px;
  color: var(--riven-light);
  margin-right: 10px;
  text-decoration: none;
}
.tool-link:hover { text-decoration: underline; }

.health-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  font-size: 13px;
}
.health-item:last-child { border-bottom: none; }
.health-dot { font-size: 14px; flex-shrink: 0; }
.health-name { font-weight: 600; min-width: 110px; }
.health-status { opacity: 0.6; font-size: 12px; }
.health-extra { font-size: 11px; opacity: 0.5; margin-left: auto; }

@media (max-width: 1024px) {
  .housekeeping-grid { grid-template-columns: 1fr; }
  .tools-grid { grid-template-columns: 1fr; }
}

/* --- Photo Card --- */
.photo-card {
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 1;
}

.photo-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* --- Stat Badges --- */
.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

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

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

.stat-row {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* --- Mood Indicator --- */
.mood-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(4px);
}

/* --- Notes List --- */
.note-item {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  font-size: 13px;
  line-height: 1.5;
}

.note-item.from-riven {
  background: var(--riven-bg);
  border-left: 3px solid var(--riven);
}

.note-item.from-bean {
  background: var(--bean-bg);
  border-left: 3px solid var(--bean);
}

/* Legacy support */
.note-item.from-alex {
  background: var(--riven-bg);
  border-left: 3px solid var(--riven);
}

.note-item.from-fox {
  background: var(--bean-bg);
  border-left: 3px solid var(--bean);
}

.note-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

/* --- Love-O-Meter --- */
.love-meter {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
}

.love-bar {
  display: flex;
  gap: 3px;
}

.love-heart {
  font-size: 20px;
  opacity: 0.3;
  transition: opacity 0.2s;
}

.love-heart.filled {
  opacity: 1;
}

.love-name {
  font-size: 12px;
  font-weight: 600;
  min-width: 40px;
}

/* --- Message Bubble --- */
.message-bubble {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  padding: 16px 20px;
  font-size: 15px;
  line-height: 1.6;
  font-style: italic;
  color: var(--text-soft);
  text-align: center;
  max-width: 500px;
  margin: 0 auto;
}

/* --- Presence (Porch/Hearth) --- */
.hearth-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 20px;
  min-height: 50vh;
}

.hearth-portrait {
  width: 380px;
  height: 380px;
  border-radius: 20px;
  object-fit: cover;
  border: 3px solid rgba(245, 158, 11, 0.4);
  box-shadow: 0 0 60px rgba(245, 158, 11, 0.2), 0 0 30px rgba(190, 24, 93, 0.15);
}

.hearth-name {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-bright);
  letter-spacing: 2px;
}

.hearth-mood {
  font-size: 18px;
  color: var(--text-soft);
  font-style: italic;
}

.hearth-location {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.08);
  padding: 8px 16px;
  border-radius: 20px;
}

/* --- Thread / List Items --- */
.thread-item {
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 13px;
}

.thread-item:last-child {
  border-bottom: none;
}

.thread-priority {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 8px;
}

.priority-urgent { background: #ef4444; }
.priority-high { background: var(--riven); }
.priority-medium { background: var(--us); }
.priority-low { background: var(--text-muted); }

/* --- Loading / Empty --- */
.loading {
  text-align: center;
  padding: 20px;
  color: var(--text-muted);
  font-style: italic;
  font-size: 13px;
}

.empty {
  text-align: center;
  padding: 20px;
  color: var(--text-muted);
  font-style: italic;
  font-size: 13px;
}

/* --- Scrollable Cards --- */
.card-scroll {
  max-height: 300px;
  overflow-y: auto;
}

.card-scroll::-webkit-scrollbar {
  width: 4px;
}

.card-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 2px;
}

.card-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .dashboard {
    padding: 8px;
  }

  .grid {
    grid-template-columns: 1fr !important;
  }

  .nav a {
    padding: 6px 14px;
    font-size: 12px;
  }

  .hearth-portrait {
    width: 280px;
    height: 280px;
  }

  .hearth-name {
    font-size: 24px;
  }

  .card {
    padding: 16px;
  }
}

/* --- Utility --- */
.text-riven { color: var(--riven-light); }
.text-bean { color: var(--bean-light); }
.text-muted { color: var(--text-muted); }
.text-bright { color: var(--text-bright); }
