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

:root {
  --bg-color: #0d0b14;
  --panel-bg: rgba(25, 23, 36, 0.65);
  --panel-border: rgba(255, 255, 255, 0.08);
  --text-main: #f0f0f5;
  --text-muted: #8e8c99;
  --accent-color: #7b2cbf;
  --accent-hover: #9d4edd;
  --danger-color: #e63946;
  --danger-hover: #ff4d6d;
  --success-color: #06d6a0;
  --success-hover: #08f2b5;
  --item-bg: rgba(255, 255, 255, 0.03);
  --item-hover: rgba(255, 255, 255, 0.08);
  --item-active: rgba(123, 44, 191, 0.3);
  --glass-blur: blur(16px);
  --font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-color);
  color: var(--text-main);
  overflow-x: hidden;
  line-height: 1.5;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Ambient Background */
.background-ambient {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  background: 
    radial-gradient(circle at 15% 50%, rgba(123, 44, 191, 0.15), transparent 40%),
    radial-gradient(circle at 85% 30%, rgba(6, 214, 160, 0.1), transparent 40%);
  pointer-events: none;
}

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

.app-header {
  padding: 1.5rem 2rem;
  background: rgba(13, 11, 20, 0.8);
  backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--panel-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-actions {
  display: flex;
  gap: 1rem;
}

.app-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  background: linear-gradient(135deg, #e0c3fc 0%, #8ec5fc 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  letter-spacing: -0.5px;
}

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

.sidebar {
  width: 380px;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  flex-shrink: 0;
}

.content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  min-width: 0;
}

.card {
  background: var(--panel-bg);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  padding: 1.5rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.card h2 {
  font-weight: 600;
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  color: #fff;
}

.manager-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

@media (max-width: 900px) {
  .app-main {
    flex-direction: column;
    padding: 1rem;
  }
  .sidebar {
    width: 100%;
  }
}

/* Forms & Inputs */
label {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.input-field {
  width: 100%;
  padding: 0.75rem 1rem;
  margin: 0.25rem 0 0.75rem;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 0.95rem;
  font-family: inherit;
  transition: all 0.2s;
}

.input-field:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(123, 44, 191, 0.2);
}

.input-field::placeholder {
  color: rgba(255, 255, 255, 0.2);
}

textarea.input-field {
  resize: vertical;
  min-height: 80px;
}

/* Buttons */
.btn {
  padding: 0.6rem 1.25rem;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 0.95rem;
  font-family: inherit;
  font-weight: 500;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn:active {
  transform: scale(0.96);
}

.btn-small {
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-color), var(--accent-hover));
  color: white;
  box-shadow: 0 4px 12px rgba(123, 44, 191, 0.3);
}

.btn-primary:hover {
  filter: brightness(1.1);
  box-shadow: 0 6px 16px rgba(123, 44, 191, 0.4);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  border: 1px solid var(--panel-border);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
}

.btn-danger {
  background: rgba(230, 57, 70, 0.15);
  color: var(--danger-hover);
  border: 1px solid rgba(230, 57, 70, 0.3);
}

.btn-danger:hover {
  background: var(--danger-color);
  color: white;
  box-shadow: 0 4px 12px rgba(230, 57, 70, 0.3);
}

.btn-success {
  background: var(--success-color);
  color: #000;
}

/* Lists */
.song-list,
.playlist-list {
  list-style: none;
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.song-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1rem;
  background: var(--item-bg);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
}

.song-item:hover {
  background: var(--item-hover);
  transform: translateX(4px);
}

.song-item.active {
  background: var(--item-active);
  border-color: rgba(123, 44, 191, 0.4);
}

