/* ── Channel Orbit Sidebar (shared across pages) ── */
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/variable/pretendardvariable-dynamic-subset.css');

:root {
  --sb-bg-base: #0c0c14;
  --sb-bg-surface: #14141e;
  --sb-bg-elevated: #1a1a28;
  --sb-live-red: #e53e3e;
  --sb-accent-purple: #7c4af0;
  --sb-text-primary: #eaeaf0;
  --sb-text-secondary: #8888a0;
  --sb-text-muted: #505068;
  --sb-border: #22222e;
  --sb-border-hover: #3a3a4e;
}

/* Layout wrapper: sidebar + main content */
.page-with-sidebar {
  display: flex; min-height: calc(100vh - 60px);
}
.page-with-sidebar > .page-content {
  flex: 1; min-width: 0;
}

/* ── Channel Orbit ── */
.channel-orbit {
  width: 180px; flex-shrink: 0;
  background: var(--sb-bg-surface); border-right: 1px solid var(--sb-border);
  display: flex; flex-direction: column; align-items: stretch;
  padding: 0.75rem 0.6rem; gap: 0.25rem;
  overflow-y: auto; overflow-x: hidden;
  scrollbar-width: none;
}
.channel-orbit::-webkit-scrollbar { display: none; }

.orbit-label {
  font-size: 0.6rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--sb-text-muted);
  padding: 0.25rem 0.5rem 0.5rem;
}

.orbit-item {
  position: relative; display: flex; align-items: center; gap: 0.6rem;
  padding: 0.45rem 0.5rem; border-radius: 10px;
  cursor: pointer; transition: all 0.15s;
  text-decoration: none; color: inherit; flex-shrink: 0;
}
.orbit-item:hover { background: var(--sb-bg-elevated); }
.orbit-item.offline { opacity: 0.5; }
.orbit-item.offline:hover { opacity: 0.8; }
.orbit-item.is-live { background: rgba(229,62,62,0.06); }
.orbit-item.is-live:hover { background: rgba(229,62,62,0.1); }

.orbit-avatar {
  position: relative; width: 36px; height: 36px; flex-shrink: 0;
}
.orbit-avatar img {
  width: 36px; height: 36px; border-radius: 50%; object-fit: cover;
  border: 2px solid var(--sb-border); transition: border-color 0.3s;
}
.orbit-item.is-live .orbit-avatar img {
  border-color: var(--sb-live-red);
  box-shadow: 0 0 0 3px rgba(229,62,62,0.25);
  animation: orbit-pulse 2s ease-in-out infinite;
}

.orbit-avatar .orbit-placeholder {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--sb-bg-elevated); border: 2px solid var(--sb-border);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; color: var(--sb-text-muted);
}

.orbit-live-dot {
  position: absolute; top: 0; right: 0;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--sb-live-red); border: 2px solid var(--sb-bg-surface);
}

.orbit-info { flex: 1; min-width: 0; }
.orbit-name {
  font-size: 0.78rem; font-weight: 600; color: var(--sb-text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  line-height: 1.3;
}
.orbit-item.offline .orbit-name { color: var(--sb-text-secondary); }
.orbit-handle {
  font-size: 0.62rem; color: var(--sb-text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.orbit-live-tag {
  font-size: 0.55rem; font-weight: 700; color: var(--sb-live-red);
  text-transform: uppercase; letter-spacing: 0.04em;
}

.orbit-divider {
  height: 1px; background: var(--sb-border);
  margin: 0.35rem 0.5rem; flex-shrink: 0;
}

.orbit-add {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.45rem 0.5rem; border-radius: 10px;
  background: rgba(124,74,240,0.06); border: 1px dashed rgba(124,74,240,0.3);
  color: var(--sb-text-secondary); font-size: 0.78rem; font-weight: 500;
  cursor: pointer; transition: all 0.2s; flex-shrink: 0;
}
.orbit-add:hover { border-color: var(--sb-accent-purple); color: var(--sb-accent-purple); background: rgba(124,74,240,0.1); }
.orbit-add-icon {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
}

@keyframes orbit-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(229,62,62,0.25); }
  50% { box-shadow: 0 0 0 6px rgba(229,62,62,0.1); }
}

/* ── Manual Live Section ── */
.manual-live-section {
  width: 180px; flex-shrink: 0;
  background: var(--sb-bg-surface); border-right: 1px solid var(--sb-border);
  padding: 0.5rem 0.6rem 0.75rem;
  border-top: 1px solid var(--sb-border);
}

.manual-live-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.25rem 0.5rem 0.4rem;
  cursor: pointer; user-select: none;
}
.manual-live-header:hover .orbit-label { color: var(--sb-text-secondary); }
.manual-live-chevron {
  font-size: 0.6rem; color: var(--sb-text-muted);
}

.manual-live-body { display: flex; flex-direction: column; gap: 0.4rem; }
.manual-live-body.collapsed { display: none; }

.manual-live-input-row {
  display: flex; gap: 0.3rem;
}
.manual-live-input {
  flex: 1; min-width: 0;
  background: var(--sb-bg-elevated); border: 1px solid var(--sb-border);
  border-radius: 6px; padding: 0.3rem 0.5rem;
  color: var(--sb-text-primary); font-size: 0.7rem;
  outline: none; transition: border-color 0.15s;
}
.manual-live-input::placeholder { color: var(--sb-text-muted); }
.manual-live-input:focus { border-color: var(--sb-border-hover); }

