/* LoserParty - Podcast Recording Studio Styles */

/* CSS Variables - Professional Dark Theme */
:root {
  --bg-primary: #0d0d0d;
  --bg-secondary: #151515;
  --bg-tertiary: #1a1a1a;
  --bg-elevated: #202020;
  --bg-hover: #252525;
  --text-primary: #e5e5e5;
  --text-secondary: #a0a0a0;
  --text-muted: #666666;
  --accent-primary: #3d8bfd;
  --accent-secondary: #5a9eff;
  --accent-muted: #2d6bc4;
  --accent-glow: rgba(61, 139, 253, 0.15);
  --success: #34c759;
  --success-muted: #2a9d4a;
  --warning: #ff9f0a;
  --warning-muted: #cc7f08;
  --danger: #ff453a;
  --danger-muted: #cc362e;
  --recording: #ff453a;
  --border-color: #2a2a2a;
  --border-light: #333333;
  --shadow-color: rgba(0, 0, 0, 0.4);
  --speaking-color: #34c759;
  --connection-good: #34c759;
  --connection-medium: #ff9f0a;
  --connection-poor: #ff453a;
  
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
}

/* SVG Icons */
.icon-svg {
  width: 1.25em;
  height: 1.25em;
  display: inline-block;
  vertical-align: middle;
  fill: currentColor;
}

.btn .icon-svg {
  width: 1.25rem;
  height: 1.25rem;
}

.logo-icon-svg {
  width: 2.5rem;
  height: 2.5rem;
}

.logo-small .icon-svg {
  width: 1.125rem;
  height: 1.125rem;
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4 {
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1rem; }

/* Pages */
.page {
  display: none;
  min-height: 100vh;
}

.page.active {
  display: flex;
  flex-direction: column;
}

/* Landing Page */
.landing-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  position: relative;
  background: var(--bg-primary);
}

.logo-section {
  text-align: center;
  margin-bottom: 2.5rem;
}

.logo-icon {
  font-size: 3rem;
  margin-bottom: 0.75rem;
}

.logo-icon-svg {
  color: var(--accent-primary);
}

.logo-text {
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.tagline {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-top: 0.25rem;
  font-weight: 400;
}

.form-section {
  width: 100%;
  max-width: 320px;
}

.input-group {
  margin-bottom: 1rem;
}

.input-group label {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 0.375rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.input-group input,
.input-group select {
  width: 100%;
  padding: 0.75rem 0.875rem;
  font-size: 0.9375rem;
  font-family: inherit;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  transition: all 0.15s ease;
}

.input-group input:focus,
.input-group select:focus {
  outline: none;
  border-color: var(--accent-primary);
  background: var(--bg-tertiary);
}

.input-group input::placeholder {
  color: var(--text-muted);
}

.button-group {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  font-family: inherit;
  font-weight: 500;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--accent-primary);
  color: white;
  flex: 1;
}

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

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  flex: 1;
}

.btn-secondary:hover {
  background: var(--bg-hover);
  border-color: var(--border-light);
}

.btn-danger {
  background: var(--danger-muted);
  color: white;
}

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

.btn-small {
  padding: 0.375rem 0.625rem;
  font-size: 0.75rem;
  border-radius: var(--radius-sm);
}

.btn-large {
  padding: 0.875rem 1.5rem;
  font-size: 1rem;
  width: 100%;
}

.btn-icon {
  padding: 0.625rem 0.875rem;
  flex-direction: column;
  gap: 0.25rem;
}

.btn-icon .icon {
  font-size: 1.125rem;
}

.btn-icon .label {
  font-size: 0.6875rem;
}

.btn-control {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  padding: 0.5rem 0.625rem;
  min-width: 60px;
  flex-direction: column;
  gap: 0.25rem;
}

.btn-control:hover {
  background: var(--bg-tertiary);
  border-color: var(--border-light);
  color: var(--text-primary);
}

.btn-control.active {
  background: var(--accent-muted);
  border-color: var(--accent-primary);
  color: white;
}

.btn-control.muted {
  background: var(--danger-muted);
  border-color: var(--danger-muted);
  color: white;
}

