/*
  Family Planer — Main Stylesheet
  Design: Verspielt & bunt / Notion meets Canva
  Partner-Farben: Violett (#7c3aed) + Rose (#f43f5e) — konfigurierbar via Settings
*/

:root {
  --primary:        #7c3aed;
  --primary-light:  #ede9fe;
  --primary-mid:    #a78bfa;
  --partner1:       #7c3aed;
  --partner1-light: #ede9fe;
  --partner2:       #f43f5e;
  --partner2-light: #ffe4e9;
  --accent:         #f59e0b;
  --accent-light:   #fef3c7;
  --green:          #10b981;
  --green-light:    #d1fae5;
  --blue:           #3b82f6;
  --blue-light:     #dbeafe;
  --bg:             #f5f3ff;
  --bg-card:        #ffffff;
  --text:           #1e1b4b;
  --text-muted:     #6b7280;
  --text-light:     #9ca3af;
  --border:         #e5e7eb;
  --border-light:   #f3f4f6;
  --shadow-sm:      0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow:         0 4px 16px rgba(0,0,0,.08), 0 1px 4px rgba(0,0,0,.04);
  --shadow-lg:      0 12px 40px rgba(0,0,0,.12), 0 4px 12px rgba(0,0,0,.06);
  --radius:         16px;
  --radius-sm:      10px;
  --radius-lg:      24px;
  --nav-width:      240px;
}

