/* ==========================================================================
   QVIBE ADMIN DASHBOARD & STAGE CONTROLLER STYLES
   Theme: Dual-Island Minimalist Architecture (Two Rounded Floating Panels)
   Color: True Obsidian Deep Dark (Zero Blue / Indigo Tint)
   ========================================================================== */

body.admin-body {
  background-color: #000000;
  margin: 0;
  padding: 0;
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  box-sizing: border-box;
}

/* ==========================================================================
   THE TWO-ISLAND FRAMEWORK
   Block 1: Menu Island (.admin-sidebar)
   Block 2: Content Island (.admin-main)
   Surrounded by uniform margins on all sides. Zero full-bleed dividing lines.
   ========================================================================== */
.admin-layout {
  display: flex;
  height: 100vh;
  width: 100vw;
  box-sizing: border-box;
  padding: 12px;
  gap: 12px;
  background: #000000;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

/* ==========================================================================
   BLOCK 1: MENU ISLAND (Sidebar)
   Rounded with margins all around, self-contained, no dividing borders.
   ========================================================================== */
.admin-sidebar {
  width: 250px;
  background: #0a0a0d;
  border: 1px solid #1a1a1f;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  height: 100%;
  box-sizing: border-box;
  overflow: hidden;
  z-index: 10;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.brand-section {
  padding: 18px 16px 12px;
  display: flex;
  align-items: center;
  gap: 11px;
  border-bottom: none; /* No dividing line */
}

.brand-logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #ffffff;
  color: #000000;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.brand-text {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #ffffff;
  line-height: 1.1;
}

.brand-sub {
  font-size: 0.68rem;
  color: #71717a;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 2px;
}

/* Nav Menu */
.nav-menu {
  flex: 1;
  padding: 6px 10px;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow-y: auto;
}

.nav-item {
  width: 100%;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border-radius: 8px;
  color: #82828a;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
  background: transparent;
  text-decoration: none;
}

.nav-link:hover {
  color: #ffffff;
  background: #141418;
}

.nav-link.active {
  color: #ffffff;
  background: #18181d;
  border-color: #26262e;
  font-weight: 700;
}

.nav-icon {
  font-size: 1.1rem;
  width: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nav-badge {
  margin-left: auto;
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  font-size: 0.72rem;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  font-weight: 700;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 12px 16px;
  border-top: none; /* No dividing line */
  background: transparent;
  font-size: 0.74rem;
  color: #52525b;
  line-height: 1.4;
}

/* ==========================================================================
   BLOCK 2: CONTENT ISLAND (Main Area)
   Rounded with margins all around, holds topbar & active tab content.
   ========================================================================== */
.admin-main {
  flex: 1;
  min-width: 0;
  background: #0a0a0d;
  border: 1px solid #1a1a1f;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  height: 100%;
  box-sizing: border-box;
  overflow: hidden;
  position: relative;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

/* Topbar sits neatly inside the top of Block 2 */
.admin-topbar {
  height: 58px;
  background: transparent;
  border-bottom: 1px solid #141418;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  z-index: 5;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.survey-selector-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.survey-select {
  background: #141417;
  border: 1px solid #1f1f24;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.88rem;
  padding: 6px 12px;
  border-radius: 8px;
  outline: none;
  cursor: pointer;
  min-width: 160px;
  max-width: 280px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: border-color 0.15s ease;
}

.survey-select:focus {
  border-color: #3f3f46;
}

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

.stat-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  background: #121215;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  border: 1px solid #1c1c20;
  font-size: 0.82rem;
  font-weight: 600;
  color: #a1a1aa;
}

.stat-pill strong {
  color: #fff;
  font-size: 0.92rem;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Content Area inside Block 2 */
.admin-content {
  flex: 1;
  overflow-y: auto;
  padding: 22px;
  position: relative;
}

.tab-pane {
  display: none;
  max-width: 1400px;
  margin: 0 auto;
}

.tab-pane.active {
  display: block;
  animation: tabFadeIn 0.2s ease forwards;
}

@keyframes tabFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.admin-main .glass-panel {
  background: #0f0f12 !important;
  border: 1px solid #19191d !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* ==========================================================================
   MINIMALIST PANELS & DECK (TAB 1: STAGE CONTROLLER)
   ========================================================================== */
.stage-control-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

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

.stage-deck {
  padding: 20px;
  border-radius: 12px;
  background: #0f0f12;
  border: 1px solid #19191d;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}

.stage-deck-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  gap: 14px;
}

.stage-deck-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
}

/* Tactical Operator Buttons Grid */
.tactical-btn-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

@media (max-width: 800px) {
  .tactical-btn-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.tactical-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 13px 10px;
  border-radius: 9px;
  border: 1px solid #1e1e23;
  background: #131316;
  color: #d4d4d8;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
  user-select: none;
}

.tactical-btn .btn-icon-lg {
  font-size: 1.4rem;
}

.tactical-btn:hover {
  background: #1a1a1f;
  border-color: #2c2c36;
  transform: translateY(-1px);
}

.tactical-btn.btn-play {
  background: #0b1a10;
  border-color: #153b21;
  color: #4ade80;
}
.tactical-btn.btn-play:hover {
  background: #0f2417;
  border-color: #225430;
}

.tactical-btn.btn-pause {
  background: #1c1306;
  border-color: #3b280c;
  color: #fbbf24;
}
.tactical-btn.btn-pause:hover {
  background: #261b09;
  border-color: #4d3511;
}

.tactical-btn.btn-finish {
  background: #1c0a0d;
  border-color: #3b1419;
  color: #f87171;
}
.tactical-btn.btn-finish:hover {
  background: #260f13;
  border-color: #4d1c23;
}

.tactical-btn.btn-stage {
  background: #16161a;
  border-color: #242429;
  color: #ffffff;
}
.tactical-btn.btn-stage:hover {
  background: #1c1c22;
  border-color: #383842;
}

/* Active Question Spotlight Card */
.active-question-spotlight {
  background: #121215;
  border: 1px solid #1e1e23;
  border-radius: 11px;
  padding: 18px 20px;
  margin-bottom: 20px;
  box-sizing: border-box;
}

.spotlight-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.spotlight-title {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 14px;
  color: #fff;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.spotlight-stats {
  display: flex;
  gap: 16px;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

/* Visual Mode Selector */
.visual-mode-bar {
  display: flex;
  align-items: center;
  gap: 3px;
  background: #060608;
  padding: 3px;
  border-radius: 8px;
  border: 1px solid #161619;
  overflow-x: auto;
}

.mode-btn {
  padding: 5px 10px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: #71717a;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.mode-btn:hover {
  color: #fff;
  background: #141417;
}

.mode-btn.active {
  background: #ffffff;
  color: #000000;
  font-weight: 700;
}

/* Side Column: Questions Quick Switcher & Audience Simulator */
.side-card {
  padding: 18px;
  border-radius: 12px;
  background: #0f0f12;
  border: 1px solid #19191d;
  margin-bottom: 18px;
  box-sizing: border-box;
}

.quick-q-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 380px;
  overflow-y: auto;
  margin-top: 12px;
}

.quick-q-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  background: #131316;
  border: 1px solid #1a1a1e;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  min-width: 0;
  gap: 10px;
}

.quick-q-item:hover {
  background: #18181d;
  border-color: #272730;
}

.quick-q-item.active {
  border-color: #35353d;
  background: #1b1b22;
}

.quick-q-title {
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

/* Audience Simulator Box */
.simulator-box {
  background: #0f0f12;
  border: 1px solid #19191d;
  border-radius: 12px;
  padding: 18px;
  box-sizing: border-box;
}

.sim-btn-group {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

/* Live Answer Stream in Admin */
.live-stream-card {
  margin-top: 20px;
  padding: 20px;
  background: #0f0f12;
  border: 1px solid #19191d;
  border-radius: 12px;
  box-sizing: border-box;
}

.stream-feed {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 340px;
  overflow-y: auto;
  margin-top: 12px;
}

.stream-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #131316;
  border: 1px solid #1a1a1e;
  border-radius: 8px;
  animation: slideInDown 0.25s ease;
  min-width: 0;
  gap: 12px;
}

@keyframes slideInDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.stream-text {
  font-size: 0.92rem;
  color: #fff;
  font-weight: 500;
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.stream-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  flex-shrink: 0;
  white-space: nowrap;
}

/* ==========================================================================
   QR HUB STYLES (TAB 6)
   ========================================================================== */
.qr-hub-grid {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 24px;
}

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

.qr-card-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 26px;
  background: #0f0f12;
  border: 1px solid #19191d;
  border-radius: 12px;
}

.qr-image-wrapper {
  background: #ffffff;
  padding: 14px;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  margin-bottom: 18px;
}

.qr-image-wrapper img {
  width: 220px;
  height: 220px;
  display: block;
}

.qr-link-box {
  width: 100%;
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
}

.qr-action-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: 100%;
}

/* Checklist Card */
.checklist-card {
  padding: 24px;
  background: #0f0f12;
  border: 1px solid #19191d;
  border-radius: 12px;
}

.checklist-items {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}

.check-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 11px 14px;
  background: #131316;
  border: 1px solid #1a1a1e;
  border-radius: 8px;
  transition: all var(--transition-fast);
}

