/*.styled-background {
  background-color: #f00;
}*/

html,
body {
  background: #000;
  margin: 0px;
  padding: 0px;
  width: 100%;
  height: 100%;
  color: #fff;
  line-height: 1.4;
}

.camera-inputs {
  color: black;
  background: white;
}

textarea {
  background: #000;
}

canvas {
  /* background-color: #000; */
  image-rendering: -moz-crisp-edges;
  image-rendering: -webkit-crisp-edges;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

a:hover {
  /* opacity: 0.5; */
  background-color: white;
  color: black;
}

#hydra-ui {
  position: fixed;
  top: 0px;
  left: 0px;
  width: 100%;
  height: 100%;
}

#code {
  z-index: 5;
}

#hydra-canvas {
  position: absolute;
  top: 0px;
  left: 0px;
  z-index: -2;
}

#audio-canvas {
  position: absolute;
  bottom: 0px;
  right: 0px;
  background-color: transparent;
}

.CodeMirror {
  position: absolute;
  /* top: 20px;
  left: 20px; */
  z-index: 5;
  /* width: calc(100% - 20px);
  height: calc(100% - 20px); */
  background: transparent;
  width: calc(100% - 60px);
  height: calc(100% - 60px);
}

.console {
  /* bottom: 0px;
  position: absolute;
  padding: 20px;
  padding-bottom: 5px;
  width: calc(100% - 40px); */
  z-index: 6;
  left: 0px;
  font-family: monospace;
  font-size: 14px;
  color: #aaa;
  pointer-events: none;
  padding: 15px;
  padding-bottom: 5px;
}

.log-error {
  color: #f00;
}

.styled-background {
  /* background-color: #f00 !important; */
  background: rgba(0, 255, 255, 0.5) !important;
  mix-blend-mode: difference;
}

#editor-container {
  width: 100%;
  height: 100%;
  /* position: fixed; */

  position: absolute;
  /* padding: 20px;  */
}

#bpm-display {
  position: fixed;
  bottom: 14px;
  left: 10px;
  z-index: 10;
  color: rgba(255, 255, 255, .7);
  padding: 3px 6px;
  font-family: monospace;
  font-size: 10px;
  pointer-events: none;
  transition: opacity 0.2s ease;
  opacity: .8;
}

#bpm-display.fade-out {
  opacity: 0;
}

/* Recording Indicator */
#recording-indicator {
  position: fixed;
  bottom: 10px;
  right: 10px;
  z-index: 100;
  pointer-events: none;
  opacity: 0.6;
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: monospace;
  font-size: 10px;
  color: #fff;
  max-width: calc(100vw - 20px);
}

#recording-indicator .rec-dot {
  width: 6px;
  height: 6px;
  background: #fff;
  border-radius: 50%;
  animation: rec-blink 1s ease-in-out infinite;
}

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

#recording-indicator.saved {
  opacity: 0.8;
  animation: saved-fade 3s ease-out forwards;
}

#recording-indicator .saved-message {
  color: #fff;
  font-size: 11px;
}

@keyframes saved-fade {
  0%, 70% { opacity: 0.8; }
  100% { opacity: 0; }
}

#recording-indicator .play-icon {
  width: 0;
  height: 0;
  border-left: 6px solid #fff;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
}

#recording-indicator .count {
  color: #fff;
}

#recording-indicator .pause-icon {
  display: flex;
  gap: 2px;
}

#recording-indicator .pause-icon::before,
#recording-indicator .pause-icon::after {
  content: '';
  width: 2px;
  height: 8px;
  background: #fff;
}

#recording-indicator.playback {
  gap: 2px;
}

#recording-indicator .ctrl-btn,
#recording-indicator .ctrl-main {
  display: flex;
  align-items: center;
  padding: 4px 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.1);
  pointer-events: auto;
  cursor: pointer;
}

#recording-indicator .ctrl-btn:hover,
#recording-indicator .ctrl-main:hover {
  opacity: 1;
}

#recording-indicator .ctrl-main {
  position: relative;
  gap: 5px;
  overflow: hidden;
}

#recording-indicator .progress-bg {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0;
  background: rgba(255, 255, 255, 0.25);
}

#recording-indicator .prev-icon,
#recording-indicator .next-icon {
  width: 0;
  height: 0;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
}

#recording-indicator .prev-icon {
  border-right: 5px solid #fff;
}

#recording-indicator .next-icon {
  border-left: 5px solid #fff;
}

#recording-indicator .seekbar {
  width: 400px;
  flex-shrink: 1;
  min-width: 60px;
  height: 16px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  cursor: pointer;
  pointer-events: auto;
  position: relative;
  overflow: hidden;
}

