/* ==========================================================================
   ASCIINEMA PLAYER (Tailwind Prototype Cleaned)
   --------------------------------------------------------------------------
   - Stripped of all stock themes (dracula, monokai, nord, etc.)
   - No fixed font-size, width, or height
   - Transparent backgrounds by default
   - Only functional pieces: player layout, terminal, cursor, overlays, controls
   ========================================================================== */

div.ap-player div.ap-control-bar {
  width: 100%;
  height: 32px;
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  box-sizing: content-box;
  left: 0;
  user-select: none;
  z-index: 30;
}

div.ap-player div.ap-control-bar * {
  box-sizing: inherit;
}

div.ap-control-bar span.ap-button {
  display: flex;
  flex: 0 0 auto;
  cursor: pointer;
  color: inherit;
}

div.ap-control-bar span.ap-playback-button {
  width: 12px;
  height: 12px;
  padding: 10px;
}

div.ap-control-bar span.ap-playback-button svg {
  height: 12px;
  width: 12px;
}
div.ap-control-bar span.ap-button .ap-icon {
  fill: currentColor;
}

div.ap-control-bar span.ap-timer {
  display: flex;
  flex: 0 0 auto;
  min-width: 50px;
  margin: 0 10px;
  height: 100%;
  text-align: center;
  line-height: 100%;
  cursor: default;
}

div.ap-control-bar span.ap-timer span {
  font-family: Consolas, Menlo, 'Bitstream Vera Sans Mono', monospace;
  font-size: inherit;
  font-weight: 100;
  margin: auto;
}

div.ap-control-bar span.ap-timer .ap-time-remaining {
  display: none;
}

div.ap-control-bar span.ap-timer:hover .ap-time-elapsed {
  display: none;
}

div.ap-control-bar span.ap-timer:hover .ap-time-remaining {
  display: flex;
}

div.ap-control-bar .ap-progressbar {
  display: block;
  flex: 1 1 auto;
  height: 100%;
  padding: 0 10px;
}

div.ap-control-bar .ap-progressbar .ap-bar {
  display: block;
  position: relative;
  cursor: default;
  height: 100%;
  font-size: 0;
}

div.ap-control-bar .ap-progressbar .ap-bar {
  display: flex;
  align-items: flex-end;   /* anchor to bottom */
  height: 100%;
  position: relative;
}

div.ap-control-bar .ap-progressbar .ap-bar .ap-gutter {
  position: absolute;
  bottom: 20px;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: 3px;
  background-color: gainsboro;
}

div.ap-control-bar .ap-progressbar .ap-bar .ap-gutter-full {
  width: 100%;
  transform-origin: left center;
  border-radius: 3px;
  background-color: orange;
}
div.ap-control-bar.ap-seekable .ap-progressbar .ap-bar {
  cursor: pointer;
}

div.ap-wrapper.ap-hud .ap-control-bar {
  opacity: 1;
}

span.ap-progressbar span.ap-marker-container {
  display: block;
  top: 0;
  bottom: 0;
  width: 21px;
  position: absolute;
  margin-left: -10px;
}
.ap-wrapper {
  position: relative;
  display: block;
  overflow: hidden;
  overflow-x: hidden;
  font-size: inherit !important;
}

/* Player root */
.ap-player {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: inherit;
  font-size: inherit !important;;
}

/* Terminal text area */
.ap-terminal {
  white-space: pre;
  overflow: hidden;
  outline: none;
  line-height: var(--term-line-height, 1.3);
  font-size: inherit !important;
  font-family: monospace;
}
.ap-terminal pre {
  font-size: inherit !important;
  line-height: inherit !important;
}

/* Terminal lines */
.ap-line {
  display: block;
  white-space: pre;
  overflow: hidden;
  font-size: inherit !important;
}

/* Segments */
.ap-line span {
  display: inline-block;
  white-space: pre;
  color: var(--fg, inherit);
  background: var(--bg, transparent);
  font-size: inherit !important;
}

/* Cursor */
.ap-cursor {
  background: currentColor;
  color: var(--term-color-background, transparent);
  font-size: inherit;
}

.ap-cursor-on .ap-cursor {
  visibility: visible;
}

.ap-blink .ap-cursor {
  animation: ap-cursor-blink 1.2s steps(1) infinite;
}

@keyframes ap-cursor-blink {
  50% {
    visibility: hidden;
  }
}

/* Overlays (start, loader, info, error) */
.ap-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.6);
  color: white;
  font-size: inherit !important;
}

.ap-overlay-start {
  cursor: pointer;
}

.ap-play-button {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Loader animation (simple spinner) */
.ap-loader {
  border: 4px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  width: 3rem;
  height: 3rem;
  animation: ap-spin 1s linear infinite;
}

@keyframes ap-spin {
  100% {
    transform: rotate(360deg);
  }
}
div.ap-control-bar.ap-seekable {
  position: relative;
  height: 12px;
  align-items: center; 
  justify-content: space-between;
  margin-top: 0px; 
  z-index: 30;
}

/* Cursor block */
.ap-terminal.ap-cursor-on .ap-cursor {
  font-size: inherit !important;
  background-color: currentColor;        /* text color becomes the block */
  color: var(--term-color-background);   /* inverse text */
}

/* Blinking animation */
.ap-terminal.ap-blink .ap-cursor {
  font-size: inherit !important;
  animation: ap-cursor-blink 1s steps(1) infinite;
}

@keyframes ap-cursor-blink {
  50% {
    font-size: inherit !important;
    background-color: transparent;       /* cursor disappears */
    color: currentColor;                 /* reveal text underneath */
  }
}


