/* ClipFeed App Styles — matches landing page design tokens */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=DM+Sans:ital,wght@0,400;0,500;1,400&display=swap');

:root {
  --bg: #0a0a0a;
  --bg-elevated: #141414;
  --bg-card: #1a1a1a;
  --fg: #f5f5f0;
  --fg-muted: #8a8a7a;
  --fg-dim: #555548;
  --accent: #e8c547;
  --accent-hover: #f0d060;
  --red: #c44b3f;
  --stripe: #1e1e1e;
  --border: #2a2a2a;
  --radius: 12px;
  --max-w: 1100px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: 'DM Sans', sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* ── NAV ── */
.app-nav {
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-brand {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--fg);
  text-decoration: none;
}
.nav-brand em { font-style: normal; color: var(--accent); }
.nav-back {
  font-size: 0.85rem;
  color: var(--fg-muted);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s;
}
.nav-back:hover { color: var(--fg); }

/* ── LAYOUT ── */
.app-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: calc(100vh - 60px);
}

/* ── SIDEBAR ── */
.sidebar {
  background: var(--bg-elevated);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}
.sidebar-header {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sidebar-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--fg-dim);
}
.btn-add {
  background: var(--accent);
  color: #0a0a0a;
  border: none;
  border-radius: 8px;
  padding: 6px 12px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-add:hover { background: var(--accent-hover); }
.client-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}
.client-item {
  padding: 12px 20px;
  cursor: pointer;
  transition: background 0.15s;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-left: 3px solid transparent;
}
.client-item:hover { background: rgba(255,255,255,0.04); }
.client-item.active {
  background: rgba(232,197,71,0.08);
  border-left-color: var(--accent);
}
.client-item-name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.client-item-meta {
  font-size: 0.78rem;
  color: var(--fg-dim);
  white-space: nowrap;
}
.client-item-del {
  background: none;
  border: none;
  color: var(--fg-dim);
  cursor: pointer;
  font-size: 14px;
  padding: 2px 4px;
  border-radius: 4px;
  transition: color 0.2s, background 0.2s;
  flex-shrink: 0;
  opacity: 0;
}
.client-item:hover .client-item-del { opacity: 1; }
.client-item-del:hover { color: var(--red); background: rgba(196,75,63,0.1); }
.sidebar-empty {
  padding: 32px 20px;
  color: var(--fg-dim);
  font-size: 0.88rem;
  text-align: center;
}

/* ── MAIN ── */
.main {
  padding: 0;
  overflow-y: auto;
}

/* ── EMPTY STATE ── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 400px;
  text-align: center;
  padding: 40px;
}
.empty-icon {
  font-size: 3rem;
  margin-bottom: 20px;
  opacity: 0.4;
}
.empty-state h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 10px;
}
.empty-state p {
  color: var(--fg-muted);
  font-size: 0.95rem;
  max-width: 360px;
}

/* ── CLIENT DETAIL ── */
.client-detail {
  padding: 32px 36px;
  max-width: 860px;
}
.client-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.client-detail-name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1.2;
}
.client-detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.tag {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 3px 12px;
  font-size: 0.8rem;
  color: var(--fg-muted);
}
.btn-generate {
  background: var(--accent);
  color: #0a0a0a;
  border: none;
  border-radius: var(--radius);
  padding: 12px 24px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  white-space: nowrap;
  flex-shrink: 0;
}
.btn-generate:hover { background: var(--accent-hover); }
.btn-generate:active { transform: scale(0.98); }
.btn-generate:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ── GENERATING STATE ── */
.generating-state {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 32px;
  text-align: center;
  margin-bottom: 28px;
}
.generating-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 20px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.generating-state h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  margin-bottom: 8px;
}
.generating-state p {
  color: var(--fg-muted);
  font-size: 0.9rem;
}

/* ── PACKAGES LIST ── */
.packages-section h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--fg-dim);
  margin-bottom: 16px;
}
.package-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: border-color 0.2s;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.package-card:hover { border-color: rgba(232,197,71,0.3); }
.package-card-info h4 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 4px;
}
.package-card-info p {
  color: var(--fg-muted);
  font-size: 0.85rem;
}
.package-card-date {
  font-size: 0.8rem;
  color: var(--fg-dim);
  white-space: nowrap;
}
.btn-del-pkg {
  background: none;
  border: none;
  color: var(--fg-dim);
  cursor: pointer;
  font-size: 13px;
  padding: 4px 6px;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
  flex-shrink: 0;
}
.btn-del-pkg:hover { color: var(--red); background: rgba(196,75,63,0.1); }

/* ── PACKAGE VIEWER ── */
.package-viewer {
  padding: 32px 36px;
  max-width: 900px;
}
.pkg-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--fg-muted);
  font-size: 0.85rem;
  cursor: pointer;
  margin-bottom: 24px;
  transition: color 0.2s;
  background: none;
  border: none;
  padding: 0;
}
.pkg-back:hover { color: var(--fg); }
.pkg-header {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.pkg-header h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 10px;
}
.pkg-summary {
  color: var(--fg-muted);
  font-size: 1rem;
  line-height: 1.7;
}
.pkg-section {
  margin-bottom: 40px;
}
.pkg-section-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--fg-dim);
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

