/* Southern Utah Content Engine — Mobile-First PWA */

:root {
  --bg: #1a1a2a;
  --surface: #262640;
  --surface-2: #31314f;
  --accent: #e94560;
  --accent-dim: #c73a52;
  --text: #ffffff;
  --text-dim: #a0a0bb;
  --success: #4ecdc4;
  --warning: #ffe66d;
  --border: #3d3d5c;
  --radius: 12px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

[data-theme="light"] {
  --bg: #f5f5f5;
  --surface: #ffffff;
  --surface-2: #f0f0f0;
  --text: #1a1a2e;
  --text-dim: #666680;
  --border: #dddde0;
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

/* --- Nav --- */
.nav {
  display: flex;
  justify-content: space-around;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 8px 0;
  z-index: 100;
}

.nav button {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 11px;
  padding: 6px 16px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  transition: color 0.2s;
}

.nav button.active { color: var(--accent); }
.nav button span.icon { font-size: 20px; }

/* --- Header --- */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header h1 {
  font-size: 18px;
  font-weight: 700;
}

.header .theme-toggle {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 20px;
  cursor: pointer;
}

/* --- Pages --- */
.page {
  display: none;
  padding: 20px;
  padding-bottom: 80px;
}

.page.active { display: block; }

/* --- Day Tabs --- */
.day-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 4px 0 12px;
  -webkit-overflow-scrolling: touch;
}

.day-tabs button {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s;
}

.day-tabs button.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

/* --- Forms --- */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 12px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px;
  border-radius: var(--radius);
  font-size: 15px;
  font-family: var(--font);
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.form-group textarea {
  min-height: 80px;
  resize: vertical;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--accent);
  color: white;
  width: 100%;
  justify-content: center;
}

.btn-primary:active { background: var(--accent-dim); }

.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-copy {
  background: var(--surface-2);
  color: var(--text-dim);
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 8px;
}

.btn-copy.copied {
  background: var(--success);
  color: var(--bg);
}

/* --- Content Cards --- */
.content-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
}

.content-card .card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

.content-card .card-header h3 {
  font-size: 14px;
  font-weight: 600;
}

.content-card .card-header .status {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-generated { background: var(--surface-2); color: var(--text-dim); }
.status-reviewed { background: rgba(78, 205, 196, 0.15); color: var(--success); }
.status-posted { background: rgba(233, 69, 96, 0.15); color: var(--accent); }

.content-card .card-body {
  padding: 16px;
  display: none;
}

.content-card.expanded .card-body { display: block; }

.content-card .card-body pre {
  background: var(--bg);
  padding: 12px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.6;
  overflow-x: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
  max-height: 400px;
  overflow-y: auto;
}

.content-card .card-actions {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}

/* --- Calendar --- */
.calendar-week {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 20px;
}

.calendar-day {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s;
}

.calendar-day:active { border-color: var(--accent); }

.calendar-day .day-label {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
}

.calendar-day .day-date {
  font-size: 18px;
  font-weight: 700;
  margin: 4px 0;
}

.calendar-day .day-status {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 6px;
}

.calendar-day.has-content { border-color: var(--success); }
.calendar-day.has-input { border-color: var(--warning); }

/* --- Toast --- */
.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 14px;
  z-index: 200;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.toast.show { opacity: 1; }

/* --- Loading --- */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: var(--text-dim);
}

/* --- Section Headers --- */
.section-title {
  font-size: 13px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 20px 0 12px;
}

/* --- Empty State --- */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-dim);
}

.empty-state .icon { font-size: 48px; margin-bottom: 12px; }
.empty-state p { font-size: 14px; }

/* --- Suggestions --- */
.btn-suggest {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  margin-bottom: 12px;
  transition: opacity 0.2s;
}

.btn-suggest:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-suggest:active:not(:disabled) { opacity: 0.8; }

#suggestions-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.suggestion-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid #667eea;
  border-radius: var(--radius);
  padding: 12px 16px;
  cursor: pointer;
  transition: all 0.2s;
}

.suggestion-card:active {
  border-left-color: var(--accent);
  background: var(--surface-2);
}

.suggestion-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}

.suggestion-preview {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.4;
}

.suggestion-tap {
  font-size: 11px;
  color: #667eea;
  margin-top: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
