/* Startup Fullscreen Overlay */
.startup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #050505;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease, visibility 0.5s ease;
  font-family: 'Consolas','Monaco',monospace;
}

.startup-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.startup-box {
  text-align: center;
  max-width: 400px;
  width: 90%;
  padding: 30px;
  background: #0a0a0a;
  border: 1px solid #1a1a1a;
  border-radius: 4px;
}

.live-dot.big {
  width: 12px;
  height: 12px;
  margin: 0 auto 15px auto;
  display: block;
}

.startup-title {
  font-size: 16px;
  color: #fff;
  letter-spacing: 2px;
  margin-bottom: 8px;
}

.startup-subtitle {
  font-size: 11px;
  color: #666;
  margin-bottom: 24px;
}

.startup-progress-bg {
  width: 100%;
  height: 6px;
  background: #111;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 12px;
}

.startup-progress-bar {
  width: 0%;
  height: 100%;
  background: #e63946;
  transition: width 0.2s ease;
}

.startup-stats {
  font-size: 10px;
  color: #4ade80;
  margin-bottom: 24px;
}

.startup-skip-btn {
  background: transparent;
  border: 1px solid #333;
  color: #777;
  padding: 6px 16px;
  font-size: 10px;
  font-family: inherit;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.2s;
}

.startup-skip-btn:hover {
  border-color: #555;
  color: #aaa;
}

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

body { 
  background: #0a0a0a; 
  color: #ccc; 
  font-family: 'Consolas','Monaco',monospace; 
  font-size: 12px; 
  overflow: hidden; 
}

/* Header */
.header { 
  padding: 8px 12px; 
  display: flex; 
  align-items: center; 
  gap: 10px; 
  border-bottom: 1px solid #1a1a1a; 
}

.header h1 { 
  font-size: 13px; 
  font-weight: 500; 
  color: #aaa; 
  letter-spacing: 1px; 
}

.live-dot { 
  width: 7px; 
  height: 7px; 
  background: #e63946; 
  border-radius: 50%; 
  animation: pulse 1.5s infinite; 
  display: inline-block; 
}

@keyframes pulse { 
  0%,100%{opacity:1} 
  50%{opacity:.3} 
}

.header .status { 
  margin-left: auto; 
  color: #555; 
  font-size: 11px; 
}

