/* SuperX / macrox.fr — UI inspired by SuperX product shell */

:root {
  --bg: #0a0a0b;
  --bg-elevated: #111113;
  --sidebar: #121214;
  --sidebar-hover: #1c1c1f;
  --card: #161618;
  --card-hover: #1a1a1d;
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.12);
  --text: #f2f2f3;
  --text-secondary: #a1a1a6;
  --muted: #6e6e73;
  --primary: #1d9bf0;
  --primary-hover: #1a8cd8;
  --primary-soft: rgba(29, 155, 240, 0.15);
  --danger: #f4212e;
  --danger-soft: rgba(244, 33, 46, 0.12);
  --ok: #00ba7c;
  --radius: 16px;
  --radius-sm: 12px;
  --radius-pill: 999px;
  --sidebar-w: 72px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  line-height: 1.45;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--primary); text-decoration: none; }
button { cursor: pointer; border: none; background: none; }
button:disabled { opacity: 0.45; cursor: not-allowed; }

/* ── Buttons ─────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 0.9rem;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
  white-space: nowrap;
}
.btn:active { transform: scale(0.98); }
.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn-ghost {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--sidebar-hover);
  border-color: rgba(255,255,255,0.18);
}
.btn-danger {
  background: var(--danger-soft);
  color: #ff7a84;
  border-color: transparent;
}
.btn-danger:hover:not(:disabled) { background: rgba(244,33,46,0.22); }
.btn-sm { padding: 0.4rem 0.9rem; font-size: 0.82rem; }
.btn-lg { padding: 0.85rem 1.5rem; font-size: 1rem; }

/* ── Landing ─────────────────────────────────────────── */
.landing {
  min-height: 100vh;
  position: relative;
  overflow: hidden;
}
.landing-glow {
  pointer-events: none;
  position: absolute;
  inset: -20% 20% auto -10%;
  height: 70vh;
  background:
    radial-gradient(ellipse 50% 40% at 30% 20%, rgba(29,155,240,0.18), transparent 60%),
    radial-gradient(ellipse 40% 35% at 70% 30%, rgba(120,86,255,0.12), transparent 55%);
  filter: blur(2px);
}
.landing-nav {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 2rem;
}
.brand-lockup {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}
.brand-mark {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: grid; place-items: center;
  background: linear-gradient(145deg, #1d9bf0, #7856ff);
  font-weight: 800;
  font-size: 1.05rem;
}
.brand-name { font-weight: 700; font-size: 1.15rem; letter-spacing: -0.02em; }
.hero {
  position: relative;
  z-index: 2;
  max-width: 920px;
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
  text-align: center;
}
.eyebrow {
  color: var(--primary);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0 0 1rem;
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 3.1rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin: 0 0 1.1rem;
}
.hero-sub {
  color: var(--text-secondary);
  font-size: 1.05rem;
  max-width: 520px;
  margin: 0 auto 1.75rem;
}
.preview-grid {
  margin-top: 3rem;
  text-align: left;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}
.tweet-card.demo { pointer-events: none; opacity: 0.92; }

/* ── App shell ───────────────────────────────────────── */
.app-shell {
  display: flex;
  min-height: 100vh;
  background: var(--bg);
}
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem 0.65rem;
  gap: 0.35rem;
  position: sticky;
  top: 0;
  height: 100vh;
}
.side-item {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: var(--muted);
  transition: background 0.15s, color 0.15s;
}
.side-item:hover { background: var(--sidebar-hover); color: var(--text); }
.side-item.active {
  background: var(--card);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--border-strong);
}
.side-icon { font-size: 1.2rem; line-height: 1; }
.side-icon.flame { filter: saturate(1.1); }
.side-spacer { flex: 1; }

.workspace {
  flex: 1;
  min-width: 0;
  position: relative;
  padding: 1.5rem 2rem 3rem;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(80,80,100,0.22), transparent 55%),
    var(--bg);
}
.workspace-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  gap: 1rem;
}
.view-title {
  margin: 0;
  font-size: 1.65rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #e8e8ea;
}
.user-pill {
  background: var(--card);
  border: 1px solid var(--border);
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 0.9rem;
}

.view { display: none; animation: fadeIn 0.2s ease; }
.view.active { display: block; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

/* Filters / segments */
.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 1.5rem;
}
.seg {
  padding: 0.45rem 1rem;
  border-radius: var(--radius-pill);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.92rem;
}
.seg:hover { color: var(--text); }
.seg.active {
  background: var(--card);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--border-strong);
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.section-head.tight { margin-top: 2rem; margin-bottom: 0.75rem; }
.section-head h2 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}
.section-desc {
  margin: 0.45rem 0 0;
  color: var(--text-secondary);
  font-size: 0.92rem;
  max-width: 560px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1.25rem;
  justify-content: space-between;
}
.toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 500;
}
.chip:hover { border-color: rgba(255,255,255,0.2); color: var(--text); }
.chip-active, .chip.chip-active {
  background: var(--primary-soft);
  border-color: rgba(29,155,240,0.35);
  color: #7ec8f5;
}
.chip-soft {
  background: var(--bg-elevated);
  border-color: var(--border);
  color: var(--text-secondary);
  pointer-events: none;
}

