/* Live Stream & Broadcast Styles - Evolv-To */

/* --- Live Player --- */
.live-player-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #0a0a12;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 4px 32px rgba(0,0,0,0.6);
}

.live-player-wrap video,
.live-player-wrap canvas {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.live-player-wrap canvas { pointer-events: none; z-index: 2; }

/* --- Live Badge --- */
.live-badge {
  display: inline-flex; align-items: center; gap: 0.45rem;
  font-family: var(--mono); font-size: 0.65rem; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: #fff; background: #c0392b; padding: 0.3rem 0.75rem; border-radius: 3px;
}
.live-badge::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%;
  background: #fff; animation: livePulse 1.5s ease-in-out infinite;
}
@keyframes livePulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
.live-badge.offline { background: var(--elevated); color: var(--text-3); }
.live-badge.offline::before { animation: none; opacity: 0.5; background: var(--text-3); }

/* --- Fullscreen Button --- */
.live-fullscreen-btn {
  position: absolute; bottom: 1rem; left: 1rem; z-index: 10;
  display: none; align-items: center; justify-content: center;
  width: 40px; height: 40px;
  background: rgba(0,0,0,0.55); color: #fff; border: none;
  border-radius: 6px; cursor: pointer;
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  transition: background 0.2s, transform 0.2s;
}
.live-fullscreen-btn:hover { background: rgba(0,0,0,0.82); transform: scale(1.08); }
.live-fullscreen-btn svg { width: 20px; height: 20px; }

/* --- Unmute Button --- */
.live-unmute-btn {
  position: absolute; bottom: 1.5rem; right: 1.5rem; z-index: 10;
  display: flex; align-items: center; gap: 0.5rem;
  background: rgba(0,0,0,0.7); color: #fff; border: 1px solid rgba(255,255,255,0.25);
  padding: 0.5rem 1rem; border-radius: var(--radius); cursor: pointer;
  font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.04em; text-transform: uppercase;
  transition: background 0.2s;
}
.live-unmute-btn:hover { background: rgba(0,0,0,0.9); }
.live-unmute-btn svg { width: 18px; height: 18px; }

/* --- Offline Overlay --- */
.live-offline-msg {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, #0d0d1a 0%, #121230 50%, #0d0d1a 100%);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; z-index: 2; padding: 2rem;
}
.live-offline-logo { margin-bottom: 2rem; }
.live-offline-logo img { height: 48px; width: auto; }
.live-offline-icon { margin-bottom: 1.5rem; }
.live-offline-icon svg { width: 48px; height: 48px; stroke: var(--border); stroke-width: 1.5; fill: none; }
.live-offline-label {
  font-family: var(--mono); font-size: 0.65rem; font-weight: 600;
  letter-spacing: 0.15em; text-transform: uppercase; color: var(--accent);
  margin-bottom: 0.75rem;
}
.live-offline-title {
  font-family: var(--serif); font-size: 1.35rem; color: var(--text-2);
  margin-bottom: 0.5rem;
}
.live-offline-sub {
  font-family: var(--sans); font-size: 0.85rem; color: var(--text-3);
  letter-spacing: 0.02em;
}
.live-checking {
  margin-top: 1.5rem; display: flex; align-items: center; gap: 0.5rem;
  font-family: var(--mono); font-size: 0.65rem; color: var(--text-3);
  letter-spacing: 0.06em; text-transform: uppercase;
}
.live-checking-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  animation: liveCheckPulse 2s ease-in-out infinite;
}
@keyframes liveCheckPulse { 0%, 100% { opacity: 0.3; } 50% { opacity: 1; } }

/* --- Broadcast Page --- */
.broadcast-wrap { max-width: 900px; margin: 0 auto; }

.broadcast-field { margin-bottom: 1rem; }

.broadcast-field label {
  display: block; font-family: var(--mono); font-size: 0.65rem; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-3); margin-bottom: 0.4rem;
}
.broadcast-field select {
  -webkit-appearance: none; -moz-appearance: none; appearance: none;
  width: 100%; padding: 0.65rem 2.25rem 0.65rem 0.85rem;
  font-family: var(--sans); font-size: 0.9rem;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg); color: var(--text);
  cursor: pointer; transition: border-color 0.2s, box-shadow 0.2s; outline: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23aaa7a0' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
}
.broadcast-field select:hover { border-color: var(--border-h); }
.broadcast-field select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
.broadcast-field select option { background: var(--bg); color: var(--text); }

