@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800&family=Baloo+2:wght@500;600;700;800&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg-dark: #1a1a2e;
  --bg-medium: #16213e;
  --bg-card: #0f3460;
  --bg-card-hover: #134b8a;
  --bg-warm: #2c1810;

  --yellow-soft: #f6d365;
  --yellow-glow: #fda085;
  --blue-soft: #a8c0ff;
  --blue-light: #dfe7fd;
  --star-white: #f5f5f5;
  --moon-cream: #faf3e0;

  --success: #7ec8a0;
  --danger: #e87461;

  --radius: 16px;
  --radius-sm: 8px;
  --radius-round: 50%;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 30px rgba(246, 211, 101, 0.15);

  --font-body: 'Nunito', system-ui, -apple-system, sans-serif;
  --font-display: 'Baloo 2', cursive;
}

html { font-size: 16px; }

body {
  font-family: var(--font-body);
  background: var(--bg-dark);
  color: var(--star-white);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 1.8rem; }
h3 { font-size: 1.3rem; }

a { color: var(--yellow-soft); text-decoration: none; }
a:hover { color: var(--yellow-glow); }

/* Stars background */
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background:
    radial-gradient(2px 2px at 20% 30%, rgba(255,255,255,0.3), transparent),
    radial-gradient(2px 2px at 40% 70%, rgba(255,255,255,0.2), transparent),
    radial-gradient(1px 1px at 60% 20%, rgba(255,255,255,0.4), transparent),
    radial-gradient(1px 1px at 80% 50%, rgba(255,255,255,0.2), transparent),
    radial-gradient(2px 2px at 10% 80%, rgba(255,255,255,0.3), transparent),
    radial-gradient(1px 1px at 50% 40%, rgba(255,255,255,0.3), transparent),
    radial-gradient(1px 1px at 70% 90%, rgba(255,255,255,0.2), transparent),
    radial-gradient(2px 2px at 90% 10%, rgba(255,255,255,0.2), transparent);
  pointer-events: none;
  z-index: 0;
}

body > * { position: relative; z-index: 1; }

/* Navigation */
.app-nav {
  background: rgba(22, 33, 62, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(168, 192, 255, 0.1);
  padding: 0.75rem 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.nav-brand {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--yellow-soft);
  white-space: nowrap;
}

.nav-links {
  display: flex;
  gap: 0.25rem;
}

.nav-links a {
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-sm);
  color: var(--blue-light);
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.nav-links a:hover { background: rgba(168, 192, 255, 0.1); color: var(--star-white); }
.nav-links a.active { background: rgba(246, 211, 101, 0.15); color: var(--yellow-soft); }

.nav-member {
  font-size: 0.85rem;
  color: var(--moon-cream);
  opacity: 0.8;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--yellow-soft), var(--yellow-glow));
  color: #1a1a2e;
  box-shadow: 0 4px 15px rgba(246, 211, 101, 0.3);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(246, 211, 101, 0.4); }

.btn-secondary {
  background: rgba(168, 192, 255, 0.15);
  color: var(--blue-light);
  border: 1px solid rgba(168, 192, 255, 0.2);
}
.btn-secondary:hover { background: rgba(168, 192, 255, 0.25); }

.btn-danger {
  background: rgba(232, 116, 97, 0.15);
  color: var(--danger);
  border: 1px solid rgba(232, 116, 97, 0.2);
}
.btn-danger:hover { background: rgba(232, 116, 97, 0.25); }

.btn-large { padding: 1rem 2.5rem; font-size: 1.2rem; border-radius: 24px; }

.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* Cards */
.card {
  background: rgba(15, 52, 96, 0.6);
  border: 1px solid rgba(168, 192, 255, 0.1);
  border-radius: var(--radius);
  padding: 1.5rem;
  backdrop-filter: blur(5px);
}

.card-glow {
  box-shadow: var(--shadow-glow);
}

