/* ============================================
   SPHERE LIVE STREAMING - FACEBOOK LIVE STYLE
   Dark theme with teal-to-green gradient accents
   ============================================ */

:root {
  --sphere-teal: #0891b2;
  --sphere-green: #06d6a0;
  --live-red: #f02849;
  --dark-bg: #18191a;
  --dark-surface: #242526;
  --dark-hover: #3a3b3c;
  --text-primary: #e4e6eb;
  --text-secondary: #b0b3b8;
  --border-color: #3e4042;
}

/* ============================================
   PRE-LIVE SETUP SCREEN
   ============================================ */
.live-setup-screen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--dark-bg);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  animation: fadeIn 0.3s ease;
}

.live-setup-header {
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
}

.live-setup-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
}

.live-setup-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--dark-hover);
  border: none;
  color: var(--text-primary);
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.live-setup-close:hover {
  background: var(--dark-surface);
}

/* Video Preview */
.live-preview-container {
  position: relative;
  flex: 1;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.live-preview-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.live-preview-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
}

.camera-permission-prompt {
  text-align: center;
  padding: 32px;
}

.camera-permission-prompt svg {
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.camera-permission-prompt p {
  color: var(--text-primary);
  font-size: 18px;
  margin-bottom: 20px;
}

.camera-permission-prompt button {
  background: linear-gradient(135deg, var(--sphere-teal), var(--sphere-green));
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.camera-permission-prompt button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(8, 145, 178, 0.4);
}

/* User Profile Section */
.live-user-profile {
  position: absolute;
  top: 16px;
  left: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 10;
}

.live-user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid white;
}

.live-user-name {
  color: white;
  font-weight: 600;
  font-size: 16px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* Privacy Dropdown */
.live-privacy-dropdown {
  position: absolute;
  top: 70px;
  left: 16px;
  z-index: 10;
}

.live-privacy-btn {
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
  backdrop-filter: blur(10px);
}

.live-privacy-btn:hover {
  background: rgba(0, 0, 0, 0.7);
}

.privacy-icon {
  font-size: 16px;
}

.privacy-menu {
  position: absolute;
  top: 40px;
  left: 0;
  background: var(--dark-surface);
  border-radius: 8px;
  min-width: 180px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  z-index: 100;
}

.privacy-option {
  padding: 12px 16px;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background 0.2s;
}

.privacy-option:hover {
  background: var(--dark-hover);
}

/* Camera Controls Row */
.live-camera-controls {
  position: absolute;
  top: 110px;
  left: 16px;
  right: 16px;
  display: flex;
  gap: 12px;
  z-index: 10;
}

.camera-control-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.camera-control-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.05);
}

.camera-control-btn:active {
  transform: scale(0.95);
}

.camera-control-btn.active {
  background: rgba(255, 255, 255, 0.4);
}

.camera-control-btn svg {
  width: 20px;
  height: 20px;
}

/* Title Field */
.live-title-field {
  position: absolute;
  bottom: 200px;
  left: 16px;
  right: 16px;
  z-index: 10;
}

.live-title-input {
  width: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  padding: 14px 16px;
  border-radius: 12px;
  font-size: 18px;
  font-weight: 600;
  outline: none;
  transition: all 0.2s;
}

.live-title-input::placeholder {
  color: rgba(255, 255, 255, 0.6);
  font-weight: 400;
}

.live-title-input:focus {
  background: rgba(0, 0, 0, 0.7);
  border-color: var(--sphere-teal);
  box-shadow: 0 0 0 2px rgba(8, 145, 178, 0.2);
}

/* Description Field */
.live-description-field {
  position: absolute;
  bottom: 140px;
  left: 16px;
  right: 16px;
  z-index: 10;
}

.live-description-input {
  width: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  padding: 14px 16px;
  border-radius: 12px;
  font-size: 16px;
  outline: none;
  transition: all 0.2s;
}

.live-description-input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.live-description-input:focus {
  background: rgba(0, 0, 0, 0.7);
  border-color: var(--sphere-teal);
  box-shadow: 0 0 0 2px rgba(8, 145, 178, 0.2);
}

/* Share to Story Toggle */
.live-share-toggle {
  position: absolute;
  bottom: 90px;
  left: 16px;
  right: 16px;
  z-index: 10;
}

.share-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 12px 16px;
  border-radius: 12px;
}

