* {
  box-sizing: border-box;
  margin: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background-color: #f5f5f5;
}

/* Layout */
.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-header {
  background-color: #007bff;
  color: white;
  padding: 1rem 2rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.app-header h1 {
  font-size: 1.5rem;
}

.app-main {
  flex: 1;
  display: flex;
  padding: 1rem;
  gap: 1rem;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

.sidebar {
  width: 400px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.card {
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  padding: 1rem;
}

@media (max-width: 900px) {
  .app-main {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
  }
}

/* Forms */
label {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.875rem;
  color: #555;
}

.input-field {
  width: 100%;
  padding: 0.5rem;
  margin: 0.25rem 0 0.5rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
  font-family: inherit;
}

textarea.input-field {
  resize: vertical;
}

.btn {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
  font-family: inherit;
}

.btn-small {
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
}

.btn-primary {
  background-color: #007bff;
  color: white;
}

.btn-primary:hover {
  background-color: #0056b3;
}

.btn-secondary {
  background-color: #6c757d;
  color: white;
}

.btn-secondary:hover {
  background-color: #545b62;
}

.btn-success {
  background-color: #28a745;
  color: white;
}

.btn-success:hover {
  background-color: #218838;
}

.btn-danger {
  background-color: #dc3545;
  color: white;
}

.btn-danger:hover {
  background-color: #c82333;
}

/* Lists */
.song-list,
.playlist-list {
  list-style: none;
  padding: 0;
  margin-top: 0.75rem;
}

.song-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  margin: 0.25rem 0;
  background-color: #f8f9fa;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.song-item:hover {
  background-color: #e9ecef;
}

.song-item.active {
  background-color: #007bff;
  color: white;
}

.song-item.active .provider,
.song-item.active .song-id,
.song-item.active .song-number {
  color: rgba(255, 255, 255, 0.8);
}

.song-number {
  min-width: 2rem;
  text-align: center;
  font-weight: bold;
  color: #6c757d;
}

.song-title {
  font-weight: 600;
  flex: 1;
  cursor: default;
}

.song-meta {
  color: #6c757d;
  font-family: monospace;
  font-size: 0.8rem;
  white-space: nowrap;
}

.song-title-input {
  flex: 1;
  padding: 0.25rem 0.4rem;
  border: 1px solid #007bff;
  border-radius: 3px;
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  background: white;
}

.provider {
  font-weight: bold;
  color: #007bff;
  min-width: 2rem;
}

.song-id {
  color: #6c757d;
  font-family: monospace;
  font-size: 0.875rem;
  flex: 1;
}

.song-item.active .song-title,
.song-item.active .song-meta,
.song-item.active .song-number {
  color: rgba(255, 255, 255, 0.85);
}

.song-item.active .song-title {
  color: white;
}

.playlist-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  margin: 0.25rem 0;
  background-color: #f8f9fa;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.playlist-item:hover {
  background-color: #e9ecef;
}

.playlist-item.active {
  background-color: #007bff;
  color: white;
}

.playlist-item.active .song-count {
  color: rgba(255, 255, 255, 0.8);
}

.playlist-item.editing {
  cursor: default;
  flex-direction: column;
  align-items: stretch;
  gap: 0.4rem;
  background-color: #e8f0fe;
  border: 1px solid #007bff;
}

.playlist-info {
  display: flex;
  flex-direction: column;
}

.song-count {
  color: #6c757d;
  font-size: 0.875rem;
}

.playlist-actions {
  display: flex;
  gap: 0.5rem;
}

.form-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

/* Player */
.player-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.player-header #player-info {
  flex: 1;
  min-width: 0;
}

.player-controls {
  display: flex;
  gap: 0.35rem;
  flex-shrink: 0;
}

#player-body {
  margin-top: 0.75rem;
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.3s ease, margin 0.3s ease;
  max-height: 500px;
  opacity: 1;
}

#player-body.collapsed {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
}

.now-playing {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.now-playing .song-title {
  font-weight: bold;
  font-size: 1.05rem;
}

.now-playing .song-meta {
  color: #6c757d;
  font-family: monospace;
  font-size: 0.8rem;
}

.no-content {
  color: #6c757d;
  font-style: italic;
  padding: 2rem;
  text-align: center;
  background-color: #f8f9fa;
  border-radius: 4px;
}

.error {
  color: #dc3545;
  padding: 0.5rem;
  margin: 0.5rem 0;
  background-color: #f8d7da;
  border-radius: 4px;
}

.hidden {
  display: none;
}