/* Web Lyrics Editor — Online lyrics timestamp editor
   Copyright (C) 2026 Zi Jiaxu

   This program is free software: you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation, either version 3 of the License, or
   (at your option) any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program.  If not, see <https://www.gnu.org/licenses/>. */

/* === No animations on lyrics-related elements === */
#editorBody, #editorBody * {
  transition: none !important;
  animation: none !important;
  scroll-behavior: auto !important;
}

/* === Full-height flex layout === */
html, body {
  height: 100%;
}
.container-fluid {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.container-fluid > .text-center {
  flex-shrink: 0;
}
.row-editor {
  flex: 1;
  min-height: 0;
}
.row-editor > .col-12 {
  height: 100%;
  overflow: hidden;
}
.row-editor > .col-12 > .card {
  height: 100%;
}
.card-editor {
  display: flex;
  flex-direction: column;
}
.card-editor .card-body {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding: 0;
}

/* === Cards === */
.card-upload .card-body,
.card-player .card-body {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

/* === Table Container === */
#tableView {
  height: 100%;
  display: flex;
  flex-direction: column;
}
#tableHeader {
  flex-shrink: 0;
}
#tableContainer {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
}

#tableContainer::-webkit-scrollbar {
  width: 6px;
}
#tableContainer::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}

/* === Lyrics Table === */
.table-lyrics {
  margin-bottom: 0;
  table-layout: fixed;
}
.table-lyrics th {
  background: rgba(0,0,0,.03);
  border-bottom: 1px solid rgba(0,0,0,.125);
}
.table-lyrics td,
.table-lyrics th {
  vertical-align: middle;
  padding: 0.3rem 0.5rem;
}

.col-drag {
  width: 32px;
  text-align: center;
  padding-left: 0.3rem !important;
  padding-right: 0.3rem !important;
}

.drag-handle {
  display: inline-block;
  cursor: grab;
  padding: 2px 4px;
  color: #999;
  user-select: none;
  font-size: 1rem;
  line-height: 1;
  opacity: 0.3;
}

.drag-handle:hover { opacity: 0.8; }
.drag-handle:active { cursor: grabbing; }

.sortable-chosen { background: #e8f4ff !important; }
.sortable-ghost {
  opacity: 0.25;
  background: #cce5ff !important;
}

.col-indicator {
  width: 32px;
  text-align: center;
  font-size: 0.75rem;
  padding-left: 0.3rem !important;
  padding-right: 0.3rem !important;
}

.col-time {
  width: 175px;
  white-space: nowrap;
}

.time-edit-input {
  display: inline-block;
  width: 85px;
  font-family: Consolas, 'Courier New', monospace;
  font-size: 0.85rem;
  padding: 1px 4px;
  border: 1px solid transparent;
  background: transparent;
}
.time-edit-input:focus {
  background: #fff;
  border-color: #86b7fe;
  box-shadow: 0 0 0 0.2rem rgba(13,110,253,.15);
}

.btn-time {
  padding: 0 5px;
  font-size: 0.75rem;
  line-height: 1.3;
  min-width: 22px;
  margin-left: 2px;
}

/* === Row Add / Delete Buttons === */
.col-lyric {
  display: flex;
  align-items: center;
  gap: 2px;
  padding-right: 13px;
}
.btn-row-add, .btn-row-del {
  padding: 0 3px;
  font-size: 0.72rem;
  line-height: 1.3;
  min-width: 18px;
  border: none;
  background: transparent;
  opacity: 0.3;
  cursor: pointer;
  user-select: none;
}
.btn-row-add:hover { opacity: 1; color: #198754; }
.btn-row-del:hover { opacity: 1; color: #dc3545; }

.btn-head-add {
  padding: 0 2px;
  font-size: 0.8rem;
  line-height: 1.2;
  border: none;
  background: transparent;
  opacity: 0.4;
  cursor: pointer;
  color: inherit;
}
.btn-head-add:hover { opacity: 1; color: #0d6efd; }

.col-lyric-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.lyric-input {
  flex: 1;
  min-width: 0;
  border: 1px solid transparent;
  background: transparent;
  padding: 2px 6px;
  font-size: 0.88rem;
  width: 100%;
}
.lyric-input:focus {
  background: #fff;
  border-color: #86b7fe;
}

/* Active row */
.table-lyrics tr.active {
  background-color: #cce5ff !important;
}
.table-lyrics tr.active td {
  border-color: #b8daff;
}
.table-lyrics tr.active .lyric-input {
  background: transparent;
}

/* Disabled row (unreachable due to time inversion) */
.table-lyrics tr.line-disabled {
  opacity: 0.35;
  color: #999 !important;
}
.table-lyrics tr.line-disabled input,
.table-lyrics tr.line-disabled .drag-handle {
  color: #999 !important;
}

/* Row hover */
.table-lyrics tbody tr {
  cursor: pointer;
}
.table-lyrics tbody tr:hover {
  background-color: #f0f7ff;
}
.table-lyrics tbody tr.active:hover {
  background-color: #cce5ff !important;
}

/* === Focus View === */
#focusView {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 2rem 1rem;
}

.focus-container {
  text-align: center;
  width: 100%;
  max-width: 750px;
}

.focus-nav {
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.focus-lyric {
  font-size: 2.2rem;
  line-height: 1.5;
  margin-bottom: 1.5rem;
  padding: 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 5.3rem;
  color: #212529;
}

.focus-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin-bottom: 1.5rem;
}

.focus-time {
  font-family: Consolas, 'Courier New', monospace;
  font-size: 1.4rem;
  padding: 0.15rem 0.6rem;
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  user-select: none;
  width: 7em;
  text-align: center;
  outline: none;
}
.focus-time:focus {
  background: #fff;
  border-color: #86b7fe;
  box-shadow: 0 0 0 0.2rem rgba(13,110,253,.15);
}

.focus-btn {
  font-size: 0.9rem;
  min-width: 32px;
}

.focus-preview {
  margin-top: 1.5rem;
  padding: 0.75rem 1rem;
  background: #f8f9fa;
  border-radius: 6px;
}

.focus-prev,
.focus-next {
  font-size: 0.95rem;
  padding: 0.2rem 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* === Drop Overlay === */
.drop-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(13, 110, 253, 0.08);
  border: 3px dashed #0d6efd;
  pointer-events: none;
  align-items: center;
  justify-content: center;
}
.drop-overlay.active {
  display: flex;
}
.drop-overlay-text {
  background: #0d6efd;
  color: #fff;
  padding: 1rem 2.5rem;
  border-radius: 8px;
  font-size: 1.3rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}
/* === Offset Buttons === */
.btn-offset {
  padding: 0 7px;
  font-size: 0.85rem;
  line-height: 1.4;
  min-width: 28px;
}

/* === Audio Player === */
#audioPlayer {
  width: 100%;
}

/* === Misc === */
#audioName {
  font-size: 0.82rem;
}

.row-checkbox {
  display: block;
  margin: 0 auto;
  cursor: pointer;
}

.btn-batch {
  background: #cce5ff;
  border-color: #86b7fe;
}

.time-locked {
  background: #f0f0f0;
  border-radius: 4px;
}
