/* ==========================================================================
   Live Studio Manager - Modern SaaS Admin Stylesheet
   Compact, Ultra-Clean, Professional Dark Studio Aesthetics
   ========================================================================== */

:root {
  --bg-dark: #080c14;
  --bg-card: #0f172a;
  --bg-card-hover: #1e293b;
  --bg-input: #172033;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-active: #00f0ff;

  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --accent-cyan: #00f0ff;
  --accent-green: #10b981;
  --accent-amber: #f59e0b;
  --accent-red: #ef4444;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-sub: #64748b;

  --font-heading: 'Montserrat', -apple-system, sans-serif;
  --font-body: 'Inter', -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.88rem;
  min-height: 100vh;
  line-height: 1.45;
  padding-bottom: 40px;
  -webkit-font-smoothing: antialiased;
}

.admin-layout {
  max-width: 1560px;
  margin: 0 auto;
  padding: 16px 24px;
}

/* 1. Header Topbar */
.admin-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0 18px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 18px;
  gap: 15px;
  flex-wrap: wrap;
}

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

.brand-badge-icon {
  font-size: 1.6rem;
  background: rgba(37, 99, 235, 0.2);
  border: 1px solid rgba(37, 99, 235, 0.4);
  padding: 6px 10px;
  border-radius: 10px;
}

.brand h1 {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 800;
  background: linear-gradient(135deg, #ffffff, #93c5fd);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.2;
}

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

.channel-profile-bar {
  display: flex;
  background: rgba(15, 23, 42, 0.9);
  padding: 4px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  gap: 6px;
}

.profile-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.profile-tab-icon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  object-fit: cover;
}

.profile-tab.active {
  background: #1e293b;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.topbar-actions {
  display: flex;
  gap: 10px;
}

/* 2. Grid Layout */
.admin-content-grid {
  display: grid;
  grid-template-columns: 1.12fr 0.88fr;
  gap: 20px;
  align-items: start;
}

/* 3. Navigation Tabs */
.main-nav-tabs {
  display: flex;
  background: #0f172a;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 4px;
  gap: 4px;
  margin-bottom: 14px;
  overflow-x: auto;
}

.nav-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 9px 12px;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.nav-tab:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.04);
}

.nav-tab.active {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.35);
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
  animation: fadeIn 0.25s ease forwards;
}

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

/* 4. Panel Cards */
.panel-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  margin-bottom: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--border-color);
}

.panel-header h3 {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 750;
  color: #ffffff;
}

.panel-body {
  padding: 18px;
}

.info-banner {
  background: rgba(37, 99, 235, 0.1);
  border: 1px solid rgba(37, 99, 235, 0.3);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.8rem;
  color: #bfdbfe;
  margin-bottom: 14px;
}

/* 5. Ratio Selector Grid */
.ratio-select-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 6px;
}

.ratio-option {
  position: relative;
  border: 1.5px solid var(--border-color);
  border-radius: 10px;
  padding: 10px 12px;
  background: #131d33;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ratio-option input {
  position: absolute;
  opacity: 0;
}

.ratio-option:hover {
  border-color: rgba(0, 240, 255, 0.4);
}

.ratio-option.selected {
  border-color: var(--accent-cyan);
  background: rgba(0, 240, 255, 0.06);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.15);
}

.ratio-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ratio-icon {
  font-size: 1.5rem;
}

.ratio-content strong {
  display: block;
  font-size: 0.84rem;
  color: #ffffff;
}