.song-number {
  min-width: 2rem;
  text-align: center;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.song-title {
  font-weight: 500;
  flex: 1;
  cursor: default;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.song-meta {
  color: var(--text-muted);
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.8rem;
  white-space: nowrap;
  background: rgba(0, 0, 0, 0.3);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.song-meta.provider-y {
  color: #ff9999;
  background: rgba(230, 57, 70, 0.15);
  border: 1px solid rgba(230, 57, 70, 0.3);
}

.song-meta.provider-s {
  color: #ffb380;
  background: rgba(255, 85, 0, 0.15);
  border: 1px solid rgba(255, 85, 0, 0.3);
}

.song-actions {
  display: flex;
  gap: 0.4rem;
  opacity: 0;
  transition: opacity 0.2s ease;
  margin-left: 0.5rem;
}

.song-item:hover .song-actions,
.song-item.active .song-actions {
  opacity: 1;
}

.song-actions .btn {
  padding: 0.25rem 0.5rem;
  font-size: 0.85rem;
  line-height: 1;
  min-width: 32px;
}

.song-title-input {
  flex: 1;
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--accent-color);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  background: rgba(0, 0, 0, 0.5);
  color: white;
}

.provider {
  font-weight: 700;
  color: var(--accent-hover);
  min-width: 2rem;
}

.song-id {
  color: var(--text-muted);
  font-family: monospace;
  font-size: 0.875rem;
  flex: 1;
}

.song-item.active .song-title {
  color: #fff;
  font-weight: 600;
}

.song-item.active .song-number {
  color: var(--accent-hover);
}

.playlist-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: var(--item-bg);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
}

.playlist-item:hover {
  background: var(--item-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.playlist-item.active {
  background: var(--item-active);
  border-color: rgba(123, 44, 191, 0.4);
}

.playlist-item.editing {
  cursor: default;
  flex-direction: column;
  align-items: stretch;
  gap: 0.5rem;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--accent-color);
  transform: none;
  box-shadow: 0 0 20px rgba(123, 44, 191, 0.15);
}

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

.playlist-info strong {
  font-size: 1.05rem;
  font-weight: 600;
  color: #fff;
}

.song-count {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.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: 1rem;
  background: rgba(0, 0, 0, 0.2);
  padding: 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--panel-border);
}

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

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

#player-body {
  margin-top: 1rem;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  max-height: 500px;
  opacity: 1;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

#player-body.collapsed {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
  transform: scaleY(0.95);
  transform-origin: top;
}

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

.now-playing .song-title {
  font-weight: 600;
  font-size: 1.1rem;
  color: #fff;
}

.now-playing .song-meta {
  color: var(--accent-hover);
  background: rgba(123, 44, 191, 0.15);
}

.no-content {
  color: var(--text-muted);
  font-style: italic;
  padding: 3rem 2rem;
  text-align: center;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-md);
  border: 1px dashed rgba(255, 255, 255, 0.1);
}

.error {
  color: var(--danger-color);
  padding: 0.75rem;
  margin: 0.5rem 0;
  background: rgba(230, 57, 70, 0.1);
  border-left: 4px solid var(--danger-color);
  border-radius: var(--radius-sm);
}

.error-border {
  border-color: var(--danger-color) !important;
  box-shadow: 0 0 0 2px rgba(230, 57, 70, 0.2) !important;
}

.shake {
  animation: shake 0.4s cubic-bezier(.36, .07, .19, .97) both;
}

@keyframes shake {
  10%, 90% { transform: translate3d(-1px, 0, 0); }
  20%, 80% { transform: translate3d(2px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
  40%, 60% { transform: translate3d(4px, 0, 0); }
}

.hidden {
  display: none !important;
}

/* About Section */
.about-content {
  padding: 1rem;
}

.about-content h2 {
  font-size: 2rem;
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, #e0c3fc 0%, #8ec5fc 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.about-content h3 {
  font-size: 1.3rem;
  margin: 2rem 0 1rem;
  color: #fff;
}

.about-content p {
  margin-bottom: 1rem;
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.6;
}

.about-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.about-list li {
  padding-left: 1.5rem;
  position: relative;
  color: var(--text-main);
}

.about-list li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--accent-hover);
}

.about-footer {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--panel-border);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.about-footer p {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}