.share-toggle-label {
  color: white;
  font-size: 15px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Live streaming toggle — div-based, matches design system sizing (44×24) */
.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.toggle-switch.active {
  background: var(--sphere-teal);
}

.toggle-switch-handle {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: white;
  border-radius: 50%;
  transition: left 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.toggle-switch.active .toggle-switch-handle {
  left: 23px;
}

/* Bottom Toolbar */
.live-bottom-toolbar {
  position: absolute;
  bottom: 16px;
  left: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 10;
}

.live-toolbar-left {
  display: flex;
  gap: 20px;
}

.toolbar-icon-btn {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  opacity: 0.9;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 13px;
}

.toolbar-icon-btn:hover {
  opacity: 1;
  transform: translateY(-2px);
}

.toolbar-icon-btn svg {
  width: 24px;
  height: 24px;
}

.go-live-btn-large {
  background: linear-gradient(135deg, var(--sphere-teal), var(--sphere-green));
  color: white;
  border: none;
  padding: 14px 32px;
  border-radius: 8px;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(8, 145, 178, 0.3);
}

.go-live-btn-large:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(8, 145, 178, 0.4);
}

.go-live-btn-large:active {
  transform: translateY(0);
}

/* ============================================
   LIVE BROADCAST VIEW
   ============================================ */
.live-broadcast-screen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #000;
  z-index: 10000;
}

.live-broadcast-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

.live-badge {
  position: absolute;
  top: 20px;
  left: 20px;
  background: var(--live-red);
  color: white;
  padding: 6px 12px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.live-pulse {
  width: 8px;
  height: 8px;
  background: white;
  border-radius: 50%;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.2); }
}

.live-viewer-count {
  position: absolute;
  top: 20px;
  left: 90px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  color: white;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 100;
}

.live-viewer-count svg {
  width: 16px;
  height: 16px;
}

.live-duration {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  color: white;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  z-index: 100;
}

/* Comments Feed */
.live-comments-feed {
  position: absolute;
  bottom: 140px;
  left: 0;
  right: 0;
  max-height: 250px;
  overflow-y: auto;
  padding: 16px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.live-comment {
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  padding: 10px 14px;
  border-radius: 18px;
  max-width: 70%;
  animation: slideInLeft 0.3s ease;
}

.live-comment-author {
  color: var(--sphere-teal);
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 2px;
}

.live-comment-text {
  color: white;
  font-size: 14px;
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.live-comments-placeholder {
  color: rgba(255, 255, 255, 0.5);
  text-align: center;
  font-size: 14px;
  padding: 20px;
}

/* Streamer Comment Input */
.live-comment-input-container {
  position: absolute;
  bottom: 80px;
  left: 16px;
  right: 16px;
  display: flex;
  gap: 8px;
  align-items: center;
  z-index: 101;
}

.streamer-comment-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 24px;
  padding: 12px 18px;
  color: white;
  font-size: 14px;
  outline: none;
  transition: all 0.2s;
}

.streamer-comment-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.streamer-comment-input:focus {
  background: rgba(255, 255, 255, 0.2);
  border-color: var(--sphere-teal);
  box-shadow: 0 0 0 2px rgba(8, 145, 178, 0.3);
}

.streamer-send-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--sphere-teal), var(--sphere-green));
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.streamer-send-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(8, 145, 178, 0.4);
}

.streamer-send-btn:active {
  transform: scale(0.95);
}

.streamer-send-btn svg {
  width: 20px;
  height: 20px;
}

/* Broadcast Controls */
.live-broadcast-controls {
  position: absolute;
  bottom: 16px;
  left: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 100;
}

.broadcast-control-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  -webkit-tap-highlight-color: rgba(255, 255, 255, 0.3);
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  position: relative;
  z-index: 10;
}

.broadcast-control-btn:hover,
.broadcast-control-btn:active {
  background: rgba(255, 255, 255, 0.35);
  transform: scale(1.05);
}

.broadcast-control-btn svg {
  width: 22px;
  height: 22px;
  pointer-events: none;
}

.broadcast-control-btn * {
  pointer-events: none;
}

.end-live-btn {
  background: var(--live-red);
  border: none;
  color: white;
  padding: 12px 24px;
  border-radius: 24px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.2s;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(255, 255, 255, 0.3);
  user-select: none;
  -webkit-user-select: none;
  position: relative;
  z-index: 10;
}

.end-live-btn:hover {
  background: #d01f3a;
  transform: translateY(-2px);
}