.manual-live-add-btn {
  background: rgba(229,62,62,0.12); border: 1px solid rgba(229,62,62,0.3);
  color: var(--sb-live-red); border-radius: 6px;
  padding: 0.3rem 0.5rem; font-size: 0.7rem; font-weight: 600;
  cursor: pointer; white-space: nowrap; transition: all 0.15s; flex-shrink: 0;
}
.manual-live-add-btn:hover { background: rgba(229,62,62,0.2); border-color: rgba(229,62,62,0.5); }
.manual-live-add-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.manual-live-list { display: flex; flex-direction: column; gap: 0.25rem; }

.manual-live-empty {
  font-size: 0.65rem; color: var(--sb-text-muted);
  padding: 0.25rem 0.5rem; text-align: center;
}

.manual-live-item {
  display: flex; flex-direction: column; gap: 0.15rem;
  background: var(--sb-bg-elevated); border: 1px solid var(--sb-border);
  border-radius: 8px; padding: 0.35rem 0.5rem;
}
.manual-live-item-main {
  display: flex; align-items: center; gap: 0.35rem; min-width: 0;
}
.manual-live-item-sub {
  display: flex; align-items: center; justify-content: space-between; gap: 0.25rem;
}

.manual-live-title {
  font-size: 0.7rem; color: var(--sb-text-secondary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  flex: 1; min-width: 0;
}
.manual-live-time {
  font-size: 0.6rem; color: var(--sb-text-muted);
}
.manual-live-remove {
  background: none; border: none; color: var(--sb-text-muted);
  font-size: 0.85rem; line-height: 1; cursor: pointer; padding: 0 0.1rem;
  transition: color 0.1s; flex-shrink: 0;
}
.manual-live-remove:hover { color: var(--sb-live-red); }

.manual-live-help {
  font-size: 0.58rem; color: var(--sb-text-muted); line-height: 1.4;
  padding: 0.2rem 0.25rem 0;
}

/* Status badges */
.target-status { font-size: 0.65rem; padding: 2px 6px; border-radius: 4px; font-weight: 600; flex-shrink: 0; }
.target-status.waiting { background: #44390a; color: #f6e05e; }
.target-status.live { background: #3a1a1a; color: #e53e3e; animation: pulse-live 1.5s infinite; }
.target-status.ended { background: #2a2a32; color: #70708a; }
.target-status.expired { background: #1a1a1e; color: #4a4a5a; }

@keyframes pulse-live {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* ── Language Switcher ── */
.lang-switcher {
  position: relative; display: flex; align-items: center;
}
.lang-switcher-btn {
  display: flex; align-items: center; gap: 0.3rem;
  background: transparent; border: 1px solid var(--sb-border, #22222e);
  color: var(--sb-text-secondary, #8888a0);
  padding: 0.3rem 0.65rem; border-radius: 6px; cursor: pointer;
  font-size: 0.78rem; font-weight: 500; transition: all 0.15s;
  white-space: nowrap;
}
.lang-switcher-btn:hover {
  border-color: var(--sb-border-hover, #3a3a4e);
  color: var(--sb-text-primary, #eaeaf0);
}
.lang-switcher-arrow { font-size: 0.6rem; }
.lang-switcher-dropdown {
  position: absolute; top: calc(100% + 4px); right: 0;
  background: var(--sb-bg-elevated, #1a1a28);
  border: 1px solid var(--sb-border, #22222e);
  border-radius: 8px; padding: 0.25rem; min-width: 110px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4); z-index: 1001;
}
.lang-option {
  display: block; width: 100%; text-align: left;
  background: none; border: none; color: var(--sb-text-secondary, #8888a0);
  padding: 0.45rem 0.75rem; border-radius: 6px; cursor: pointer;
  font-size: 0.82rem; transition: all 0.1s;
}
.lang-option:hover {
  background: rgba(124,74,240,0.1); color: var(--sb-text-primary, #eaeaf0);
}
.lang-option.active {
  color: var(--sb-accent-purple, #7c4af0); font-weight: 600;
}

/* ── Responsive: Mobile ── */
@media (max-width: 768px) {
  .page-with-sidebar { flex-direction: column; }

  .channel-orbit {
    width: 100%; flex-direction: row; align-items: center;
    border-right: none; border-bottom: 1px solid var(--sb-border);
    padding: 0.5rem 0.75rem; gap: 0.35rem;
    overflow-x: auto; overflow-y: hidden;
    position: sticky; top: 60px; z-index: 999;
    background: var(--sb-bg-surface);
  }
  .orbit-label { display: none; }
  .orbit-divider { width: 1px; height: 28px; margin: 0 0.1rem; }
  .orbit-item {
    flex-direction: column; gap: 0.2rem; padding: 0.35rem 0.5rem;
    min-width: 56px; text-align: center; border-radius: 10px;
  }
  .orbit-avatar { width: 32px; height: 32px; }
  .orbit-avatar img { width: 32px; height: 32px; }
  .orbit-avatar .orbit-placeholder { width: 32px; height: 32px; font-size: 0.65rem; }
  .orbit-info { min-width: 0; }
  .orbit-name { font-size: 0.6rem; text-align: center; }
  .orbit-handle { display: none; }
  .orbit-live-tag { font-size: 0.5rem; text-align: center; }
  .orbit-add {
    flex-direction: column; gap: 0.15rem; padding: 0.35rem 0.5rem;
    min-width: 52px; font-size: 0.6rem;
  }
  .orbit-add-icon { width: 32px; height: 32px; font-size: 0.95rem; }

  .manual-live-section {
    width: 100%; border-right: none; border-top: 1px solid var(--sb-border);
    padding: 0.5rem 0.75rem;
  }
  .manual-live-body { gap: 0.35rem; }
  .manual-live-input { font-size: 0.72rem; }
  .manual-live-add-btn { font-size: 0.72rem; }
  .manual-live-help { display: none; }
}