/* ─── RESET ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
h1,h2,h3,h4,h5 { font-family: 'Nunito', sans-serif; }
button { font-family: inherit; }
img { max-width: 100%; }

/* ─── SIDEBAR ────────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--nav-width);
  background: white;
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform 300ms ease;
  box-shadow: var(--shadow-sm);
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
}
.sidebar-logo {
  font-family: 'Nunito', sans-serif;
  font-weight: 900;
  font-size: 20px;
  color: var(--primary);
  padding: 8px 12px 24px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-logo-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--primary), #a855f7);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.sidebar-section {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-light);
  padding: 4px 12px 8px;
  margin-top: 8px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 150ms ease;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 2px;
}
.nav-item:hover { background: var(--bg); color: var(--text); }
.nav-item.active { background: var(--primary-light); color: var(--primary); }
.nav-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  background: var(--border-light);
  flex-shrink: 0;
  transition: background 150ms ease;
}
.nav-item.active .nav-icon { background: var(--primary); }
.nav-item:hover:not(.active) .nav-icon { background: var(--border); }
.sidebar-bottom {
  margin-top: auto;
  border-top: 1px solid var(--border-light);
  padding-top: 16px;
}
.partner-pills { display: flex; gap: 6px; padding: 4px 8px; margin-bottom: 12px; }
.partner-pill {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: 20px;
  font-size: 12px; font-weight: 700; flex: 1; justify-content: center;
}
.partner-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* ─── MAIN CONTENT ───────────────────────────────────────────────────────── */
.main {
  flex: 1;
  margin-left: var(--nav-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
@media (max-width: 768px) { .main { margin-left: 0; } }

/* Layout wrapper (sidebar + main) */
body > nav.sidebar ~ main.main { /* default layout */ }

/* ─── TOPBAR (MOBILE) ────────────────────────────────────────────────────── */
.topbar {
  background: white;
  border-bottom: 1px solid var(--border-light);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky; top: 0; z-index: 50;
}
@media (min-width: 769px) { .topbar { display: none; } }
.hamburger {
  width: 40px; height: 40px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 5px; cursor: pointer; border-radius: 8px; background: var(--border-light);
}
.hamburger span { display: block; width: 20px; height: 2px; background: var(--text); border-radius: 2px; }

/* ─── CONTENT AREA ───────────────────────────────────────────────────────── */
.content { padding: 32px 28px; flex: 1; }
@media (max-width: 768px) { .content { padding: 20px 16px; } }

/* ─── PAGE HEADER ────────────────────────────────────────────────────────── */
.page-header { margin-bottom: 28px; }
.page-greeting {
  font-family: 'Nunito', sans-serif;
  font-size: 28px;
  font-weight: 900;
  color: var(--text);
  margin-bottom: 4px;
}
.page-subtitle { color: var(--text-muted); font-size: 14px; }

/* ─── CARDS ──────────────────────────────────────────────────────────────── */
.card {
  background: white;
  border-radius: var(--radius);
  padding: 22px 20px;
  box-shadow: var(--shadow-sm);
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px;
}
.card-title {
  font-family: 'Nunito', sans-serif;
  font-size: 16px; font-weight: 800; color: var(--text);
  display: flex; align-items: center; gap: 8px;
}
.card-action { font-size: 13px; font-weight: 600; color: var(--primary); cursor: pointer; }
.card-action:hover { text-decoration: underline; }

/* ─── STATS ROW ──────────────────────────────────────────────────────────── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
@media (min-width: 640px) { .stats-row { grid-template-columns: repeat(4, 1fr); } }
.stat-card {
  background: white;
  border-radius: var(--radius);
  padding: 18px 16px;
  box-shadow: var(--shadow-sm);
  transition: transform 200ms ease, box-shadow 200ms ease;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-icon {
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; margin-bottom: 12px;
}
.stat-value {
  font-family: 'Nunito', sans-serif;
  font-size: 26px; font-weight: 900; line-height: 1; margin-bottom: 4px;
}
.stat-label { font-size: 12px; color: var(--text-muted); font-weight: 500; }

/* ─── DASHBOARD GRID ─────────────────────────────────────────────────────── */
.dashboard-grid { display: grid; grid-template-columns: 1fr; gap: 20px; }
@media (min-width: 900px) { .dashboard-grid { grid-template-columns: 1fr 340px; } }

/* ─── WEEK STRIP ─────────────────────────────────────────────────────────── */
.week-strip {
  display: flex; gap: 6px; margin-bottom: 24px;
  overflow-x: auto; padding-bottom: 4px;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.week-strip::-webkit-scrollbar { display: none; }
.day-chip {
  flex-shrink: 0;
  display: flex; flex-direction: column; align-items: center;
  padding: 10px 14px; border-radius: var(--radius-sm);
  background: white; border: 1.5px solid transparent;
  cursor: pointer; transition: all 150ms ease; min-width: 56px;
}
.day-chip:hover { border-color: var(--primary-mid); }
.day-chip.today { background: var(--primary); color: white; }
.day-name {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text-muted); margin-bottom: 4px;
}
.day-chip.today .day-name { color: rgba(255,255,255,.8); }
.day-num { font-family: 'Nunito', sans-serif; font-size: 20px; font-weight: 800; line-height: 1; }

/* ─── EVENT LIST ─────────────────────────────────────────────────────────── */
.event-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--border-light);
}
.event-item:last-child { border-bottom: none; padding-bottom: 0; }
.event-item:first-child { padding-top: 0; }
.event-color-bar {
  width: 4px; border-radius: 4px; align-self: stretch; min-height: 40px; flex-shrink: 0;
}
.event-info { flex: 1; }
.event-title { font-weight: 600; font-size: 14px; margin-bottom: 3px; }
.event-meta {
  font-size: 12px; color: var(--text-muted);
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.event-badge {
  padding: 2px 8px; border-radius: 20px;
  font-size: 11px; font-weight: 700;
}

/* ─── SHOPPING LIST ──────────────────────────────────────────────────────── */
.shopping-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--border-light); font-size: 14px;
}
.shopping-item:last-of-type { border-bottom: none; }
.shopping-check {
  width: 20px; height: 20px; border-radius: 6px;
  border: 2px solid var(--border); flex-shrink: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 150ms ease;
}
.shopping-check.done {
  background: var(--green); border-color: var(--green); color: white; font-size: 12px;
}
.shopping-check.done::after { content: '✓'; }
.shopping-text { flex: 1; font-weight: 500; }
.shopping-text.done { text-decoration: line-through; color: var(--text-light); }
.shopping-qty {
  font-size: 12px; color: var(--text-muted);
  background: var(--border-light); padding: 2px 8px; border-radius: 20px; font-weight: 600;
}

/* ─── TASK LIST ──────────────────────────────────────────────────────────── */
.task-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid var(--border-light); font-size: 14px;
}
.task-item:last-child { border-bottom: none; }
.task-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.task-text { flex: 1; font-weight: 500; }