.input-dark, .select-dark, .modal-textarea, .style-area, #composeText {
  background: var(--card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.85rem;
  color: var(--text);
  outline: none;
}
.input-dark:focus, .select-dark:focus, .modal-textarea:focus,
.style-area:focus, #composeText:focus {
  border-color: rgba(29,155,240,0.5);
  box-shadow: 0 0 0 3px rgba(29,155,240,0.12);
}
.input-dark { min-width: 160px; }
.input-dark.grow { flex: 1; min-width: 200px; }
.input-num { width: 72px; min-width: 0; }
.select-dark { appearance: none; padding-right: 1.8rem; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='%23a1a1a6'%3E%3Cpath d='M1 1l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 0.7rem center; }
.inline-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--muted);
  font-size: 0.85rem;
}

/* ── Tweet cards ─────────────────────────────────────── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}
.card-grid.single { grid-template-columns: 1fr; max-width: 720px; }
.card-grid.engage-grid { margin-top: 1.5rem; }

.tweet-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.15rem 1rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  transition: border-color 0.15s, background 0.15s;
}
.tweet-card:hover {
  border-color: var(--border-strong);
  background: var(--card-hover);
}
.tweet-card-head {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}
.avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: linear-gradient(145deg, #2a2a30, #1a1a1e);
  display: grid; place-items: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-secondary);
  flex-shrink: 0;
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.name-row {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.95rem;
}
.name-row strong { font-weight: 600; }
.badge-check {
  display: inline-grid;
  place-items: center;
  width: 15px; height: 15px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 0.55rem;
  font-weight: 800;
}
.meta {
  color: var(--muted);
  font-size: 0.82rem;
}
.tweet-body {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}
.tweet-sub {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
}
.tweet-source {
  margin: 0;
  padding: 0.65rem 0.75rem;
  background: var(--bg-elevated);
  border-left: 3px solid var(--primary);
  border-radius: 0 10px 10px 0;
  color: var(--text-secondary);
  font-size: 0.88rem;
  white-space: pre-wrap;
  max-height: 6.5em;
  overflow: hidden;
}
.tweet-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 0.35rem;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.foot-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-left: auto;
}
.char-count {
  font-size: 0.8rem;
  color: var(--muted);
}
.char-count.over { color: var(--danger); }

.empty-state {
  padding: 2.5rem 1rem;
  text-align: center;
  color: var(--text-secondary);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.01);
}
.empty-state.hidden { display: none; }

/* Engage dual card */
.engage-card .pair {
  display: grid;
  gap: 0.75rem;
}
.pair-block {
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  border: 1px solid var(--border);
}
.pair-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.35rem;
}

/* Compose */
.compose-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 0.5rem;
  box-shadow: var(--shadow);
}
#composeText {
  width: 100%;
  border: none;
  background: transparent;
  resize: vertical;
  min-height: 120px;
  padding: 0.25rem;
  font-size: 1.05rem;
}
#composeText:focus { box-shadow: none; border: none; }
.compose-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}
.compose-bar .char-count { margin-right: auto; }

/* Style / settings */
.style-area {
  width: 100%;
  min-height: 320px;
  resize: vertical;
  line-height: 1.5;
  font-size: 0.92rem;
}
.settings-card {
  max-width: 560px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.25rem 1.25rem 1.25rem;
  box-shadow: var(--shadow);
}
.settings-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--border);
}
.settings-row .muted { margin: 0.25rem 0 0; color: var(--muted); font-size: 0.88rem; }
.status-dot {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius-pill);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}
.status-dot.ok { color: var(--ok); border-color: rgba(0,186,124,0.3); }
.settings-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding-top: 1.1rem;
}

/* Toast + modal */
.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: #1c1c20;
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-pill);
  z-index: 100;
  box-shadow: var(--shadow);
  font-size: 0.9rem;
  max-width: 90vw;
}
.toast.hidden { display: none; }
.toast.error { border-color: rgba(244,33,46,0.45); color: #ffb4b8; }

.modal {
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  background: var(--card);
  color: var(--text);
  padding: 0;
  width: min(520px, 94vw);
  box-shadow: var(--shadow);
}
.modal::backdrop { background: rgba(0,0,0,0.65); backdrop-filter: blur(4px); }
.modal-inner { padding: 1.35rem 1.4rem 1.25rem; margin: 0; }
.modal-inner h3 { margin: 0 0 0.35rem; font-size: 1.15rem; }
.modal-textarea {
  width: 100%;
  margin: 0.75rem 0 0.35rem;
  resize: vertical;
  min-height: 110px;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}
.muted { color: var(--muted); }
.pill-warn {
  color: #ffad1f;
  font-size: 0.9rem;
}

/* Queue status badges */
.badge-status {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-pill);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.badge-status.scheduled { color: #7ec8f5; border-color: rgba(29,155,240,0.3); }
.badge-status.posted { color: var(--ok); border-color: rgba(0,186,124,0.3); }
.badge-status.failed { color: #ff7a84; border-color: rgba(244,33,46,0.3); }
.badge-status.draft { color: #c4b5fd; border-color: rgba(167,139,250,0.3); }

/* Responsive */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    top: auto;
    height: auto;
    width: 100%;
    flex-direction: row;
    justify-content: space-around;
    padding: 0.4rem 0.5rem;
    border-right: none;
    border-top: 1px solid var(--border);
    z-index: 40;
  }
  .side-spacer { display: none; }
  .side-item { width: 44px; height: 44px; }
  .workspace { padding: 1rem 1rem 5.5rem; }
  .view-title { font-size: 1.35rem; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .toolbar-actions { width: 100%; }
  .input-dark { width: 100%; }
  .landing-nav { padding: 1rem; }
  .hero { padding-top: 1.5rem; }
}
