/* TotPlanner - Stylesheet */

:root {
  --primary: #6c63ff;
  --primary-dark: #4e46e5;
  --secondary: #ff6584;
  --accent: #43e97b;
  --bg: #f7f8fc;
  --card: #ffffff;
  --text: #2d3748;
  --text-muted: #718096;
  --border: #e2e8f0;
  --radius: 12px;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ── Header ───────────────────────────────────────────────────────────────── */
.header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.logo { display: flex; align-items: center; gap: 0.5rem; text-decoration: none; }
.logo-icon { font-size: 1.75rem; }
.logo-text { font-size: 1.25rem; font-weight: 700; color: var(--primary); }
.nav { display: flex; gap: 0.5rem; flex: 1; }
.nav-btn {
  background: none;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--text-muted);
  transition: all 0.2s;
}
.nav-btn:hover, .nav-btn.active {
  background: var(--primary);
  color: #fff;
}
.weather-widget {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* ── Views ────────────────────────────────────────────────────────────────── */
main { max-width: 1200px; margin: 0 auto; padding: 1.5rem; }
.view { display: none; }
.view.active { display: block; }
.view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.view-header h1 { font-size: 1.5rem; font-weight: 700; }
.view-actions { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; }

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 1.25rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  transition: all 0.2s;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--border); color: var(--text); }
.btn-secondary:hover { background: #cbd5e0; }
.btn-danger { background: #fc8181; color: #fff; }
.btn-danger:hover { background: #f56565; }
.icon-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  font-size: 1.25rem;
  color: var(--text-muted);
  transition: all 0.2s;
}
.icon-btn:hover { background: var(--border); }

/* ── Inputs ───────────────────────────────────────────────────────────────── */
.search-input, .select-input {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.875rem;
  background: var(--card);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
}
.search-input:focus, .select-input:focus { border-color: var(--primary); }

/* ── Date Nav ─────────────────────────────────────────────────────────────── */
.date-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.date-nav h2 { font-size: 1.125rem; font-weight: 600; min-width: 200px; text-align: center; }

/* ── Cards ────────────────────────────────────────────────────────────────── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: transform 0.2s, box-shadow 0.2s;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.card-title { font-size: 1rem; font-weight: 700; margin-bottom: 0.375rem; }
.card-meta { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.5rem; }
.card-body { font-size: 0.875rem; color: var(--text-muted); line-height: 1.5; }
.card-actions { margin-top: 1rem; display: flex; gap: 0.5rem; }
.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--primary);
  color: #fff;
  margin-right: 0.25rem;
}
.badge-green { background: var(--accent); color: #1a4731; }
.badge-orange { background: #f6ad55; color: #7b341e; }

/* ── Activity List ────────────────────────────────────────────────────────── */
.activity-item {
  background: var(--card);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--primary);
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}
.activity-time {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary);
  min-width: 70px;
}
.activity-info { flex: 1; }
.activity-name { font-weight: 700; margin-bottom: 0.25rem; }
.activity-desc { font-size: 0.875rem; color: var(--text-muted); }

/* ── Empty State ──────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}
.empty-icon { font-size: 3rem; display: block; margin-bottom: 1rem; }
.empty-state p { margin-bottom: 1rem; }

/* ── Loading ──────────────────────────────────────────────────────────────── */
.loading { text-align: center; padding: 2rem; color: var(--text-muted); }

/* ── Modal ────────────────────────────────────────────────────────────────── */
.modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center;
  z-index: 200;
  padding: 1rem;
}
.modal.hidden { display: none; }
.modal-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 2rem;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
}
.modal-card h3 { font-size: 1.25rem; font-weight: 700; margin-bottom: 1.25rem; }
.modal-card label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 1rem;
}
.modal-card label input, .modal-card label select {
  display: block;
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.875rem;
  outline: none;
}
.modal-card label input:focus { border-color: var(--primary); }
.form-actions { display: flex; gap: 0.75rem; justify-content: flex-end; margin-top: 0.5rem; }

/* ── Chat ─────────────────────────────────────────────────────────────────── */
.chat-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 220px);
  min-height: 400px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  overflow: hidden;
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.chat-bubble {
  max-width: 75%;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  font-size: 0.875rem;
  line-height: 1.5;
}
.chat-bubble.user {
  background: var(--primary);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.chat-bubble.assistant {
  background: var(--bg);
  color: var(--text);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  border: 1px solid var(--border);
}
.chat-form {
  display: flex;
  gap: 0.75rem;
  padding: 1rem;
  border-top: 1px solid var(--border);
}
.chat-input {
  flex: 1;
  padding: 0.625rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.875rem;
  outline: none;
}
.chat-input:focus { border-color: var(--primary); }

/* ── Toast ────────────────────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 300;
}
.toast {
  background: var(--text);
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: 10px;
  font-size: 0.875rem;
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.3s ease;
}
.toast.success { background: #38a169; }
.toast.error { background: #e53e3e; }
@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .header-inner { flex-wrap: wrap; }
  .nav { gap: 0.25rem; }
  .nav-btn { padding: 0.4rem 0.6rem; font-size: 0.75rem; }
  .view-header { flex-direction: column; align-items: flex-start; }
  .card-grid { grid-template-columns: 1fr; }
}
