.playlist-editor-body {
  margin: 0;
  background: #0f1115;
  color: #f0f4ff;
  font-family: 'Segoe UI', Arial, sans-serif;
  min-height: 100vh;
}

.editor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  background: #151924;
  border-bottom: 1px solid #1f2532;
}

.editor-header h1 {
  margin: 0;
  font-size: 22px;
}

.editor-link {
  color: #2f8fed;
  text-decoration: none;
}

.playlist-editor {
  max-width: 900px;
  margin: 30px auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 0 16px 40px;
}

.editor-panel {
  background: #151924;
  border: 1px solid #1f2532;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

#playlist-select {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #2b3242;
  background: #0f1115;
  color: #f0f4ff;
  margin-top: 8px;
}

.add-playlist-label {
  display: block;
  margin-top: 18px;
}

.playlist-create-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

#add-playlist, #add-spotify-playlist {
  flex: 1;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #2b3242;
  background: #0f1115;
  color: #f0f4ff;
}

.playlist-add-btn {
  width: auto;
  height: auto;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 14px;
  background: #f8f9ff;
  color: #11131b;
}

.playlist-add-btn:hover {
  transform: translateY(-1px);
}

.editor-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.editor-title-meta {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.editor-creator {
  font-size: 13px;
  color: #9eadc7;
}

.editor-panel-header h2 {
  margin: 0;
}

.save-btn {
  width: auto;
  height: auto;
  border-radius: 999px;
  padding: 14px 22px;
  font-size: 16px;
}

.save-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.status-message {
  min-height: 20px;
  margin-top: 8px;
  font-size: 14px;
  color: #9eadc7;
}

.editor-track-list {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
}

.editor-track-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 8px;
  background: #1c2230;
  margin-bottom: 10px;
}

.track-actions {
  display: flex;
  gap: 6px;
}

.track-actions button {
  border: none;
  width: 34px;
  height: 34px;
  border-radius: 6px;
  background: #252934;
  color: #f0f4ff;
  cursor: pointer;
  font-size: 16px;
}

.track-actions button:hover {
  background: #303645;
}

.track-title-display {
  flex: 1;
  font-weight: 600;
}

.youtube-search-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

#youtube-query {
  flex: 1;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #2b3242;
  background: #0f1115;
  color: #f0f4ff;
}

.youtube-results {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.youtube-results li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 10px;
  background: #1c2230;
}

.youtube-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.youtube-thumb {
  width: 120px;
  max-width: 120px;
  height: auto;
  border-radius: 8px;
  flex-shrink: 0;
}

.youtube-meta {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.youtube-title {
  font-weight: 600;
  line-height: 1.3;
}

.youtube-channel {
  font-size: 12px;
  color: #9eadc7;
}

.youtube-add-btn {
  white-space: nowrap;
}

.youtube-search-btn,
.youtube-add-btn {
  width: auto;
  height: auto;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 14px;
  background: #f8f9ff;
  color: #11131b;
}

.youtube-toggle-btn {
  width: auto;
  height: auto;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 14px;
  background: #252934;
  color: #f0f4ff;
}

.youtube-toggle-btn:hover {
  background: #303645;
  transform: translateY(-1px);
}

.youtube-preview-btn {
  width: auto;
  height: auto;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 14px;
  background: #252934;
  color: #f0f4ff;
}

.youtube-preview-btn:hover {
  background: #303645;
  transform: translateY(-1px);
}

.youtube-search-btn:hover,
.youtube-add-btn:hover {
  transform: translateY(-1px);
}

.youtube-preview {
  margin-top: 12px;
  border-radius: 12px;
  border: 1px solid #1f2532;
  background: #151924;
  overflow: hidden;
}

.youtube-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid #1f2532;
}

.youtube-preview-title {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.youtube-preview-close {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #252934;
  color: #f0f4ff;
  font-size: 16px;
}

.youtube-preview-close:hover {
  background: #303645;
}

.youtube-preview-frame {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  background: #000;
}

.youtube-preview-frame iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.youtube-hint {
  margin: 10px 0 0;
  font-size: 12px;
  color: #9eadc7;
}

@media (max-width: 640px) {
  .editor-panel-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .track-actions {
    flex-direction: column;
  }

  .youtube-search-row {
    flex-direction: column;
  }

  .playlist-create-row {
    flex-direction: column;
  }

  .youtube-thumb {
    width: 96px;
    max-width: 96px;
  }
}