/* ============================================
   ENDING ANIMATION
   ============================================ */
.live-ending-screen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(20px);
  z-index: 10001;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.4s ease;
}

.ending-checkmark {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--sphere-green);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  animation: scaleIn 0.5s ease;
}

.ending-checkmark svg {
  width: 44px;
  height: 44px;
  color: white;
}

.ending-text {
  color: white;
  font-size: 22px;
  font-weight: 600;
  animation: fadeInUp 0.5s ease 0.2s both;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.5);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

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

/* ============================================
   LIVE SETTINGS PANEL (Slide-up)
   ============================================ */
.live-settings-panel {
  position: fixed;
  bottom: -100%;
  left: 0;
  right: 0;
  background: var(--dark-surface);
  border-radius: 16px 16px 0 0;
  z-index: 10002;
  max-height: 80vh;
  overflow-y: auto;
  transition: bottom 0.3s ease;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
}

.live-settings-panel.open {
  bottom: 0;
}

.live-settings-panel-header {
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  background: var(--dark-surface);
  z-index: 10;
}

.live-settings-panel-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.live-settings-panel-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--dark-hover);
  border: none;
  color: var(--text-primary);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.live-settings-panel-body {
  padding: 16px;
}

.settings-section {
  margin-bottom: 24px;
}

.settings-section-title {
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.settings-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px;
  background: var(--dark-bg);
  border-radius: 8px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.settings-option:hover {
  background: var(--dark-hover);
}

.settings-option-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.settings-option-icon {
  width: 20px;
  height: 20px;
  color: var(--text-primary);
}

.settings-option-label {
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 500;
}

.settings-option-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.settings-chevron {
  width: 16px;
  height: 16px;
  color: var(--text-secondary);
}

/* ============================================
   ADVANCED SETTINGS SUB-PANEL
   ============================================ */
.advanced-settings-panel {
  position: fixed;
  bottom: -100%;
  left: 0;
  right: 0;
  top: 0;
  background: var(--dark-bg);
  z-index: 10003;
  overflow-y: auto;
  transition: bottom 0.3s ease;
}

.advanced-settings-panel.open {
  bottom: 0;
}

.advanced-settings-header {
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 16px;
  position: sticky;
  top: 0;
  background: var(--dark-bg);
  z-index: 10;
}

.back-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--dark-hover);
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.advanced-settings-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.advanced-settings-body {
  padding: 16px;
}

/* Latency Option */
.latency-option {
  background: var(--dark-surface);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 12px;
}

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

.latency-label {
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 500;
}

.latency-value {
  color: var(--sphere-teal);
  font-size: 14px;
  font-weight: 600;
}

.latency-description {
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.5;
}

/* ============================================
   LIVE VIEWER MODAL (watching someone else's stream)
   ============================================ */
.live-viewer-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #000;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.live-viewer-container {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #000;
  overflow: hidden;
}

.live-viewer-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  z-index: 1;
}

/* For portrait videos on desktop, center them properly */
@media (min-width: 768px) {
  .live-viewer-video {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
  }
}

.live-viewer-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 10;
}

.live-viewer-overlay > * {
  pointer-events: auto;
}

.live-viewer-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  border: none;
  color: white;
  font-size: 28px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  z-index: 100;
}

.live-viewer-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

/* Position the LIVE badge in viewer modal */
.live-viewer-modal .live-badge {
  position: absolute;
  top: 20px;
  left: 20px;
  z-index: 100;
}

/* ============================================
   VIEWER COMMENTS & ACTIONS (Overlay on video)
   ============================================ */

/* Bottom section container - overlay on video */
.live-bottom-section {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.4) 50%, transparent 100%);
  pointer-events: none;
}

.live-bottom-section > * {
  pointer-events: auto;
}

/* Comments container - overlaid on video */
.live-comments-container {
  max-height: 200px;
  overflow-y: auto;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

/* Hide scrollbar but keep functionality */
.live-comments-container::-webkit-scrollbar {
  width: 4px;
}

.live-comments-container::-webkit-scrollbar-track {
  background: transparent;
}

.live-comments-container::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.2);
  border-radius: 2px;
}

/* Comments list */
.live-comments-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Individual comment in viewer */
.live-comment {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  animation: slideInLeft 0.3s ease;
  max-width: 85%;
}

.live-comment-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid rgba(255,255,255,0.2);
}

.live-comment-content {
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 8px 14px;
  border-radius: 18px;
  flex: 1;
  min-width: 0;
}

