/* client/css/studio.css — Kick.com Creator Dashboard & Stream Manager Styling (Cross-Browser Optimized) */

.studio-wrapper {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  background-color: #080b11;
}

/* ── Kick Creator Dashboard Header ── */
.studio-navbar {
  height: 54px;
  min-height: 54px;
  background-color: #0d121b;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 100;
  flex-shrink: 0;
}

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

.studio-brand-title {
  font-family: var(--font-title);
  font-size: 1.15rem;
  font-weight: 900;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.kick-badge {
  background: var(--primary);
  color: var(--primary-text);
  font-size: 0.65rem;
  font-weight: 900;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

/* Metrics HUD Bar */
.studio-metrics-bar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.metric-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #131926;
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.metric-pill strong {
  color: #fff;
}

.metric-pill.live-health {
  border-color: rgba(83, 252, 24, 0.35);
  color: var(--primary);
}

/* ── Kick Stream Manager Layout ── */
.studio-stage {
  display: flex;
  flex: 1 1 0%;
  height: calc(100vh - 54px);
  height: calc(100dvh - 54px);
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

/* Main Left Stage: Preview + Quick Actions + Edit */
.studio-main-stage {
  flex: 1 1 0%;
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 16px;
  gap: 16px;
  background: #080b11;
  scrollbar-width: thin;
  scrollbar-color: #252f45 transparent;
}

.studio-main-stage::-webkit-scrollbar {
  width: 5px;
}
.studio-main-stage::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: var(--radius-full);
}

/* ── Stream Preview Card ── */
.preview-container {
  background: #0f1521;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-md);
  min-width: 0;
  flex-shrink: 0;
}

.preview-video-box {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  background-color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  min-width: 0;
}

.preview-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview-video.mirror {
  transform: scaleX(-1);
}

.camera-off-overlay {
  position: absolute;
  inset: 0;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #080b12;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--text-muted);
  z-index: 5;
}

.camera-off-overlay.show {
  display: flex;
}

.preview-overlay-hud {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
  z-index: 10;
}

/* Hardware Bar under Preview */
.hardware-bar {
  padding: 10px 14px;
  background: #131926;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.hw-buttons-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hw-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 700;
  background: #1a2233;
  border: 1px solid var(--border);
  color: #fff;
  cursor: pointer;
  transition: var(--transition);
}

.hw-btn:hover {
  background: #232e45;
}

.hw-btn.active {
  background: rgba(83, 252, 24, 0.15);
  border-color: var(--primary);
  color: var(--primary);
}

.hw-btn.danger {
  background: rgba(255, 51, 85, 0.18);
  border-color: var(--accent-red);
  color: var(--accent-red);
}

/* Audio VU Meter */
.vu-meter-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #1a2233;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.vu-meter-bar {
  width: 90px;
  height: 8px;
  background: #0b0e14;
  border-radius: var(--radius-full);
  overflow: hidden;
}

.vu-meter-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(to right, #53FC18 65%, #ffbe0b 85%, #ff3355 100%);
  transition: width 0.05s ease;
}

/* ── Kick Quick Actions Tiles Grid ── */
.quick-actions-title {
  font-family: var(--font-title);
  font-size: 0.95rem;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  min-width: 0;
}

.qa-tile {
  background: #111723;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
  box-sizing: border-box;
  min-width: 0;
}

.qa-tile:hover {
  background: #161e2e;
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.qa-tile-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: #182133;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: var(--primary);
  border: 1px solid var(--border);
}

.qa-tile-title {
  font-size: 0.88rem;
  font-weight: 800;
  color: #fff;
}

.qa-tile-desc {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.35;
}

/* Hero Go Live Tile */
.qa-tile.hero-go-live {
  background: linear-gradient(135deg, rgba(83, 252, 24, 0.15) 0%, #111723 100%);
  border-color: rgba(83, 252, 24, 0.45);
}

.qa-tile.hero-go-live:hover {
  box-shadow: 0 0 25px rgba(83, 252, 24, 0.35);
  border-color: var(--primary);
}

.qa-tile.hero-go-live .qa-tile-icon {
  background: var(--primary);
  color: var(--primary-text);
  box-shadow: 0 0 15px rgba(83, 252, 24, 0.5);
}

.qa-tile.hero-end-live {
  background: linear-gradient(135deg, rgba(255, 51, 85, 0.15) 0%, #111723 100%);
  border-color: rgba(255, 51, 85, 0.4);
}

.qa-tile.hero-end-live .qa-tile-icon {
  background: var(--accent-red);
  color: #fff;
  box-shadow: 0 0 15px rgba(255, 51, 85, 0.5);
}

/* ── Stream Info Setup Card ── */
.stream-info-card {
  background: #0f1521;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-sizing: border-box;
}

.stream-info-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stream-info-header h3 {
  font-family: var(--font-title);
  font-size: 1rem;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Kick Streamer Chat Panel ── */
.studio-chat-column {
  width: 380px;
  min-width: 320px;
  background-color: var(--bg-surface);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  min-width: 0;
  position: relative;
  box-sizing: border-box;
}

.studio-chat-header {
  height: 52px;
  padding: 0 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #0f1521;
  flex-shrink: 0;
}

.studio-chat-title {
  font-family: var(--font-title);
  font-size: 0.95rem;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Mobile Streamer Dashboard Rules ── */
.studio-mobile-tabs {
  display: none;
  height: 44px;
  min-height: 44px;
  background: #0c1017;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

@media (max-width: 992px) {
  .studio-stage {
    flex-direction: column;
    height: calc(100vh - 54px);
    height: calc(100dvh - 54px);
    min-height: 0;
  }

  .studio-mobile-tabs {
    display: flex;
  }

  .studio-metrics-bar {
    display: none;
  }

  .studio-main-stage {
    display: none;
    padding: 12px;
    flex: 1 1 0%;
    min-height: 0;
    height: auto;
  }

  .studio-main-stage.mobile-active {
    display: flex;
  }

  .studio-chat-column {
    display: none;
    width: 100%;
    min-width: 100%;
    border-left: none;
    flex: 1 1 0%;
    min-height: 0;
    height: auto;
  }

  .studio-chat-column.mobile-active {
    display: flex;
  }

  .quick-actions-grid {
    grid-template-columns: 1fr 1fr;
  }
}
