/* =========================================================
   SAKURA WISHLIST & BUDGET TRACKER — STYLESHEET
   Theme: soft pink / cherry blossom, cozy & flat design
   ========================================================= */

/* ---------- Design tokens (edit these to re-theme the site) ---------- */
:root {
  --cream: #fff8f2;          /* page background */
  --blush: #ffeef1;          /* card background */
  --pink: #f9d7de;           /* soft pink accent */
  --rose: #d98b9b;           /* muted rose — primary accent */
  --rose-dark: #c06e82;      /* deeper rose — buttons/hover */
  --brown: #8a6f63;          /* light brown accent text */
  --text-dark: #5b4740;      /* main text color */
  --text-soft: #9c8880;      /* secondary/muted text */
  --green: #a3c2a0;          /* subtle green accent (success/progress) */
  --white: #ffffff;
  --shadow: 0 4px 14px rgba(184, 130, 145, 0.15);
  --radius: 18px;
  --radius-sm: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Nunito', sans-serif;
  background: var(--cream);
  color: var(--text-dark);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

h1, h2, h3 {
  font-family: 'Quicksand', sans-serif;
  color: var(--text-dark);
  margin: 0 0 6px 0;
}

/* ---------- Subtle floating sakura petals (decorative background) ---------- */
.petals {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.petal {
  position: absolute;
  top: -40px;
  font-size: 22px;
  opacity: 0.25;
  animation: fall 18s linear infinite;
}

.petal:nth-child(1) { left: 8%;  animation-delay: 0s;  font-size: 18px; }
.petal:nth-child(2) { left: 28%; animation-delay: 4s;  font-size: 24px; }
.petal:nth-child(3) { left: 52%; animation-delay: 8s;  font-size: 16px; }
.petal:nth-child(4) { left: 74%; animation-delay: 2s;  font-size: 20px; }
.petal:nth-child(5) { left: 90%; animation-delay: 11s; font-size: 22px; }

@keyframes fall {
  0%   { transform: translateY(-5vh) rotate(0deg);   opacity: 0; }
  10%  { opacity: 0.3; }
  90%  { opacity: 0.3; }
  100% { transform: translateY(105vh) rotate(200deg); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .petal { animation: none; display: none; }
}

/* ---------- Top navigation ---------- */
.topbar {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 32px;
  background: var(--white);
  box-shadow: 0 2px 10px rgba(184, 130, 145, 0.1);
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Quicksand', sans-serif;
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--rose-dark);
}

.brand-emoji { font-size: 1.5rem; }

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tab-btn {
  border: none;
  background: var(--blush);
  color: var(--brown);
  font-family: 'Quicksand', sans-serif;
  font-weight: 600;
  font-size: 0.92rem;
  padding: 9px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.tab-btn:hover {
  background: var(--pink);
  transform: translateY(-1px);
}

.tab-btn.active {
  background: var(--rose);
  color: var(--white);
}

/* ---------- Page layout ---------- */
.page-wrap {
  position: relative;
  z-index: 1;
  max-width: 1080px;
  margin: 0 auto;
  padding: 32px 24px 60px;
}

.page { display: none; }
.page.active { display: block; animation: fadeIn 0.25s ease; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.page-title { font-size: 1.7rem; }
.page-subtitle {
  color: var(--text-soft);
  margin-bottom: 26px;
  font-size: 0.98rem;
}

/* ---------- Card grids ---------- */
.card-grid {
  display: grid;
  gap: 18px;
  margin-bottom: 28px;
}

.card-grid.four { grid-template-columns: repeat(4, 1fr); }
.card-grid.three { grid-template-columns: repeat(3, 1fr); }

@media (max-width: 900px) {
  .card-grid.four { grid-template-columns: repeat(2, 1fr); }
  .card-grid.three { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .card-grid.four,
  .card-grid.three { grid-template-columns: 1fr; }
}

/* ---------- Summary cards (dashboard) ---------- */
.summary-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  text-align: center;
  border: 1px solid rgba(217, 139, 155, 0.12);
}

.summary-label {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-soft);
  font-weight: 600;
}

.summary-value {
  margin: 6px 0 2px;
  font-family: 'Quicksand', sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--rose-dark);
}

.summary-hint {
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-soft);
}

/* ---------- Panels (generic soft container) ---------- */
.panel {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 24px;
  border: 1px solid rgba(217, 139, 155, 0.1);
}

.panel-title { font-size: 1.15rem; }
.panel-hint { color: var(--text-soft); font-size: 0.88rem; margin: 0 0 14px; }
.panel-hint.small { font-size: 0.8rem; margin-bottom: 10px; }
.mini-title { font-size: 1rem; margin-top: 22px; }

.dash-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
@media (max-width: 800px) {
  .dash-columns { grid-template-columns: 1fr; }
}

/* ---------- Inputs & forms ---------- */
.input-row {
  display: flex;
  align-items: center;
  background: var(--blush);
  border-radius: var(--radius-sm);
  padding: 4px 12px;
  max-width: 220px;
}

.input-prefix { color: var(--rose-dark); font-weight: 700; margin-right: 4px; }

input[type="text"],
input[type="number"],
input[type="date"],
select,
textarea {
  width: 100%;
  border: 1px solid #f0d8dd;
  background: var(--blush);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-family: 'Nunito', sans-serif;
  font-size: 0.92rem;
  color: var(--text-dark);
  outline: none;
  transition: border 0.2s ease;
}

.input-row input[type="number"] {
  border: none;
  background: transparent;
  padding: 8px 4px;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--rose);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

@media (max-width: 640px) {
  .form-grid { grid-template-columns: 1fr; }
}

.field { display: flex; flex-direction: column; gap: 5px; }
.field.wide { grid-column: 1 / -1; }

.field label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--brown);
}