.live-comment-name {
  color: var(--sphere-teal);
  font-weight: 600;
  font-size: 13px;
  margin-right: 6px;
}

.live-comment-text {
  color: white;
  font-size: 14px;
  word-wrap: break-word;
}

/* Comment actions (reply, view replies) */
.live-comment-actions {
  display: flex;
  gap: 12px;
  margin-top: 4px;
  padding-left: 46px;
}

.live-comment-reply-btn,
.live-comment-view-replies {
  background: none;
  border: none;
  color: rgba(255,255,255,0.6);
  font-size: 12px;
  cursor: pointer;
  padding: 0;
  transition: color 0.2s;
}

.live-comment-reply-btn:hover,
.live-comment-view-replies:hover {
  color: var(--sphere-teal);
}

/* Comment replies container */
.live-comment-replies {
  display: none;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
  padding-left: 42px;
  border-left: 2px solid rgba(255,255,255,0.1);
  margin-left: 16px;
}

.live-comment-replies.show {
  display: flex;
}

/* Reply input wrapper */
.live-comment-reply-input-wrapper {
  display: flex;
  gap: 8px;
  padding: 8px 0;
  align-items: center;
}

.live-comment-reply-input {
  flex: 1;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 20px;
  padding: 8px 14px;
  color: white;
  font-size: 13px;
  outline: none;
}

.live-comment-reply-input:focus {
  border-color: var(--sphere-teal);
}

.live-comment-reply-send,
.live-comment-reply-cancel {
  background: rgba(255,255,255,0.15);
  border: none;
  color: white;
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.live-comment-reply-send:hover {
  background: var(--sphere-teal);
}

.live-comment-reply-cancel:hover {
  background: rgba(255,255,255,0.25);
}

/* Actions bar - input and reaction */
.live-actions-bar {
  display: flex;
  gap: 12px;
  align-items: center;
}

/* Comment input field */
.live-comment-input {
  flex: 1;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 24px;
  padding: 12px 18px;
  color: white;
  font-size: 14px;
  outline: none;
  transition: all 0.2s;
}

.live-comment-input::placeholder {
  color: rgba(255,255,255,0.5);
}

.live-comment-input:focus {
  background: rgba(255,255,255,0.2);
  border-color: var(--sphere-teal);
  box-shadow: 0 0 0 2px rgba(8,145,178,0.3);
}

/* Reaction button */
.live-reaction-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.2);
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.live-reaction-btn:hover {
  background: rgba(255,255,255,0.25);
  transform: scale(1.1);
}

.live-reaction-btn:active {
  transform: scale(0.95);
  background: rgba(240, 40, 73, 0.4);
}

/* Mirror/flip video effect */
.live-viewer-video.mirrored {
  transform: scaleX(-1);
}

@media (min-width: 768px) {
  .live-viewer-video.mirrored {
    transform: translate(-50%, -50%) scaleX(-1);
  }
}

/* Mirror toggle button */
.live-mirror-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.2);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.live-mirror-btn:hover {
  background: rgba(255,255,255,0.25);
  transform: scale(1.1);
}

.live-mirror-btn:active {
  transform: scale(0.95);
}

.live-mirror-btn.active {
  background: var(--sphere-teal);
  border-color: var(--sphere-teal);
}

.live-mirror-btn svg {
  width: 24px;
  height: 24px;
}

/* Floating reaction animation */
.live-floating-reaction {
  position: fixed;
  font-size: 32px;
  z-index: 10000;
  pointer-events: none;
  animation: floatUp 2s ease-out forwards;
}

@keyframes floatUp {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  50% {
    opacity: 1;
    transform: translateY(-100px) scale(1.2);
  }
  100% {
    opacity: 0;
    transform: translateY(-200px) scale(0.8);
  }
}

/* Reactions container for broadcaster screen */
.live-broadcast-screen .reactions-container,
.live-broadcast-screen .live-reactions-area,
#broadcast-reactions-container,
#viewer-reactions-area {
  position: absolute;
  bottom: 120px;
  right: 20px;
  width: 80px;
  height: 300px;
  pointer-events: none;
  z-index: 100;
}

.live-broadcast-screen .floating-reaction,
.live-broadcast-screen .live-reaction-float {
  position: absolute;
  bottom: 0;
  font-size: 32px;
  animation: floatUp 2s ease-out forwards;
  pointer-events: none;
}