.check-item.done {
  border-color: rgba(16, 185, 129, 0.25);
  background: rgba(16, 185, 129, 0.04);
}

.check-item input[type="checkbox"] {
  width: 17px;
  height: 17px;
  margin-top: 2px;
  accent-color: var(--emerald);
  cursor: pointer;
}

.check-text strong {
  display: block;
  font-size: 0.92rem;
  color: #fff;
}

.check-text span {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ==========================================================================
   MODERATION QUEUE (TAB 5)
   ========================================================================== */
.mod-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 12px;
}

.mod-tabs {
  display: flex;
  gap: 6px;
}

.mod-tab-btn {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  border: 1px solid #1c1c20;
  background: #121215;
  color: var(--text-secondary);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.mod-tab-btn.active {
  background: #ffffff;
  color: #000000;
  border-color: #ffffff;
}

.mod-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mod-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: #0f0f12;
  border: 1px solid #19191d;
  border-radius: 10px;
  gap: 16px;
}

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

/* ==========================================================================
   ANALYTICS KPIS (TAB 7)
   ========================================================================== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

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

.kpi-card {
  padding: 20px;
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  background: #0f0f12;
  border: 1px solid #19191d;
}

.kpi-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.kpi-value {
  font-size: 2rem;
  font-weight: 800;
  color: #fff;
  line-height: 1;
  margin-bottom: 4px;
}

.kpi-sub {
  font-size: 0.76rem;
  color: var(--text-muted);
}

/* Mobile responsive collapse */
@media (max-width: 768px) {
  .admin-layout {
    flex-direction: column;
    padding: 8px;
    gap: 8px;
  }
  .admin-sidebar {
    width: 100%;
    height: auto;
    max-height: 220px;
  }
}
