@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&display=swap");

:root {
  --bg: #0b0f14;
  --panel: #121723;
  --panel-border: #1f2633;
  --text: #e6e8ee;
  --muted: #9aa3b2;
  --accent: #38bdf8;
  --danger: #f87171;
  --success: #34d399;
  --warning: #fbbf24;
  --shadow: rgba(0, 0, 0, 0.4);
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: radial-gradient(1200px 800px at 20% 20%, rgba(56, 189, 248, 0.15), transparent 60%),
    radial-gradient(900px 600px at 80% 10%, rgba(29, 78, 216, 0.18), transparent 60%),
    linear-gradient(120deg, #0a0f17 0%, #090c12 60%, #0b1018 100%);
  color: var(--text);
  min-height: 100vh;
  font-size: 16px;
}

#app {
  min-height: 100vh;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding: 12px 18px;
  border-radius: 16px;
  background: rgba(13, 18, 27, 0.85);
  border: 1px solid var(--panel-border);
  box-shadow: 0 12px 30px var(--shadow);
  backdrop-filter: blur(8px);
  gap: 16px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  width: 44px;
  height: 44px;
  filter: drop-shadow(0 8px 16px rgba(14, 165, 233, 0.3));
}

.brand-text {
  font-size: 26px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  font-family: "Space Grotesk", "IBM Plex Sans", "Segoe UI", sans-serif;
}

.topbar h1 {
  margin: 0;
  font-size: 20px;
}

.topbar p {
  margin: 2px 0 0 0;
  color: var(--muted);
}

.channel-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.channel-logo {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  object-fit: cover;
  display: none;
}

.channel-logo.visible {
  display: inline-block;
}

.channel-meta p {
  font-size: 14px;
}

.status {
  padding: 6px 12px;
  border-radius: 12px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  box-shadow: 0 6px 16px var(--shadow);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-end;
  margin-bottom: 20px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  padding: 16px;
  border-radius: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field.checkbox {
  justify-content: flex-end;
}

.field label {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.field input,
.field select {
  background: #0f131a;
  border: 1px solid var(--panel-border);
  color: var(--text);
  padding: 8px 10px;
  border-radius: 10px;
}

button {
  border: none;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--accent);
  color: #04141f;
  font-weight: 600;
  cursor: pointer;
}

button.secondary {
  background: #1f2937;
  color: var(--text);
}

button.danger {
  background: var(--danger);
  color: #200;
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.meta {
  color: var(--muted);
  font-size: 12px;
  margin-left: auto;
}

.status {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--muted);
  box-shadow: 0 0 0 4px rgba(148, 163, 184, 0.12);
}

.topmenu {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-left: auto;
}

.toplink {
  color: var(--muted);
  text-decoration: none;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.toplink:hover {
  color: var(--text);
}

.topmenu .secondary {
  min-width: 120px;
  justify-content: center;
}

.topmenu .secondary.active {
  background: rgba(56, 189, 248, 0.18);
  color: var(--text);
  border: 1px solid rgba(56, 189, 248, 0.4);
}

.icon-button {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid var(--panel-border);
  background: rgba(15, 23, 42, 0.6);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 16px var(--shadow);
  gap: 8px;
  font-weight: 600;
}

.icon-button:hover {
  background: rgba(56, 189, 248, 0.2);
  border-color: rgba(56, 189, 248, 0.4);
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.lang-switch select {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--panel-border);
  color: var(--text);
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.status-connected {
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.16);
}

.status-disconnected {
  background: var(--warning);
  box-shadow: 0 0 0 4px rgba(251, 191, 36, 0.18);
}

.status-error {
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(248, 113, 113, 0.18);
}

.columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  flex: 1;
  min-height: 0;
  align-items: stretch;
}

.columns + .page-footer {
  margin-top: auto;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  padding: 16px;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.panel header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 16px;
}

.panel header span {
  color: var(--muted);
}

.list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.panel-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 8px;
}

.item {
  padding: 10px 12px;
  border-radius: 12px;
  background: #0f131a;
  border: 1px solid transparent;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

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

.item .meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  gap: 12px;
  margin-left: 0;
  width: 100%;
}

.item .meta.recent-meta {
  justify-content: space-between;
}

.item .meta.selected-meta {
  justify-content: space-between;
}

.item .meta .user {
  color: var(--accent);
  font-weight: 600;
}

.item .meta .time {
  color: var(--muted);
}

.item .text {
  font-size: 14px;
  line-height: 1.4;
}

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

.item .actions button {
  padding: 6px 10px;
  font-size: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 999px;
  background: #1f2937;
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
  margin-left: 8px;
}

.badge.live {
  background: rgba(52, 211, 153, 0.2);
  color: var(--success);
}

.badge.draft {
  background: rgba(251, 191, 36, 0.2);
  color: var(--warning);
}

.error {
  position: fixed;
  bottom: 24px;
  left: 24px;
  right: 24px;
  background: #2a1012;
  color: #fecaca;
  padding: 14px 18px;
  border-radius: 12px;
  border: 1px solid #7f1d1d;
  box-shadow: 0 10px 30px var(--shadow);
}

.error.hidden {
  display: none;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(6, 9, 14, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 50;
}

.hidden {
  display: none;
}

.modal-backdrop.hidden {
  display: none;
}

.modal {
  width: min(420px, 92vw);
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 20px 40px var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal h3 {
  margin: 0;
  font-size: 18px;
}

.modal p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 6px;
}

.page-footer {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 16px 0 8px;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.04em;
}

.footer-link {
  color: inherit;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.footer-link:hover {
  color: var(--text);
}


@media (max-width: 900px) {
  .columns {
    grid-template-columns: 1fr;
  }
}