/* ── CALENDAR GRID ── */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}
.cal-day {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.cal-day:hover {
  border-color: rgba(232,197,71,0.4);
  background: var(--bg-card);
}
.cal-day-num {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: rgba(232,197,71,0.3);
  line-height: 1;
  margin-bottom: 6px;
}
.cal-day-type {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 7px;
  border-radius: 100px;
  margin-bottom: 8px;
}
.type-photo { background: rgba(100,180,100,0.15); color: #6db86d; }
.type-reel { background: rgba(232,197,71,0.15); color: var(--accent); }
.type-story { background: rgba(100,150,230,0.15); color: #6496e6; }
.type-carousel { background: rgba(180,100,200,0.15); color: #c07ede; }
.cal-day-theme {
  font-size: 0.8rem;
  color: var(--fg-muted);
  line-height: 1.3;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* ── DAY MODAL ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  max-width: 600px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
}
.modal-close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: none;
  border: none;
  color: var(--fg-dim);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s;
}
.modal-close:hover { color: var(--fg); }
.modal-day-num {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--fg-dim);
  margin-bottom: 4px;
}
.modal h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 16px;
}
.modal-field {
  margin-bottom: 18px;
}
.modal-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--fg-dim);
  margin-bottom: 6px;
}
.modal-value {
  color: var(--fg);
  font-size: 0.93rem;
  line-height: 1.6;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
}
.modal-hashtags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.modal-tag {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 3px 11px;
  font-size: 0.8rem;
  color: var(--accent);
}
.copy-btn {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--fg-muted);
  font-size: 0.8rem;
  padding: 5px 12px;
  cursor: pointer;
  margin-top: 8px;
  transition: color 0.2s, border-color 0.2s;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 500;
}
.copy-btn:hover { color: var(--fg); border-color: var(--fg-muted); }
.copy-btn.copied { color: var(--accent); border-color: rgba(232,197,71,0.4); }

/* ── VIDEO IDEAS ── */
.video-list {
  display: grid;
  gap: 16px;
}
.video-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.video-card-num {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2.2rem;
  font-weight: 700;
  color: rgba(232,197,71,0.15);
  line-height: 1;
  margin-bottom: 8px;
}
.video-card h4 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 6px;
}
.video-format {
  display: inline-block;
  background: rgba(232,197,71,0.1);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 100px;
  margin-bottom: 12px;
}
.video-section {
  margin-top: 12px;
}
.video-section-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--fg-dim);
  margin-bottom: 4px;
}
.video-section-val {
  color: var(--fg-muted);
  font-size: 0.9rem;
  line-height: 1.6;
}
.video-outline {
  color: var(--fg-muted);
  font-size: 0.88rem;
  line-height: 1.7;
  padding-left: 16px;
}

/* ── HASHTAG SETS ── */
.hashtag-sets-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.hashtag-set-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.hashtag-set-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--fg-dim);
  margin-bottom: 12px;
}
.hashtag-set-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.ht-tag {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 3px 11px;
  font-size: 0.8rem;
  color: var(--accent);
}

/* ── ADD CLIENT MODAL ── */
.form-group {
  margin-bottom: 18px;
}
.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--fg-muted);
  margin-bottom: 6px;
  font-family: 'Space Grotesk', sans-serif;
}
.form-input, .form-textarea {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--fg);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.93rem;
  transition: border-color 0.2s;
  resize: vertical;
}
.form-input:focus, .form-textarea:focus {
  outline: none;
  border-color: rgba(232,197,71,0.5);
}
.form-input::placeholder, .form-textarea::placeholder {
  color: var(--fg-dim);
}
.form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 24px;
}
.btn-secondary {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 20px;
  color: var(--fg-muted);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.btn-secondary:hover { border-color: var(--fg-muted); color: var(--fg); }
.btn-primary {
  background: var(--accent);
  color: #0a0a0a;
  border: none;
  border-radius: var(--radius);
  padding: 10px 24px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-primary:hover { background: var(--accent-hover); }

/* ── TOAST ── */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 20px;
  color: var(--fg);
  font-size: 0.9rem;
  z-index: 9999;
  animation: slideIn 0.25s ease;
  max-width: 320px;
}
.toast.success { border-color: rgba(232,197,71,0.4); color: var(--accent); }
.toast.error { border-color: rgba(196,75,63,0.4); color: #e87070; }
@keyframes slideIn {
  from { transform: translateY(12px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .app-layout { grid-template-columns: 1fr; }
  .sidebar { border-right: none; border-bottom: 1px solid var(--border); max-height: 240px; }
  .calendar-grid { grid-template-columns: repeat(3, 1fr); }
  .hashtag-sets-grid { grid-template-columns: 1fr; }
  .client-detail, .package-viewer { padding: 24px 20px; }
}
@media (max-width: 480px) {
  .calendar-grid { grid-template-columns: repeat(2, 1fr); }
}