/* ─── PHOTO STRIP ────────────────────────────────────────────────────────── */
.photo-strip { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
.photo-strip::-webkit-scrollbar { display: none; }
.photo-thumb {
  width: 72px; height: 72px; border-radius: 10px;
  background: linear-gradient(135deg, #ede9fe, #fce7f3);
  flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  font-size: 28px; cursor: pointer; transition: transform 150ms ease;
  overflow: hidden;
}
.photo-thumb:hover { transform: scale(1.05); }
.photo-thumb.add {
  border: 2px dashed var(--border); background: var(--border-light);
  font-size: 22px; color: var(--text-light); font-weight: 700;
}

/* ─── FORMS ──────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block; font-size: 13px; font-weight: 600; color: var(--text-muted);
  margin-bottom: 6px; text-transform: uppercase; letter-spacing: .04em;
}
.form-input {
  width: 100%; padding: 13px 16px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif; font-size: 15px; color: var(--text);
  background: var(--border-light); transition: all 200ms ease; outline: none;
}
.form-input:focus {
  border-color: var(--primary); background: white;
  box-shadow: 0 0 0 3px var(--primary-light);
}

.btn-primary {
  width: 100%; padding: 15px;
  background: linear-gradient(135deg, var(--primary), #a855f7);
  color: white; border: none; border-radius: var(--radius-sm);
  font-family: 'Nunito', sans-serif; font-size: 16px; font-weight: 800;
  cursor: pointer; transition: all 200ms ease; letter-spacing: .02em;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(124,58,237,.35);
}
.btn-primary:active { transform: translateY(0); }

.btn-add {
  width: 100%; margin-top: 14px; padding: 10px;
  border: 1.5px dashed var(--border); border-radius: var(--radius-sm);
  background: none; color: var(--text-muted); font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all 150ms ease;
}
.btn-add:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }

.input-add { display: flex; gap: 8px; margin-top: 14px; }
.input-add input {
  flex: 1; padding: 10px 14px; border: 1.5px solid var(--border);
  border-radius: 8px; font-family: 'Inter', sans-serif; font-size: 14px;
  outline: none; transition: border-color 150ms ease; background: var(--border-light);
}
.input-add input:focus { border-color: var(--primary); background: white; }
.input-add button {
  padding: 10px 16px; background: var(--primary); color: white;
  border: none; border-radius: 8px; font-weight: 700; cursor: pointer;
  font-size: 18px; transition: background 150ms ease;
}
.input-add button:hover { background: #6d28d9; }

/* OAuth buttons */
.oauth-btn {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  width: 100%; padding: 14px 20px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--border); background: white;
  font-size: 15px; font-weight: 600; color: var(--text);
  cursor: pointer; transition: all 200ms ease; margin-bottom: 12px;
}
.oauth-btn:hover {
  border-color: var(--primary); background: var(--primary-light);
  transform: translateY(-1px); box-shadow: var(--shadow-sm);
}
.divider {
  display: flex; align-items: center; gap: 12px;
  margin: 20px 0; color: var(--text-light); font-size: 13px;
}
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ─── FAB ────────────────────────────────────────────────────────────────── */
.fab {
  position: fixed; bottom: 28px; right: 28px;
  width: 56px; height: 56px;
  background: linear-gradient(135deg, var(--primary), #a855f7);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; color: white; cursor: pointer;
  box-shadow: 0 8px 24px rgba(124,58,237,.4);
  transition: all 200ms ease; z-index: 200; border: none;
}
.fab:hover { transform: scale(1.1) rotate(90deg); box-shadow: 0 12px 32px rgba(124,58,237,.5); }
@media (max-width: 768px) { .fab { bottom: 88px; } }

/* ─── BOTTOM NAV (MOBILE) ────────────────────────────────────────────────── */
.bottom-nav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0;
  background: white; border-top: 1px solid var(--border-light);
  padding: 8px 4px calc(8px + env(safe-area-inset-bottom));
  z-index: 100; box-shadow: 0 -4px 16px rgba(0,0,0,.06);
}
@media (max-width: 768px) { .bottom-nav { display: flex; } }
.bottom-nav-items { display: flex; justify-content: space-around; width: 100%; }
.bottom-nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 4px 12px; cursor: pointer; border-radius: 10px;
  transition: all 150ms ease; font-size: 10px; font-weight: 700;
  color: var(--text-muted);
}
.bottom-nav-item.active { color: var(--primary); }
.bottom-nav-icon { font-size: 22px; }

/* ─── OVERLAY ────────────────────────────────────────────────────────────── */
.overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.4); z-index: 99;
}
.overlay.active { display: block; }

/* ─── BADGES ─────────────────────────────────────────────────────────────── */
.badge-new {
  display: inline-block; background: var(--partner2); color: white;
  font-size: 10px; font-weight: 800; padding: 2px 7px;
  border-radius: 20px; margin-left: 4px;
}

/* ─── MOBILE PADDING ─────────────────────────────────────────────────────── */
@media (max-width: 768px) { .main { padding-bottom: 80px; } }