/* Stats panel animation */
@keyframes fadeInStats {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* Reaction buttons - viewer bar */
.live-reaction-btn {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  transition: transform 0.15s ease, background 0.15s ease;
  padding: 0;
}
.live-reaction-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.2);
}
.live-reaction-btn:active {
  transform: scale(0.9);
  background: rgba(255, 255, 255, 0.3);
}

/* ============================================
   UTILITIES
   ============================================ */
.hidden {
  display: none !important;
}

/* Scrollbar Styling */
.live-settings-panel::-webkit-scrollbar,
.live-comments-feed::-webkit-scrollbar {
  width: 6px;
}

.live-settings-panel::-webkit-scrollbar-track,
.live-comments-feed::-webkit-scrollbar-track {
  background: transparent;
}

.live-settings-panel::-webkit-scrollbar-thumb,
.live-comments-feed::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

.live-settings-panel::-webkit-scrollbar-thumb:hover,
.live-comments-feed::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Multiple reaction buttons container */
.live-reaction-buttons {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.live-reaction-buttons .live-reaction-btn {
  width: 40px;
  height: 40px;
  font-size: 18px;
}

/* Reply input wrapper */
.live-comment-reply-input-wrapper {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 8px 0;
  margin-left: 40px;
}

.live-comment-reply-input {
  flex: 1;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 20px;
  padding: 8px 14px;
  color: white;
  font-size: 13px;
  outline: none;
}

.live-comment-reply-input::placeholder {
  color: rgba(255,255,255,0.4);
}

.live-comment-reply-send,
.live-comment-reply-cancel {
  background: none;
  border: none;
  color: rgba(255,255,255,0.7);
  font-size: 13px;
  cursor: pointer;
  padding: 6px 10px;
  white-space: nowrap;
}

.live-comment-reply-send {
  color: var(--sphere-teal, #0891b2);
  font-weight: 600;
}

.live-comment-reply-send:hover,
.live-comment-reply-cancel:hover {
  color: #fff;
}

/* Streamer comment input in broadcast screen */
.streamer-comment-input {
  flex: 1;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 24px;
  padding: 10px 16px;
  color: white;
  font-size: 14px;
  outline: none;
}

.streamer-comment-input::placeholder {
  color: rgba(255,255,255,0.5);
}

.streamer-send-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--sphere-teal, #0891b2);
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s;
}

.streamer-send-btn:hover {
  background: #06b6d4;
}

/* Mobile Optimization */
@media (max-width: 768px) {
  .live-setup-title {
    font-size: 18px;
  }

  .camera-control-btn {
    width: 40px;
    height: 40px;
  }

  .live-description-input {
    font-size: 14px;
  }

  .go-live-btn-large {
    padding: 12px 24px;
    font-size: 16px;
  }

  .live-settings-panel {
    max-height: 90vh;
  }

  .live-reaction-buttons .live-reaction-btn {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }

  .live-reaction-buttons {
    gap: 2px;
  }

  .live-comment-input {
    padding: 10px 14px;
    font-size: 13px;
  }

  .live-comment-reply-input-wrapper {
    margin-left: 20px;
  }

  .live-viewer-modal .live-viewer-count {
    top: 12px;
    right: 50px;
    font-size: 12px;
    padding: 4px 10px;
  }

  /* Mobile broadcast controls - larger touch targets */
  .broadcast-control-btn {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
  }

  .broadcast-control-btn svg {
    width: 20px;
    height: 20px;
  }

  /* Fix mobile comment input when keyboard opens */
  .live-comment-input-container {
    bottom: 70px;
  }

  .streamer-comment-input {
    padding: 10px 14px;
    font-size: 14px;
  }

  /* Adjust comments feed on mobile */
  .live-broadcast-screen .live-comments-feed {
    bottom: 120px;
    max-height: 180px;
  }
}

/* Fix for mobile keyboard pushing content - broadcaster */
@media (max-height: 500px) {
  .live-comment-input-container {
    bottom: 60px;
  }

  .live-broadcast-screen .live-comments-feed {
    bottom: 110px;
    max-height: 120px;
  }

  .live-broadcast-controls {
    bottom: 8px;
  }
}

/* Fix for viewer comment input on mobile */
@media (max-width: 768px) {
  .live-actions-bar {
    padding: 8px 12px;
    gap: 8px;
  }

  .live-actions-bar .live-comment-input {
    font-size: 14px;
    padding: 10px 14px;
  }
}
