/* app.css — OrbitContent tool UI. Extends theme.css design tokens. */

.app-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 100px 1.5rem 4rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* ── Section ── */
.section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.section-header h2 {
  font-family: 'Syne', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-family: 'DM Mono', monospace;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
}

.btn-primary {
  background: var(--accent);
  color: #0a0a0f;
}
.btn-primary:hover { opacity: 0.85; }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ── Feeds list ── */
.feeds-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.feed-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s;
}

.feed-item:hover { border-color: rgba(232,121,249,0.3); }
.feed-item.active { border-color: var(--accent); }

.feed-item-info { flex: 1; }
.feed-item-name {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
}
.feed-item-url {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.feed-item-actions { display: flex; gap: 8px; }

/* ── Add feed form ── */
.add-feed-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.add-feed-form input {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--text);
  font-family: 'DM Mono', monospace;
  font-size: 0.8rem;
  outline: none;
  transition: border-color 0.15s;
}

.add-feed-form input:focus { border-color: var(--accent); }
.add-feed-form input::placeholder { color: var(--text-muted); }

/* ── Feed Items ── */
.feed-items {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 400px;
  overflow-y: auto;
}

.feed-item-entry {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.feed-item-entry-text { flex: 1; }
.feed-item-entry-title {
  font-size: 0.85rem;
  color: var(--text);
  font-weight: 500;
  line-height: 1.4;
}
.feed-item-entry-time {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ── Preview ── */
.preview-content {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--text);
  white-space: pre-wrap;
}

.preview-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ── Recent Generations ── */
.recent-generations {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.gen-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s;
}

.gen-item:hover { border-color: var(--accent); }

.gen-item-info { flex: 1; }
.gen-item-title {
  font-size: 0.8rem;
  color: var(--text);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gen-item-meta {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 4px;
  display: flex;
  gap: 12px;
}

.gen-item-platform {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 100px;
  background: var(--accent-glow);
  color: var(--accent);
}

.gen-status {
  font-size: 0.65rem;
  padding: 2px 8px;
  border-radius: 100px;
}
.gen-status.completed { background: rgba(74,222,128,0.1); color: var(--green); }
.gen-status.pending { background: rgba(251,191,36,0.1); color: var(--accent-2); }
.gen-status.error { background: rgba(248,113,113,0.1); color: #f87171; }

/* ── Loading ── */
.loading {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 1rem;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ── Empty State ── */
.empty-state {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 0.8rem;
  color: var(--text);
  z-index: 1000;
  animation: fadeUp 0.2s ease-out;
}

.toast.error { border-color: #f87171; color: #f87171; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateX(-50%) translateY(8px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ── Quick Test ── */
.section-quicktest {
  background: linear-gradient(135deg, rgba(232,121,249,0.06) 0%, rgba(124,58,237,0.06) 100%);
  border-color: rgba(232,121,249,0.2);
}

.quicktest-hint {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-family: 'DM Mono', monospace;
}

.quicktest-form {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.quicktest-form input {
  flex: 1;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--text);
  font-family: 'DM Mono', monospace;
  font-size: 0.8rem;
  outline: none;
  transition: border-color 0.15s;
}

.quicktest-form input:focus { border-color: var(--accent); }
.quicktest-form input::placeholder { color: var(--text-muted); }

/* ── Tweet Preview ── */
.tweet {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

.tweet:last-child { border-bottom: none; }

.tweet-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent-glow);
  color: var(--accent);
  font-size: 0.65rem;
  font-weight: 700;
  font-family: 'DM Mono', monospace;
  flex-shrink: 0;
  margin-top: 2px;
}

.tweet-text {
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1.5;
}

/* ── Copy / Share Buttons ── */
.btn-copy, .btn-share {
  font-size: 0.75rem;
  padding: 5px 12px;
  margin-left: 8px;
}

.btn-share {
  text-decoration: none;
}

/* ── Settings ── */
.settings-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.settings-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.settings-card-icon {
  font-size: 1.5rem;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-glow);
  border-radius: 8px;
  color: var(--accent);
  flex-shrink: 0;
}

.settings-card-info { flex: 1; }

.settings-card-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.settings-card-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.settings-card-action { flex-shrink: 0; }

.btn-connected {
  background: rgba(74,222,128,0.1);
  color: var(--green);
  border: 1px solid rgba(74,222,128,0.3);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-family: 'DM Mono', monospace;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
}