/* ---------- Buttons ---------- */
.btn-primary {
  background: var(--rose);
  color: var(--white);
  border: none;
  font-family: 'Quicksand', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 11px 18px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
  margin-top: 4px;
}

.btn-primary:hover {
  background: var(--rose-dark);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--blush);
  color: var(--rose-dark);
  border: 1px solid var(--pink);
  font-family: 'Quicksand', sans-serif;
  font-weight: 700;
  font-size: 0.82rem;
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.btn-secondary:hover { background: var(--pink); }

.btn-danger {
  background: transparent;
  color: var(--text-soft);
  border: 1px solid #eadadc;
  font-family: 'Nunito', sans-serif;
  font-size: 0.78rem;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.2s ease, border 0.2s ease;
}

.btn-danger:hover { color: #b5545f; border-color: #e6b9c0; }

/* ---------- Filter bar ---------- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
  background: var(--white);
  padding: 16px 20px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.filter-bar .field { min-width: 160px; flex: 1; }

/* ---------- Wishlist item cards ---------- */
.item-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid rgba(217, 139, 155, 0.1);
}

.item-image {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: var(--blush);
}

.item-name {
  font-family: 'Quicksand', sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
}

.item-meta {
  font-size: 0.82rem;
  color: var(--text-soft);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  font-family: 'Quicksand', sans-serif;
}

.pill.category { background: var(--blush); color: var(--brown); }
.pill.priority-high { background: #f8d3da; color: #b5455e; }
.pill.priority-medium { background: #fbe6cf; color: #a9752f; }
.pill.priority-low { background: #e3eede; color: #5c7a52; }
.pill.status-want { background: #eee3f5; color: #7a5ba0; }
.pill.status-saving { background: #fdeccb; color: #9c7318; }
.pill.status-purchased { background: #dcefdc; color: #4c8253; }

.item-price {
  font-family: 'Quicksand', sans-serif;
  font-weight: 700;
  color: var(--rose-dark);
  font-size: 1.1rem;
}

.item-notes {
  font-size: 0.84rem;
  color: var(--text-soft);
  font-style: italic;
}

.item-store a { color: var(--rose-dark); text-decoration: none; font-size: 0.85rem; }
.item-store a:hover { text-decoration: underline; }

.item-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
  padding-top: 8px;
  flex-wrap: wrap;
}

/* ---------- Priority preview list (dashboard) ---------- */
.priority-list { display: flex; flex-direction: column; gap: 10px; }

.priority-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--blush);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
}

.priority-row .name { font-weight: 700; font-size: 0.9rem; }
.priority-row .price { color: var(--rose-dark); font-weight: 700; font-size: 0.9rem; }

/* ---------- Suggested breakdown list (dashboard) ---------- */
.breakdown-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }

.breakdown-list li {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
  background: var(--blush);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
}

.breakdown-list .b-label { color: var(--text-dark); font-weight: 600; }
.breakdown-list .b-value { color: var(--rose-dark); font-weight: 700; }

/* ---------- Budget planner cards ---------- */
.budget-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.budget-card h3 { font-size: 1rem; }

.budget-card .amount {
  font-family: 'Quicksand', sans-serif;
  font-weight: 700;
  color: var(--rose-dark);
  font-size: 1.2rem;
}

.percent-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.percent-row input { width: 70px; }

/* ---------- Progress bars (savings goals) ---------- */
.goal-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.progress-track {
  width: 100%;
  height: 14px;
  background: var(--blush);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--rose), var(--green));
  border-radius: 999px;
  transition: width 0.3s ease;
}

.goal-numbers {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--text-soft);
}

.goal-add-row {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.goal-add-row input { flex: 1; }

/* ---------- Empty state message ---------- */
.empty-msg {
  text-align: center;
  color: var(--text-soft);
  font-style: italic;
  padding: 30px 0;
}

/* ---------- Footer ---------- */
.footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 18px;
  color: var(--text-soft);
  font-size: 0.82rem;
}