.broadcast-preview-wrap {
  position: relative; width: 100%; aspect-ratio: 16 / 9;
  background: #0a0a12; border-radius: var(--radius); overflow: hidden;
  margin: 1.5rem 0; border: 1px solid var(--border);
  box-shadow: 0 4px 32px rgba(0,0,0,0.6);
}
.broadcast-preview-wrap canvas {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
}

.broadcast-controls {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-top: 1rem;
}

.broadcast-btn {
  font-family: var(--mono); font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: 0.75rem 1.75rem; border: none; border-radius: var(--radius);
  cursor: pointer; transition: background 0.2s, box-shadow 0.2s, opacity 0.2s;
}
.broadcast-btn-start { background: var(--accent); color: var(--text); }
.broadcast-btn-start:hover:not(:disabled) { background: var(--accent-h); box-shadow: 0 0 20px var(--glow-strong); }
.broadcast-btn-start:disabled { background: var(--elevated); color: var(--text-3); cursor: not-allowed; opacity: 0.7; }
.broadcast-btn-stop { background: #c0392b; color: #fff; }
.broadcast-btn-stop:hover { background: #e74c3c; box-shadow: 0 0 16px rgba(192,57,43,0.4); }

.broadcast-status-text {
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--text-3);
}
.broadcast-status-text.live { color: #e53e3e; }

/* Overlay panel */
.overlay-panel {
  margin-top: 2rem;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 2px 16px rgba(0,0,0,0.3);
}
.overlay-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.25rem; gap: 1rem;
}
.overlay-panel-title { font-family: var(--serif); font-size: 1.05rem; color: var(--text); }
.overlay-panel-hint { font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); }

.overlay-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
}
.overlay-btn {
  display: flex; flex-direction: column; align-items: center; gap: 0.45rem;
  padding: 0.85rem 0.5rem;
  background: var(--elevated); border: 1px solid var(--border);
  border-radius: var(--radius); cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.overlay-btn:hover { border-color: var(--border-h); }
.overlay-btn.active { border-color: var(--accent); background: var(--accent-dim); }
.overlay-btn-icon { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; color: var(--text-3); }
.overlay-btn-icon svg { width: 20px; height: 20px; }
.overlay-btn.active .overlay-btn-icon { color: var(--accent-h); }
.overlay-btn-label { font-family: var(--mono); font-size: 0.62rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); }
.overlay-btn.active .overlay-btn-label { color: var(--text); }
.overlay-btn-status { font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.06em; color: var(--text-3); }
.overlay-btn.active .overlay-btn-status { color: var(--accent-h); }

.overlay-fields {
  margin-top: 1.25rem; padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}
.overlay-field { margin-bottom: 0.85rem; }
.overlay-field:last-child { margin-bottom: 0; }
.overlay-field label {
  display: block; font-family: var(--mono); font-size: 0.65rem; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-3); margin-bottom: 0.35rem;
}
.overlay-field input {
  width: 100%; padding: 0.6rem 0.85rem;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text); font-family: var(--sans); font-size: 0.88rem;
  transition: border-color 0.2s, box-shadow 0.2s; outline: none;
}
.overlay-field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }

.overlay-timer-controls {
  display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.5rem;
}
.overlay-timer-btn {
  font-family: var(--mono); font-size: 0.65rem; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: 0.4rem 0.75rem; background: var(--elevated);
  border: 1px solid var(--border); border-radius: var(--radius); color: var(--text-3);
  cursor: pointer; transition: border-color 0.2s, color 0.2s;
}
.overlay-timer-btn:hover { border-color: var(--accent); color: var(--accent-h); }

@media (max-width: 600px) {
  .overlay-grid { grid-template-columns: repeat(2, 1fr); }
  .broadcast-controls { flex-direction: column; align-items: flex-start; }
  .broadcast-btn { width: 100%; text-align: center; }
}
