/* ========================================================
   MTV TOOLS - Audio Playlist Tool Styles
   ======================================================== */

.playlist-container {
  max-width: 1150px;
  margin: 0 auto;
  padding: 24px 16px 60px;
}

.tool-header-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}

.tool-title-wrap h1 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 4px;
}

.tool-subtitle {
  color: var(--muted);
  font-size: 14px;
}

/* ================= Step 1: Input Drops ================= */
.inputs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 12px;
}

.drop-zone {
  border: 2px dashed var(--line-focus);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
  background: var(--panel-elevated);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.drop-zone:hover, .drop-zone.dragover {
  border-color: var(--primary);
  background: var(--primary-soft);
  transform: translateY(-2px);
}

.drop-zone-icon {
  font-size: 28px;
  margin-bottom: 8px;
  color: var(--primary);
}

.drop-zone label {
  font-weight: 700;
  font-size: 15px;
  display: block;
  margin-bottom: 4px;
  cursor: pointer;
  color: var(--ink);
}

.drop-zone p {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 12px;
}

.drop-zone input[type="file"] {
  display: none;
}

.file-select-btn {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--ink);
  transition: var(--transition);
}

.drop-zone:hover .file-select-btn {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.file-loaded-badge {
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: var(--green);
}

.notice-hint {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  margin-top: 8px;
}

/* ================= Statusline ================= */
.statusline {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
}

.statusline strong {
  color: var(--ink);
}

/* ================= Step 2: Controls ================= */
.toolbar-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.controls-secondary {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 13px;
}

.control-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.control-item label {
  color: var(--muted);
  font-weight: 600;
}

.volume-control {
  display: flex;
  align-items: center;
  gap: 8px;
}

.volume-slider {
  width: 90px;
  cursor: pointer;
  accent-color: var(--primary);
}

/* ================= Step 3: Now Playing ================= */
.now-card {
  position: relative;
  overflow: hidden;
}

.now-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.now-title-box {
  flex: 1;
}

.now-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-soft);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  margin-bottom: 6px;
}

.now-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.now-voice {
  display: inline-block;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  margin-top: 2px;
}

.now-script {
  color: var(--ink-secondary);
  font-size: 14px;
  line-height: 1.6;
  margin-top: 10px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 120px;
  overflow-y: auto;
  background: var(--panel-elevated);
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
}

.now-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.time-clock {
  font-size: 14px;
  color: var(--muted);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Audio wave equalizer */
.sound-wave {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 24px;
}

.sound-wave span {
  width: 3px;
  height: 6px;
  background: var(--primary);
  border-radius: var(--radius-full);
  transition: height 0.2s ease;
}

.sound-wave.playing span:nth-child(1) { animation: wave 0.8s infinite ease-in-out; }
.sound-wave.playing span:nth-child(2) { animation: wave 0.6s infinite ease-in-out 0.2s; }
.sound-wave.playing span:nth-child(3) { animation: wave 1.0s infinite ease-in-out 0.4s; }
.sound-wave.playing span:nth-child(4) { animation: wave 0.7s infinite ease-in-out 0.1s; }
.sound-wave.playing span:nth-child(5) { animation: wave 0.9s infinite ease-in-out 0.3s; }

@keyframes wave {
  0%, 100% { height: 6px; }
  50% { height: 22px; }
}

/* Interactive Seek Bar */
.seek-container {
  margin-top: 16px;
  position: relative;
  cursor: pointer;
  padding: 6px 0;
}

.seek-track {
  height: 8px;
  background: var(--line);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}

.seek-progress {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
  border-radius: var(--radius-full);
  transition: width 0.1s linear;
}

/* ================= Step 4: Playlist Table ================= */
.playlist-header-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
}

.table-search-input {
  max-width: 280px;
  padding: 6px 12px;
  font-size: 13px;
}

.tablewrap {
  overflow: auto;
  max-height: 520px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  margin-top: 10px;
  background: var(--panel);
}

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 780px;
  font-size: 13px;
}

th, td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  position: sticky;
  top: 0;
  background: var(--panel-elevated);
  color: var(--muted);
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  z-index: 2;
  border-bottom: 2px solid var(--line);
}

tr {
  transition: background-color 0.15s ease;
}

tr:hover {
  background: var(--panel-hover);
}

tr.active {
  background: var(--accent-soft) !important;
}

tr.missing {
  background: rgba(220, 38, 38, 0.05);
}

td.script {
  max-width: 380px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--ink-secondary);
}

td.status-col.ok {
  color: var(--green);
  font-weight: 700;
}

td.status-col.bad {
  color: var(--red);
  font-weight: 700;
}

.empty-state {
  text-align: center;
  color: var(--muted);
  padding: 36px 20px;
}

.drag-handle {
  cursor: grab;
  color: var(--muted);
  user-select: none;
  font-size: 15px;
  margin-right: 6px;
}

.drag-handle:active {
  cursor: grabbing;
}

.row-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ================= Responsive ================= */
@media (max-width: 768px) {
  .inputs-grid {
    grid-template-columns: 1fr;
  }
  .now-header {
    flex-direction: column;
    align-items: stretch;
  }
  .now-right {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
  }
}