.header .status.ok { color: #4ade80; }
.header .status.err { color: #e63946; }
.header .status.warn { color: #facc15; }
.header .status.loading { color: #3b82f6; }

.bandwidth-meter {
  font-size: 10px;
  color: #666;
  padding: 0 8px;
  border-left: 1px solid #1a1a1a;
}

.bandwidth-meter.good { color: #4ade80; }
.bandwidth-meter.slow { color: #facc15; }
.bandwidth-meter.bad { color: #e63946; }

/* Main Layout */
.main { 
  display: flex; 
  gap: 0; 
  height: calc(100vh - 40px); 
}

/* Video Side */
.video-side { 
  flex: 0 0 55%; 
  display: flex; 
  flex-direction: column; 
  border-right: 1px solid #1a1a1a; 
}

.video-box { 
  position: relative; 
  background: #000; 
  flex: 1; 
  max-height: 55vh; 
}

video { 
  width: 100%; 
  height: 100%; 
  display: block; 
}

.loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.85);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.loading-overlay.active {
  display: flex;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #222;
  border-top-color: #e63946;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 12px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  color: #888;
  font-size: 11px;
  margin-bottom: 16px;
}

.loading-bar-container {
  width: 240px;
  height: 4px;
  background: #1a1a1a;
  border-radius: 2px;
  overflow: hidden;
}

.loading-bar {
  height: 100%;
  background: linear-gradient(90deg, #e63946, #d62839);
  width: 0%;
  transition: width 0.3s ease;
}

/* Input Row */
.input-row { 
  display: flex; 
  gap: 4px; 
  padding: 6px 8px; 
  border-bottom: 1px solid #1a1a1a; 
  align-items: center; 
}

.input-row input { 
  flex: 1; 
  background: #141414; 
  border: 1px solid #222; 
  color: #ddd; 
  padding: 5px 8px; 
  font-size: 11px; 
  font-family: inherit; 
  border-radius: 2px; 
  outline: none; 
}

.input-row input:focus { 
  border-color: #444; 
}

.input-row button { 
  background: #141414; 
  border: 1px solid #222; 
  color: #aaa; 
  padding: 5px 12px; 
  font-size: 11px; 
  font-family: inherit; 
  border-radius: 2px; 
  cursor: pointer; 
  transition: all .12s; 
}

.input-row button:hover { 
  background: #222; 
  color: #ddd; 
}

.input-row button.go { 
  background: #e63946; 
  border-color: #e63946; 
  color: #fff; 
}

.input-row button.go:hover { 
  background: #d62839; 
}

.input-row button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Controls */
.controls { 
  display: flex; 
  gap: 4px; 
  padding: 6px 8px; 
  flex-wrap: wrap; 
  align-items: center; 
  border-bottom: 1px solid #1a1a1a; 
}

.ctrl { 
  background: #141414; 
  border: 1px solid #222; 
  color: #aaa; 
  padding: 4px 10px; 
  font-size: 11px; 
  font-family: inherit; 
  border-radius: 2px; 
  cursor: pointer; 
  transition: all .12s; 
}

.ctrl:hover { 
  background: #222; 
  color: #ddd; 
}

.ctrl.active { 
  background: #e63946; 
  border-color: #e63946; 
  color: #fff; 
}

.sep { 
  flex: 1; 
}

/* Presets */
.presets { 
  padding: 6px 8px; 
  border-bottom: 1px solid #1a1a1a; 
}

.presets-label { 
  font-size: 10px; 
  color: #555; 
  margin-bottom: 4px; 
}

.preset-btn { 
  background: #0d0d0d; 
  border: 1px solid #1a1a1a; 
  color: #777; 
  padding: 3px 8px; 
  font-size: 10px; 
  font-family: inherit; 
  border-radius: 2px; 
  cursor: pointer; 
  margin-right: 4px; 
  margin-bottom: 4px; 
  transition: all .1s; 
}

.preset-btn:hover { 
  background: #1a1a1a; 
  color: #aaa; 
}

.url-label { 
  font-size: 9px; 
  color: #333; 
  padding: 4px 8px; 
  word-break: break-all; 
  line-height: 1.3; 
  border-bottom: 1px solid #0d0d0d; 
}

/* Log Side */
.log-side { 
  flex: 0 0 45%; 
  display: flex; 
  flex-direction: column; 
  background: #080808; 
}

.log-header { 
  padding: 6px 10px; 
  font-size: 11px; 
  color: #555; 
  border-bottom: 1px solid #151515; 
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
}

.log-header span { 
  cursor: pointer; 
  color: #444; 
}

.log-header span:hover { 
  color: #888; 
}

.log-filter {
  display: flex;
  gap: 6px;
  font-size: 10px;
}

.log-filter label {
  display: flex;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  color: #555;
}

.log-filter input[type="checkbox"] {
  cursor: pointer;
}

.log-filter label:hover {
  color: #888;
}

.log-entries { 
  flex: 1; 
  overflow-y: auto; 
  padding: 4px 10px; 
}

.log-entries::-webkit-scrollbar { 
  width: 4px; 
}

.log-entries::-webkit-scrollbar-thumb { 
  background: #222; 
  border-radius: 2px; 
}

.log-line { 
  padding: 2px 0; 
  line-height: 1.4; 
  white-space: pre-wrap; 
  word-break: break-all; 
  border-bottom: 1px solid #0d0d0d; 
  font-size: 11px; 
}

.log-line .time { 
  color: #333; 
  margin-right: 6px; 
  font-size: 10px; 
}

.log-line.info { color: #888; }
.log-line.ok { color: #4ade80; }
.log-line.err { color: #e63946; }
.log-line.warn { color: #facc15; }
.log-line.debug { color: #666; }
.log-line.hidden { display: none; }

/* Responsive */
@media (max-width: 900px) {
  .main { 
    flex-direction: column; 
    height: auto; 
  }
  .video-side, .log-side { 
    flex: none; 
  }
  .video-box { 
    max-height: 40vh; 
  }
  .log-side { 
    height: 250px; 
  }
}