.btn-record {
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger-muted);
}

.btn-record:hover {
  background: var(--danger-muted);
  color: white;
}

.btn-stop {
  background: var(--danger);
  color: white;
  border: 1px solid var(--danger);
  animation: pulse-recording 2s ease-in-out infinite;
}

@keyframes pulse-recording {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.btn-cough {
  background: var(--warning-muted);
  color: white;
  border-color: var(--warning-muted);
}

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

.btn-cough:active,
.btn-cough.active {
  background: var(--danger);
  border-color: var(--danger);
  color: white;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Hidden theme toggle (dark only) */
.theme-toggle {
  display: none;
}

.landing-footer {
  position: absolute;
  bottom: 1.5rem;
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: var(--bg-secondary);
  border-radius: 16px;
  padding: 2rem;
  width: 100%;
  max-width: 400px;
  border: 1px solid var(--border-color);
}

.modal-content h2 {
  margin-bottom: 1.5rem;
  text-align: center;
}

.modal-buttons {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

/* Device Check Page */
.device-check-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem;
  max-width: 500px;
  margin: 0 auto;
}

.back-btn {
  align-self: flex-start;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1rem;
  cursor: pointer;
  margin-bottom: 1.5rem;
  padding: 0.5rem;
}

.back-btn:hover {
  color: var(--text-primary);
}

.device-check-container h2 {
  margin-bottom: 2rem;
}

.preview-section {
  width: 100%;
  margin-bottom: 2rem;
}

.video-preview-container {
  position: relative;
  width: 100%;
  aspect-ratio: 4/3;
  background: var(--bg-tertiary);
  border-radius: 16px;
  overflow: hidden;
  border: 2px solid var(--border-color);
}

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

.video-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.video-placeholder span {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.video-placeholder.hidden {
  display: none;
}

.device-selectors {
  width: 100%;
  margin-bottom: 1.5rem;
}

.device-group {
  margin-bottom: 1rem;
}

.device-group label {
  display: block;
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.device-group select {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  font-family: inherit;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  color: var(--text-primary);
}

.audio-level-container {
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: 4px;
  margin-top: 0.5rem;
  overflow: hidden;
}

.audio-level-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--success), var(--warning));
  border-radius: 4px;
  transition: width 0.05s ease;
}

.device-test-buttons {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
}

.device-test-buttons .btn {
  flex: 1;
}

/* Room Page */
#room-page {
  display: none;
  height: 100vh;
  overflow: hidden;
}

#room-page.active {
  display: flex;
}

.room-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.75rem;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-small {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-primary);
}

