/* vtt-viewer.css */

/* ── App shell ── */
#vtt-app {
  display: flex;
  height: 80vh;
  min-height: 480px;
  border: 1px solid rgba(0,0,0,.12);
  border-radius: 8px;
  overflow: hidden;
}

/* ── Sidebar ── */
#vtt-sidebar {
  width: 220px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(0,0,0,.1);
  overflow: hidden;
}

#vtt-sb-top {
  padding: 12px;
  border-bottom: 1px solid rgba(0,0,0,.1);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#vtt-title {
  font-size: 15px;
  font-weight: 600;
}

#vtt-open-btn {
  width: 100%;
  padding: 7px;
  font-size: 12px;
  cursor: pointer;
  border-radius: 5px;
  border: 1px solid rgba(0,0,0,.2);
  background: transparent;
}
#vtt-open-btn:hover { background: rgba(0,0,0,.05); }

#vtt-copyright-notice {
  font-size: 10px;
  line-height: 1.5;
  opacity: .5;
  padding: 4px 2px 0;
}

/* ── File tree ── */
#vtt-tree-wrap {
  flex: 1;
  overflow-y: auto;
  padding: 6px 0;
}

.vtt-tf {
  padding: 4px 10px 4px 12px;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  user-select: none;
  opacity: .6;
}
.vtt-tf:hover { opacity: 1; }
.vtt-tf .vtt-arr {
  font-size: 9px;
  display: inline-block;
  transition: transform .15s;
  flex-shrink: 0;
}
.vtt-tf.open .vtt-arr { transform: rotate(90deg); }

.vtt-tc { display: none; padding-left: 12px; }
.vtt-tc.open { display: block; }

.vtt-fi {
  padding: 5px 8px 5px 12px;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  border-radius: 4px;
  margin: 1px 6px;
  opacity: .65;
}
.vtt-fi:hover { opacity: 1; }
.vtt-fi.active { opacity: 1; font-weight: 600; }

.vtt-fi .vtt-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
  display: none;
  background: currentColor;
  opacity: .5;
}
.vtt-fi.hit .vtt-dot { display: block; }

.vtt-fi-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Global search (inline, bottom of sidebar) ── */
#vtt-gs-area {
  border-top: 1px solid rgba(0,0,0,.1);
  padding: 10px 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(0,0,0,.03);
}

#vtt-gs-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .05em;
  opacity: .5;
}

#vtt-gs-row {
  display: flex;
  gap: 6px;
}

#vtt-gs-input {
  flex: 1;
  padding: 6px 8px;
  font-size: 12px;
  border: 1px solid rgba(0,0,0,.18);
  border-radius: 5px;
  background: transparent;
  min-width: 0;
}
#vtt-gs-input:focus { outline: none; border-color: rgba(0,0,0,.4); }

#vtt-gs-go {
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 5px;
  border: 1px solid rgba(0,0,0,.2);
  background: transparent;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}
#vtt-gs-go:hover { background: rgba(0,0,0,.07); }

#vtt-gs-progress {
  height: 2px;
  background: rgba(0,0,0,.08);
  border-radius: 1px;
  overflow: hidden;
}
#vtt-gs-fill {
  height: 100%;
  width: 0;
  background: currentColor;
  opacity: .4;
  transition: width .08s;
}

#vtt-gs-status {
  font-size: 10px;
  opacity: .5;
  min-height: 14px;
}

/* ── Main panel ── */
#vtt-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

#vtt-main-header {
  padding: 12px 16px 10px;
  border-bottom: 1px solid rgba(0,0,0,.1);
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

#vtt-file-title {
  font-size: 16px;
  font-weight: 600;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#vtt-file-title.vtt-placeholder {
  opacity: .35;
  font-weight: 400;
  font-style: italic;
}

#vtt-header-actions { display: flex; gap: 6px; }

.vtt-btn {
  padding: 4px 10px;
  font-size: 11px;
  cursor: pointer;
  border-radius: 4px;
  border: 1px solid rgba(0,0,0,.18);
  background: transparent;
}
.vtt-btn:hover { background: rgba(0,0,0,.05); }

/* ── Local search bar ── */
#vtt-search-bar {
  padding: 8px 16px;
  border-bottom: 1px solid rgba(0,0,0,.1);
  display: flex;
  align-items: center;
  gap: 8px;
}

#vtt-search-input {
  flex: 1;
  padding: 6px 10px;
  font-size: 13px;
  border: 1px solid rgba(0,0,0,.18);
  border-radius: 5px;
  background: transparent;
  min-width: 0;
}
#vtt-search-input:focus { outline: none; border-color: rgba(0,0,0,.4); }
#vtt-search-input:disabled { opacity: .35; }

#vtt-view-toggle {
  display: flex;
  border: 1px solid rgba(0,0,0,.15);
  border-radius: 5px;
  overflow: hidden;
  flex-shrink: 0;
}
#vtt-view-toggle button {
  padding: 5px 10px;
  font-size: 11px;
  border: none;
  background: transparent;
  cursor: pointer;
  opacity: .5;
}
#vtt-view-toggle button.vtt-tog-on { opacity: 1; font-weight: 600; }

/* ── Stats ── */
#vtt-stats {
  padding: 5px 16px;
  border-bottom: 1px solid rgba(0,0,0,.08);
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 11px;
  opacity: .6;
}

/* ── Content area ── */
#vtt-content { flex: 1; overflow-y: auto; }

#vtt-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 6px;
  opacity: .35;
  font-size: 13px;
  text-align: center;
}
#vtt-empty-sub { font-size: 11px; }

.vtt-cue {
  display: flex;
  border-bottom: 1px solid rgba(0,0,0,.07);
}
.vtt-cue:hover { background: rgba(0,0,0,.03); }

.vtt-cue-t {
  font-size: 10px;
  opacity: .45;
  padding: 10px 10px 10px 16px;
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 60px;
  font-variant-numeric: tabular-nums;
}

.vtt-cue-x {
  font-size: 14px;
  line-height: 1.7;
  padding: 9px 16px 9px 0;
  flex: 1;
}
.vtt-cue-x mark { border-radius: 2px; padding: 0 2px; }

.vtt-section-hd {
  padding: 5px 16px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .06em;
  border-bottom: 1px solid rgba(0,0,0,.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  opacity: .6;
  background: rgba(0,0,0,.03);
}
.vtt-section-hd:hover { opacity: 1; }

.vtt-full-tx {
  padding: 1.25rem 1.5rem;
  font-size: 14px;
  line-height: 2;
}
.vtt-full-tx mark { border-radius: 2px; padding: 0 2px; }