#recording-indicator .seekbar:hover {
  background: rgba(255, 255, 255, 0.15);
}

#recording-indicator .seekbar-progress {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: rgba(255, 255, 255, 0.35);
  pointer-events: none;
}

#recording-indicator .seekbar:hover .seekbar-progress {
  background: rgba(255, 255, 255, 0.45);
}

/* Session List */
#session-list-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
}

#session-list-modal {
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 8px;
  width: 90%;
  max-width: 500px;
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  font-family: monospace;
}

.session-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid #333;
}

.session-list-header h3 {
  margin: 0;
  font-size: 14px;
  color: #fff;
}

.session-list-header .close-btn {
  background: none;
  border: none;
  color: #888;
  font-size: 20px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.session-list-header .close-btn:hover {
  color: #fff;
}

.session-list-content {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.no-sessions {
  color: #666;
  text-align: center;
  padding: 24px;
  font-size: 12px;
  line-height: 1.6;
}

.session-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-radius: 4px;
  cursor: pointer;
  margin-bottom: 4px;
}

.session-item:hover {
  background: #2a2a2a;
}

.session-info {
  flex: 1;
  min-width: 0;
}

.session-name {
  color: #fff;
  font-size: 12px;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.session-meta {
  color: #666;
  font-size: 10px;
}

.session-id {
  color: #555;
  font-size: 9px;
  font-family: monospace;
  opacity: 0.7;
  user-select: all;
  cursor: text;
}

.session-actions {
  display: flex;
  gap: 4px;
  margin-left: 8px;
}

.session-actions button {
  background: #333;
  border: none;
  color: #888;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.session-actions button:hover {
  background: #444;
  color: #fff;
}

.session-actions .delete-btn:hover {
  background: #633;
  color: #f88;
}

.session-actions .play-btn:hover {
  background: #336;
  color: #88f;
}

.session-actions .resume-btn:hover {
  background: #633;
  color: #f88;
}

.session-name-input {
  background: #222;
  border: 1px solid #555;
  color: #fff;
  font-size: 14px;
  padding: 2px 6px;
  border-radius: 3px;
  width: 100%;
  max-width: 300px;
  outline: none;
}

.session-name-input:focus {
  border-color: #88f;
}

.session-list-footer {
  padding: 12px 16px;
  border-top: 1px solid #333;
}

.import-label {
  display: inline-block;
  padding: 6px 12px;
  background: #333;
  border-radius: 4px;
  color: #aaa;
  font-size: 11px;
  cursor: pointer;
}

.import-label:hover {
  background: #444;
  color: #fff;
}

.import-label input[type="file"] {
  display: none;
}

/* YouTube Overlay */
#youtube-overlay {
  position: fixed;
  top: 10px;
  right: 10px;
  z-index: 110;
  background: rgba(0, 0, 0, 0.85);
  border: 1px solid #333;
  border-radius: 4px;
  font-family: monospace;
  color: #fff;
  overflow: hidden;
}


#youtube-overlay .youtube-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 8px;
  background: rgba(0, 0, 0, 0.9);
  font-size: 10px;
  color: #888;
  gap: 8px;
}

#youtube-overlay .youtube-header-buttons {
  display: flex;
  gap: 4px;
}

#youtube-overlay .youtube-close-btn,
#youtube-overlay .youtube-clear-btn {
  background: none;
  border: none;
  color: #888;
  cursor: pointer;
  font-size: 14px;
  padding: 0 4px;
  line-height: 1;
}

#youtube-overlay .youtube-close-btn:hover,
#youtube-overlay .youtube-clear-btn:hover {
  color: #fff;
}

#youtube-overlay.youtube-input-mode {
  padding: 0;
}

#youtube-overlay .youtube-url-form {
  display: flex;
  padding: 8px;
  gap: 4px;
}

#youtube-overlay .youtube-url-input {
  width: 200px;
  background: #222;
  border: 1px solid #444;
  color: #fff;
  padding: 5px 8px;
  font-family: monospace;
  font-size: 11px;
  border-radius: 3px;
  outline: none;
}

#youtube-overlay .youtube-url-input:focus {
  border-color: #666;
}

#youtube-overlay .youtube-url-input::placeholder {
  color: #666;
}

#youtube-overlay .youtube-load-btn {
  background: #444;
  border: none;
  color: #fff;
  padding: 5px 10px;
  cursor: pointer;
  font-family: monospace;
  font-size: 11px;
  border-radius: 3px;
}

#youtube-overlay .youtube-load-btn:hover {
  background: #555;
}

#youtube-player-container {
  min-width: 200px;
  min-height: 200px;
  background: #000;
}

#youtube-player-container iframe {
  display: block;
}