.recording-indicator {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.5rem;
  background: rgba(255, 69, 58, 0.1);
  border: 1px solid var(--danger-muted);
  border-radius: var(--radius-sm);
  color: var(--danger);
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.recording-indicator.hidden {
  display: none;
}

.recording-dot {
  width: 6px;
  height: 6px;
  background: var(--danger);
  border-radius: 50%;
  animation: blink 1s ease-in-out infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.recording-timer {
  font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
  font-size: 0.6875rem;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.room-info {
  padding: 0.5rem 0.75rem;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.room-info h2 {
  font-size: 0.9375rem;
  font-weight: 500;
}

.room-code-display {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
  font-size: 0.6875rem;
  color: var(--text-muted);
}

.room-code-display span {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Room Main Layout */
.room-main {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 280px;
  grid-template-rows: 1fr auto auto;
  gap: 0.75rem;
  padding: 0.75rem;
  overflow: hidden;
  background: var(--bg-primary);
}

/* Video Grid */
.video-grid {
  grid-column: 1;
  grid-row: 1 / 3;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.5rem;
  align-content: start;
  overflow-y: auto;
  padding-right: 0.25rem;
}

/* Single participant - limit size */
.video-grid:has(.video-tile:only-child) {
  justify-content: center;
  align-content: center;
}

.video-grid .video-tile:only-child {
  max-width: 480px;
  max-height: 360px;
}

.video-tile {
  position: relative;
  aspect-ratio: 16/9;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-color);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.video-tile.speaking {
  border-color: var(--success);
}

/* Hand raised - yellow border */
.video-tile.hand-up {
  border-color: var(--warning) !important;
  box-shadow: 0 0 0 1px var(--warning);
}

.video-tile.you {
  order: 999;
}

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

.video-tile .video-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  color: var(--text-muted);
}

.video-tile .video-placeholder.hidden {
  display: none;
}

.video-tile-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.375rem 0.5rem;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.video-tile-name {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
}

.video-tile-name .admin-badge {
  color: var(--warning);
}

.video-tile-name .you-badge {
  font-size: 0.625rem;
  color: rgba(255, 255, 255, 0.5);
}

.video-tile-name .hand-raised {
  font-size: 1rem;
  animation: wave 0.5s ease-in-out infinite alternate;
  color: var(--warning);
}

.video-tile-name .hand-raised.hidden {
  display: none;
}

@keyframes wave {
  from { transform: rotate(-10deg); }
  to { transform: rotate(10deg); }
}

.video-tile-status {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.status-icon {
  font-size: 0.75rem;
  opacity: 0.8;
}

.status-icon.muted {
  color: var(--danger);
}

.connection-indicator {
  font-size: 0.625rem;
  opacity: 0.5;
}

.admin-mute-btn {
  position: absolute;
  top: 0.375rem;
  right: 0.375rem;
  padding: 0.25rem;
  font-size: 0.75rem;
  background: rgba(0, 0, 0, 0.6);
  border: none;
  border-radius: var(--radius-sm);
  opacity: 0;
  transition: opacity 0.15s ease;
  color: white;
}

.video-tile:hover .admin-mute-btn {
  opacity: 1;
}

/* Controls Panel */
.controls-panel {
  grid-column: 1;
  grid-row: 3;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.625rem;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.control-section {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.control-section h3 {
  font-size: 0.625rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
}

.control-buttons {
  display: flex;
  gap: 0.375rem;
  flex-wrap: wrap;
}

.mobile-controls {
  display: none;
}

/* Recording Log Panel */
.recording-log-panel {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.recording-log-panel.hidden {
  display: none;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.625rem;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-color);
}

.panel-header h3 {
  font-size: 0.75rem;
  font-weight: 500;
}

.recording-log {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem;
  font-family: 'Space Mono', monospace;
  font-size: 0.75rem;
  max-height: 200px;
}

.log-entry {
  padding: 0.25rem 0;
  color: var(--text-secondary);
}

.log-entry .timestamp {
  color: var(--accent-primary);
}

.log-entry.marker {
  color: var(--warning);
}

.log-empty {
  color: var(--text-muted);
  font-style: italic;
}

.marker-input {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem;
  border-top: 1px solid var(--border-color);
}

.marker-input input {
  flex: 1;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
}

/* Chat Panel */
.chat-panel {
  grid-column: 2;
  grid-row: 2 / 4;
  display: flex;
  flex-direction: column;
  background: var(--bg-secondary);
  border-radius: 12px;
  border: 1px solid var(--border-color);
  overflow: hidden;
  min-height: 250px;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.chat-message {
  font-size: 0.875rem;
}

.chat-message .sender {
  font-weight: 600;
  color: var(--accent-primary);
}

.chat-message .text {
  color: var(--text-primary);
}

.chat-input-container {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem;
  border-top: 1px solid var(--border-color);
}

.chat-input-container input {
  flex: 1;
  padding: 0.625rem 0.875rem;
  font-size: 0.875rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
}

.chat-input-container .btn {
  padding: 0.625rem 1rem;
}

/* Downloads Panel */
.downloads-panel {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 2rem);
  max-width: 500px;
  background: var(--bg-secondary);
  border-radius: 12px;
  border: 1px solid var(--border-color);
  box-shadow: 0 10px 40px var(--shadow-color);
  z-index: 100;
}

.downloads-panel.hidden {
  display: none;
}

.downloads-content {
  padding: 1rem;
  max-height: 200px;
  overflow-y: auto;
}

.download-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
}

.download-item .name {
  flex: 1;
  font-size: 0.875rem;
}

.download-item .progress-bar {
  flex: 2;
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: 4px;
  overflow: hidden;
}

.download-item .progress-fill {
  height: 100%;
  background: var(--accent-primary);
  transition: width 0.2s ease;
}

.download-item .status {
  font-size: 0.875rem;
  min-width: 50px;
  text-align: right;
}

.download-item .status.complete {
  color: var(--success);
}

.download-buttons {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border-color);
}

.download-buttons .btn {
  flex: 1;
}

/* Shortcuts Bar */
.shortcuts-bar {
  display: flex;
  gap: 1.5rem;
  padding: 0.5rem 1rem;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.shortcuts-bar kbd {
  display: inline-block;
  padding: 0.125rem 0.375rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-family: 'Space Mono', monospace;
  font-size: 0.6875rem;
}

/* Drawers (Mobile) */
.drawer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-height: 70vh;
  background: var(--bg-secondary);
  border-radius: 16px 16px 0 0;
  border: 1px solid var(--border-color);
  border-bottom: none;
  z-index: 200;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.drawer.active {
  transform: translateY(0);
}

.drawer.hidden {
  display: none;
}

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

.drawer-header h3 {
  font-size: 1rem;
}

.drawer-header-buttons {
  display: flex;
  gap: 0.5rem;
}

.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 150;
}

.drawer-overlay.hidden {
  display: none;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  padding: 0.75rem 1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 0.875rem;
  animation: slideIn 0.3s ease;
  max-width: 300px;
}

.toast.success {
  border-color: var(--success);
  background: rgba(34, 197, 94, 0.1);
}

.toast.error {
  border-color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
}

.toast.warning {
  border-color: var(--warning);
  background: rgba(245, 158, 11, 0.1);
}

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

/* Hidden & Admin-only */
.hidden {
  display: none !important;
}

.admin-only {
  display: none;
}

body.is-admin .admin-only {
  display: flex;
}

body.is-admin .admin-only.hidden {
  display: none !important;
}

/* Responsive - Tablet */
@media (max-width: 1024px) {
  .room-main {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto;
  }
  
  .video-grid {
    grid-column: 1;
    grid-row: 1;
  }
  
  .controls-panel {
    grid-column: 1;
    grid-row: 2;
  }
  
  .recording-log-panel,
  .chat-panel {
    display: none !important;
  }
  
  .mobile-controls {
    display: flex;
  }
  
  .shortcuts-bar {
    display: none;
  }
}

/* Responsive - Mobile */
@media (max-width: 640px) {
  html {
    font-size: 14px;
  }
  
  .landing-container {
    padding: 1.5rem;
  }
  
  .logo-text {
    font-size: 2rem;
  }
  
  .logo-icon {
    font-size: 3rem;
  }
  
  .button-group {
    flex-direction: column;
  }
  
  .device-check-container {
    padding: 1rem;
  }
  
  .room-header {
    padding: 0.5rem 0.75rem;
  }
  
  .room-info {
    padding: 0.5rem 0.75rem;
  }
  
  .room-main {
    padding: 0.5rem;
    gap: 0.5rem;
  }
  
  .video-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    max-height: calc(100vh - 280px);
    overflow-y: auto;
  }
  
  .video-tile {
    aspect-ratio: 1;
  }
  
  .controls-panel {
    padding: 0.75rem;
    gap: 0.75rem;
  }
  
  .control-section h3 {
    display: none;
  }
  
  .btn-control {
    min-width: 56px;
    padding: 0.5rem;
  }
  
  .btn-control .icon {
    font-size: 1.25rem;
  }
  
  .btn-control .label {
    font-size: 0.625rem;
  }
  
  .admin-controls .control-buttons {
    width: 100%;
  }
  
  .admin-controls .btn {
    flex: 1;
  }
  
  .toast-container {
    left: 1rem;
    right: 1rem;
  }
  
  .toast {
    max-width: none;
  }
  
  .downloads-panel {
    bottom: 0;
    border-radius: 12px 12px 0 0;
    max-width: none;
    width: 100%;
  }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-tertiary);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb {
  background: var(--text-muted);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

/* Focus Styles */
:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

/* Selection */
::selection {
  background: var(--accent-primary);
  color: white;
}
icon.hidden {
  display: none;
}

/* Media Tile */
.media-tile {
  background: #000;
  aspect-ratio: 16/9;
}

.media-tile #youtube-player {
  width: 100%;
  height: 100%;
}

.media-tile iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.media-remove-btn {
  padding: 0.25rem 0.5rem !important;
  font-size: 0.75rem;
}

/* Producer Mode Adjustments */
body.is-producer .video-grid {
  /* Ensure producer sees all videos */
}

body.is-producer #producer-panel {
  display: block;
}

/* Admin mute button on tiles */
.admin-mute-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.video-tile:hover .admin-mute-btn {
  opacity: 1;
}

/* Log entry marker highlight */
.log-entry.marker {
  background: rgba(124, 58, 237, 0.1);
  border-left: 3px solid var(--accent-primary);
  padding-left: 0.5rem;
  margin-left: -0.5rem;
}

/* Responsive adjustments for producer tools */
@media (max-width: 1024px) {
  .producer-tools-panel {
    display: none !important;
  }
  
  .notes-panel {
    right: 0.5rem;
    left: 0.5rem;
    width: auto;
    top: auto;
    bottom: 80px;
    transform: none;
    max-height: 200px;
  }
  
  .cue-container {
    bottom: 150px;
    left: 1rem;
    right: 1rem;
    transform: none;
  }
  
  .cue-toast {
    width: 100%;
    justify-content: center;
  }
}

/* Notes drawer for mobile */
#notes-drawer {
  z-index: 600;
}

/* Room main grid adjustments for producer */
body.is-producer .room-main {
  grid-template-columns: 1fr 300px 300px;
}

body.is-producer .recording-log-panel {
  grid-column: 3;
  grid-row: 1 / 3;
}

body.is-producer .chat-panel {
  grid-column: 3;
  grid-row: 3;
}

@media (max-width: 1400px) {
  body.is-producer .room-main {
    grid-template-columns: 1fr 280px;
  }
  
  body.is-producer .producer-tools-panel {
    grid-column: 2;
    grid-row: 1;
  }
  
  body.is-producer .recording-log-panel {
    grid-column: 2;
    grid-row: 2;
  }
}

/* Participants Panel */
.participants-panel {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-color);
}

.participants-panel h4 {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.participants-list {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.participant-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.5rem;
  background: var(--bg-tertiary);
  border-radius: 6px;
  font-size: 0.8rem;
}

.participant-item .participant-name {
  flex: 1;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.participant-item .participant-name .admin-star {
  color: #fbbf24;
  font-size: 0.7rem;
}

.participant-item .participant-name .you-tag {
  font-size: 0.65rem;
  color: var(--text-muted);
}

.participant-item .audio-status {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.participant-item .audio-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
}

.participant-item .audio-indicator.receiving {
  background: var(--success);
  animation: pulse-dot 1s ease-in-out infinite;
}

.participant-item .audio-indicator.sending {
  background: #3b82f6;
  animation: pulse-dot 1s ease-in-out infinite;
}

.participant-item .audio-indicator.local {
  background: var(--accent-primary);
}

.participant-item .speed {
  font-size: 0.625rem;
  color: var(--success);
  font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
  white-space: nowrap;
}

.participant-item .total-bytes {
  font-size: 0.5625rem;
  color: var(--text-muted);
  font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.85); }
}

.participant-item .chunk-count {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-family: 'Space Mono', monospace;
}

.participant-item .status-icons {
  display: flex;
  gap: 0.25rem;
}

.participant-item .status-icons svg {
  width: 0.875rem;
  height: 0.875rem;
  opacity: 0.5;
}

.participant-item .status-icons svg.active {
  opacity: 1;
}

.participant-item .status-icons .muted-icon {
  color: var(--danger);
}

.participant-item .status-icons .hand-icon {
  color: #fbbf24;
}

/* Modal hint */
.modal-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

/* Direct video player */
.media-tile #media-player {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.media-tile .media-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  color: var(--text-muted);
  font-size: 0.875rem;
}

.media-tile .media-loading.hidden {
  display: none;
}