/* Forms */
.form-group { margin-bottom: 1rem; }

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--moon-cream);
  font-size: 0.9rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(168, 192, 255, 0.2);
  border-radius: var(--radius-sm);
  color: var(--star-white);
  font-family: var(--font-body);
  font-size: 1rem;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--yellow-soft);
  box-shadow: 0 0 0 3px rgba(246, 211, 101, 0.15);
}

.form-group input::placeholder { color: rgba(255, 255, 255, 0.3); }

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem;
}

.page-header {
  text-align: center;
  margin-bottom: 2rem;
}

.page-header h1 { margin-bottom: 0.5rem; }
.page-header p { color: var(--moon-cream); opacity: 0.8; }

/* Grid */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1rem; }

/* Stat cards */
.stat-card {
  text-align: center;
  padding: 1.25rem;
}

.stat-number {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--yellow-soft);
  line-height: 1;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--moon-cream);
  opacity: 0.8;
  margin-top: 0.25rem;
}

/* Checklist */
.checklist-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s;
}

.checklist-item:hover { background: rgba(255, 255, 255, 0.05); }

.checklist-check {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  border: 2px solid rgba(168, 192, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  flex-shrink: 0;
}

.checklist-item.completed .checklist-check {
  background: var(--success);
  border-color: var(--success);
}

.checklist-item.completed .checklist-check::after {
  content: '';
  width: 8px;
  height: 14px;
  border: solid #1a1a2e;
  border-width: 0 3px 3px 0;
  transform: rotate(45deg);
  margin-bottom: 3px;
}

.checklist-label {
  font-size: 1rem;
  font-weight: 600;
  transition: opacity 0.2s;
}

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

/* Timeline */
.timeline { display: flex; flex-direction: column; gap: 0; }

.timeline-entry {
  display: flex;
  gap: 1rem;
  padding: 1rem 0;
  border-left: 2px solid rgba(168, 192, 255, 0.15);
  margin-left: 1rem;
  padding-left: 1.5rem;
  position: relative;
}

.timeline-entry::before {
  content: '';
  position: absolute;
  left: -6px;
  top: 1.25rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--blue-soft);
}

.timeline-entry[data-type="story"]::before { background: var(--yellow-soft); }
.timeline-entry[data-type="joke"]::before { background: var(--yellow-glow); }
.timeline-entry[data-type="milestone"]::before { background: var(--success); }

.timeline-date {
  font-size: 0.8rem;
  color: var(--moon-cream);
  opacity: 0.6;
  white-space: nowrap;
}

.timeline-content { font-size: 0.95rem; }

/* Toast */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--bg-card);
  color: var(--star-white);
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  border: 1px solid rgba(168, 192, 255, 0.2);
  font-weight: 600;
  z-index: 1000;
  transition: transform 0.3s ease;
  pointer-events: none;
}

.toast.show { transform: translateX(-50%) translateY(0); }

/* Loading spinner */
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(168, 192, 255, 0.2);
  border-top-color: var(--yellow-soft);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 2rem auto;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Fade in */
.fade-in {
  animation: fadeIn 0.4s ease;
}

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

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 1rem;
}

.modal {
  background: var(--bg-medium);
  border: 1px solid rgba(168, 192, 255, 0.15);
  border-radius: var(--radius);
  padding: 2rem;
  max-width: 500px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
}

.modal h2 { margin-bottom: 1rem; }

.modal-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
  justify-content: flex-end;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--moon-cream);
  opacity: 0.6;
}

.empty-state p { font-size: 1.1rem; }

/* Responsive */
@media (max-width: 768px) {
  h1 { font-size: 1.8rem; }
  h2 { font-size: 1.4rem; }
  .container { padding: 1rem; }
  .nav-links a { padding: 0.3rem 0.5rem; font-size: 0.8rem; }
  .nav-brand { font-size: 1.1rem; }
  .btn-large { padding: 0.85rem 1.5rem; font-size: 1rem; }
}

@media (max-width: 480px) {
  .nav-inner { flex-wrap: wrap; justify-content: center; }
  .nav-links { width: 100%; justify-content: center; }
  .nav-user { display: none; }
}
