/* ==========================================
   PROK-TV: 실시간 시청 뷰어 스타일 (Viewer CSS)
   ========================================== */

:root {
  --viewer-bg: #070F1E;
  --viewer-header-bg: #0C1E38;
  --viewer-card-bg: #112542;
  --viewer-border: rgba(255, 255, 255, 0.1);
  --viewer-accent: #02C39A;
  --viewer-gold: #D4AF37;
  --viewer-text: #F8FAFC;
  --viewer-sub: #94A3B8;
}

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

body.viewer-body {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background-color: var(--viewer-bg);
  color: var(--viewer-text);
  font-family: 'Outfit', 'Noto Sans KR', sans-serif;
  display: flex;
  flex-direction: column;
  user-select: none;
  -webkit-user-select: none;
}

/* Viewer Top Navigation */
.viewer-header {
  height: 60px;
  background: var(--viewer-header-bg);
  border-bottom: 1px solid var(--viewer-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 50;
  flex-shrink: 0;
}

.viewer-header-left {
  display: flex;
  align-items: center;
  gap: 16px;
  overflow: hidden;
}

.btn-back-portal {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--viewer-border);
  color: #E2E8F0;
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-back-portal:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #FFFFFF;
}

.viewer-title-box {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.viewer-session-title {
  font-size: 1rem;
  font-weight: 700;
  color: #FFFFFF;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.viewer-session-meta {
  font-size: 0.75rem;
  color: var(--viewer-sub);
  display: flex;
  align-items: center;
  gap: 8px;
}

.viewer-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.viewer-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.5);
  color: #F87171;
  font-size: 0.74rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 9999px;
  letter-spacing: 0.5px;
}

.viewer-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #EF4444;
  box-shadow: 0 0 8px #EF4444;
}

.viewer-viewers-badge {
  font-size: 0.78rem;
  color: #CBD5E1;
  background: rgba(255, 255, 255, 0.06);
  padding: 5px 12px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-fullscreen {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--viewer-border);
  color: #FFFFFF;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.btn-fullscreen:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Viewer Main Stage */
.viewer-stage {
  flex-grow: 1;
  position: relative;
  width: 100%;
  height: calc(100vh - 60px);
  overflow: hidden;
  background: #020712;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Document & Screen Canvas Layer */
.screen-viewport-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  background: #020712;
  overflow: hidden;
  touch-action: none;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}

.screen-viewport-wrap.is-dragging {
  cursor: grabbing;
}

.zoom-transform-layer {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
  will-change: transform;
  transition: transform 0.16s cubic-bezier(0.16, 1, 0.3, 1);
  display: block;
}

.zoom-transform-layer.no-transition {
  transition: none !important;
}

.screen-canvas-img {
  display: block;
  max-width: none;
  max-height: none;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.7);
  border-radius: 4px;
  image-rendering: auto;
  -webkit-font-smoothing: antialiased;
}

/* Floating Minimal Scrollbar Indicator */
.viewer-scrollbar-y {
  position: absolute;
  top: 16px;
  right: 8px;
  bottom: 84px;
  width: 5px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 9999px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 25;
}

.viewer-scrollbar-y.visible {
  opacity: 1;
}

.viewer-scrollbar-thumb {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 40px;
  background: rgba(2, 195, 154, 0.7);
  box-shadow: 0 0 8px rgba(2, 195, 154, 0.4);
  border-radius: 9999px;
  transition: transform 0.05s linear;
}

/* Floating Glass Zoom Toolbar */
.viewer-zoom-toolbar {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(12, 30, 56, 0.88);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(2, 195, 154, 0.2);
  border-radius: 9999px;
  padding: 5px 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 30;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.viewer-zoom-toolbar.is-panning {
  opacity: 0.35;
  pointer-events: none;
}

.zoom-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #E2E8F0;
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
}

.zoom-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #FFFFFF;
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.zoom-btn:active {
  transform: translateY(0);
}

.zoom-btn.active {
  background: rgba(2, 195, 154, 0.22);
  border-color: rgba(2, 195, 154, 0.65);
  color: var(--viewer-accent);
}

.zoom-btn-mode {
  padding: 0 12px;
}

.zoom-badge-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #F8FAFC;
  min-width: 52px;
  height: 34px;
  padding: 0 8px;
  border-radius: 9999px;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s ease;
}

.zoom-badge-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(2, 195, 154, 0.4);
  color: var(--viewer-accent);
}

.zoom-divider {
  width: 1px;
  height: 20px;
  background: rgba(255, 255, 255, 0.15);
  margin: 0 2px;
}

.zoom-btn-reset {
  min-width: 32px;
  height: 32px;
  padding: 0;
}

/* Mobile Responsive Optimization for Zoom Toolbar */
@media (max-width: 640px) {
  .viewer-zoom-toolbar {
    bottom: 16px;
    padding: 4px 6px;
    gap: 4px;
  }

  .zoom-mode-text {
    display: none;
  }

  .zoom-btn-mode {
    padding: 0 8px;
    min-width: 34px;
  }

  .zoom-badge-btn {
    min-width: 44px;
    font-size: 0.74rem;
  }
}

/* Live Simulation Card (데모 화면 또는 텍스트 프레젠테이션) */
.stage-demo-card {
  max-width: 900px;
  width: 90%;
  background: #0E223D;
  border: 1px solid rgba(197, 160, 89, 0.35);
  border-radius: 16px;
  padding: 40px 36px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  text-align: center;
}

.demo-emblem-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(197, 160, 89, 0.15);
  border: 1px solid var(--viewer-gold);
  color: var(--viewer-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}

.demo-doc-badge {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  background: rgba(2, 195, 154, 0.15);
  color: var(--viewer-accent);
  padding: 4px 14px;
  border-radius: 9999px;
  margin-bottom: 14px;
}

.demo-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: #FFFFFF;
  margin-bottom: 12px;
}

.demo-text-content {
  font-size: 1.05rem;
  color: #CBD5E1;
  line-height: 1.75;
  margin-bottom: 28px;
  padding: 20px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 10px;
}

.demo-sync-footer {
  font-size: 0.82rem;
  color: var(--viewer-sub);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* Standby / Ended Screen */
.viewer-standby-screen {
  position: absolute;
  inset: 0;
  background: rgba(7, 15, 30, 0.95);
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  z-index: 40;
}

.standby-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: #FFFFFF;
  margin-bottom: 10px;
}

.standby-desc {
  font-size: 0.92rem;
  color: var(--viewer-sub);
  max-width: 440px;
  line-height: 1.6;
  margin-bottom: 24px;
}

.btn-portal-return {
  background: var(--viewer-accent);
  color: #032A25;
  padding: 10px 24px;
  border-radius: 8px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s;
}

.btn-portal-return:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(2, 195, 154, 0.4);
}