.ratio-content small {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* 6. Form Controls */
.form-group {
  margin-bottom: 13px;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 5px;
}

.form-control {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.85rem;
  color: #ffffff;
  font-family: inherit;
  transition: border-color 0.2s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 2px rgba(0, 240, 255, 0.15);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 12px;
}

.col-6 { grid-column: span 6; }
.col-12 { grid-column: span 12; }

.input-password-wrap {
  position: relative;
  display: flex;
}

.input-password-wrap .form-control {
  padding-right: 40px;
}

.btn-icon {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  opacity: 0.7;
}

.form-hint {
  display: block;
  font-size: 0.72rem;
  color: var(--text-sub);
  margin-top: 3px;
}

/* 7. Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--font-heading);
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
  padding: 8px 16px;
  font-size: 0.84rem;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 7px 14px;
  font-size: 0.82rem;
}

.btn-outline:hover {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.03);
}

.btn-sm {
  padding: 5px 12px;
  font-size: 0.78rem;
}

.btn-xs {
  padding: 3px 8px;
  font-size: 0.72rem;
}

.btn-danger-outline {
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.4);
}

.btn-warning {
  background: #f59e0b;
  color: #0b0f19;
  padding: 9px 16px;
  font-size: 0.85rem;
}

.w-100 { width: 100%; }

/* 8. Stream Action Big Buttons */
.stream-action-box {
  margin: 15px 0 10px;
}

.btn-stream-start {
  width: 100%;
  padding: 13px;
  font-size: 0.95rem;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-stream-start:hover {
  background: linear-gradient(135deg, #059669, #047857);
}

.btn-stream-stop {
  width: 100%;
  padding: 13px;
  font-size: 0.95rem;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.btn-stream-stop:hover {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
}

/* 9. Stream Stats Grid */
.stream-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.stat-card {
  background: #0b1120;
  border: 1px solid var(--border-color);
  padding: 8px 12px;
  border-radius: 8px;
}

.stat-title {
  display: block;
  font-size: 0.7rem;
  color: var(--text-sub);
}

.stat-val {
  font-size: 0.82rem;
  color: #ffffff;
}

.text-green { color: #10b981; }

/* 10. Status Pills & Badges */
.status-pill {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 999px;
  letter-spacing: 0.5px;
}

.status-pill.live {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-pill.offline {
  background: rgba(148, 163, 184, 0.1);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
}

.badge-accent {
  background: rgba(0, 240, 255, 0.15);
  color: #00f0ff;
  border: 1px solid rgba(0, 240, 255, 0.3);
}

.badge-info {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

/* 11. Deck Manager Sub-Tabs & Dropzone */
.sub-tab-bar {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 10px;
}

.sub-tab {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sub-tab.active {
  background: #1e293b;
  color: #ffffff;
  border-color: var(--accent-cyan);
}

.drop-zone {
  border: 2px dashed rgba(0, 240, 255, 0.3);
  border-radius: 10px;
  padding: 20px 15px;
  text-align: center;
  background: rgba(15, 23, 42, 0.4);
  cursor: pointer;
  transition: all 0.2s ease;
}

.drop-zone:hover {
  border-color: var(--accent-cyan);
  background: rgba(0, 240, 255, 0.05);
}

.drop-icon {
  font-size: 1.8rem;
  margin-bottom: 4px;
}

.drop-zone strong {
  display: block;
  font-size: 0.88rem;
}

.drop-zone small {
  font-size: 0.72rem;
  color: var(--text-sub);
}

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

.status-msg {
  font-size: 0.78rem;
  font-weight: 600;
  color: #10b981;
}

/* 12. Deck Scroll Table */
.deck-manager-footer {
  margin-top: 18px;
  border-top: 1px solid var(--border-color);
  padding-top: 12px;
}

.deck-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.deck-scroll-container {
  max-height: 240px;
  overflow-y: auto;
  background: #080d18;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 6px;
}

.deck-empty {
  text-align: center;
  color: var(--text-sub);
  padding: 20px;
  font-size: 0.8rem;
}

/* 13. Sliders & Toggles */
.slider-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}

.slider-val {
  font-size: 0.82rem;
  color: var(--accent-cyan);
}

.form-range {
  width: 100%;
  accent-color: var(--primary);
}

.toggle-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
}

.toggle-info strong {
  display: block;
  font-size: 0.8rem;
}

.toggle-info span {
  font-size: 0.7rem;
  color: var(--text-sub);
}

/* 14. Quick Stage Controls */
.quick-controls-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.btn-control {
  background: #1e293b;
  border: 1px solid var(--border-color);
  color: #ffffff;
  padding: 10px 6px;
  border-radius: 8px;
  font-size: 0.78rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.btn-control:hover {
  background: #334155;
}

/* 15. Real-Time Stream Preview Frame */
.preview-box-body {
  padding: 12px;
  display: flex;
  justify-content: center;
  background: #080c14;
}

.preview-frame-container {
  position: relative;
  background: #000000;
  border-radius: 10px;
  overflow: hidden;
  border: 1.5px solid var(--border-color);
  width: 100%;
}

.preview-frame-container.ratio-16-9 {
  aspect-ratio: 16 / 9;
  max-width: 100%;
}

.preview-frame-container.ratio-9-16 {
  aspect-ratio: 9 / 16;
  max-width: 320px;
  margin: 0 auto;
}

.preview-frame-container iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.obs-details-accordion {
  margin-top: 14px;
  font-size: 0.78rem;
  color: var(--text-sub);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px 12px;
}

.obs-details-accordion summary {
  cursor: pointer;
  color: var(--text-muted);
  font-weight: 600;
}

.obs-inner-box {
  margin-top: 8px;
}

.input-code {
  width: 100%;
  background: #080d18;
  border: 1px solid var(--border-color);
  color: var(--accent-cyan);
  padding: 5px 10px;
  border-radius: 6px;
  font-family: monospace;
  font-size: 0.75rem;
}

/* 16. Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: #1e293b;
  border-left: 4px solid var(--accent-cyan);
  color: #ffffff;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 0.84rem;
  font-weight: 600;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
  animation: slideToast 0.3s ease forwards;
}

@keyframes slideToast {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* 17. Security PIN Modal */
.lock-modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(8, 12, 20, 0.96);
  backdrop-filter: blur(8px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lock-modal {
  background: #0f172a;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 30px;
  max-width: 400px;
  text-align: center;
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.6);
}

.lock-icon {
  font-size: 2.5rem;
  margin-bottom: 8px;
}

.lock-modal h2 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  margin-bottom: 6px;
}

.lock-modal p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.pin-input-wrap {
  display: flex;
  gap: 8px;
}

.pin-input-wrap input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px;
  color: #ffffff;
  text-align: center;
  font-size: 1.2rem;
  letter-spacing: 4px;
}

.unlock-error {
  color: #ef4444;
  font-size: 0.78rem;
  margin-top: 10px;
  font-weight: 600;
}
