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

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: linear-gradient(135deg, #1db954, #191414);
  min-height: 100vh;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.container {
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 40px;
  max-width: 600px;
  width: 100%;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 40px;
}

h1 {
  text-align: center;
  margin-bottom: 30px;
  font-size: 2.5em;
  font-weight: 700;
  background: linear-gradient(45deg, #1db954, #1ed760);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section {
  margin-bottom: 30px;
}

.login-section {
  text-align: center;
}

button {
  background: linear-gradient(45deg, #1db954, #1ed760);
  color: white;
  border: none;
  padding: 14px 28px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(29, 185, 84, 0.3);
  outline: 1px solid rgba(255, 255, 255, 0.2);
  outline-color: #7c7676;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(29, 185, 84, 0.4);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.status {
  text-align: center;
  margin: 20px 0;
  padding: 12px;
  border-radius: 10px;
  font-weight: 500;
}

.status.logged-in {
  background: rgba(29, 185, 84, 0.2);
  border: 1px solid rgba(29, 185, 84, 0.5);
  color: #1ed760;
  font-weight: 600;
}

.input-group {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
  gap: 15px;
}

input[type="text"] {
  width: 100%;
  padding: 14px 20px;
  background: rgba(0, 0, 0, 0.4);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 10px;
  color: white;
  font-size: 16px;
  transition: all 0.3s ease;
}

input[type="text"]:focus {
  outline: none;
  border-color: #1db954;
  box-shadow: 0 0 0 3px rgba(29, 185, 84, 0.1);
  background: rgba(0, 0, 0, 0.6);
}

input[type="text"]:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: rgba(0, 0, 0, 0.2);
  border-color: rgba(255, 255, 255, 0.15);
}

input[type="text"]::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.output-section {
  position: relative;
}

textarea {
  width: 100%;
  min-height: 200px;
  padding: 20px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  color: white;
  font-family: 'Courier New', monospace;
  font-size: 14px;
  resize: vertical;
  line-height: 1.5;
}

textarea:focus {
  outline: none;
  border-color: #1db954;
  box-shadow: 0 0 0 3px rgba(29, 185, 84, 0.1);
}

.copy-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 8px 16px;
  font-size: 14px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(5px);
  transition: all 0.2s ease;
  z-index: 2;
  box-shadow: none;
  outline: 1px solid rgba(255, 255, 255, 0.2);
  outline-color: #7c7676;
}

.copy-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.copy-btn.copied {
  background: rgba(29, 185, 84, 0.3);
}

.button-row {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

.button-row button {
  flex: 1;
  min-width: 150px;
}

@media (max-width: 600px) {
  .container {
    padding: 30px 20px;
  }
  
  h1 {
    font-size: 2em;
  }
  
  .button-row {
    flex-direction: column;
  }
}

.options-section h3 {
  margin-bottom: 20px;
  color: #1ed760;
  font-size: 1.2em;
}

.options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 20px;
}

.option-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.option-group label {
  font-size: 14px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
}

select {
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  color: white;
  font-size: 14px;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: rgba(255, 255, 255, 0.05);
}

select:focus {
  outline: none;
  border-color: #1db954;
  box-shadow: 0 0 0 3px rgba(29, 185, 84, 0.1);
  background: rgba(255, 255, 255, 0.1);
}

select option {
  background: #191414;
  color: white;
  padding: 8px;
  transition: none;
}

@media (max-width: 600px) {
  .options-grid {
    grid-template-columns: 1fr;
  }
}

.copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 8px 16px;
  font-size: 14px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(5px);
  transition: all 0.2s ease;
  transform-origin: center;
}

.copy-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.copy-btn.copied {
  background: rgba(29, 185, 84, 0.3);
  transform: scale(0.95);
}

.copy-btn:active {
  transform: scale(0.9);
}

.copy-btn.copied {
  background: rgba(29, 185, 84, 0.3);
  animation: copyPulse 0.6s ease-out;
}

@keyframes copyPulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

.label-with-tooltip {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tooltip-container {
  position: relative;
  display: inline-block;
}

.tooltip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  font-size: 12px;
  font-weight: bold;
  color: white;
  cursor: help;
  transition: all 0.2s ease;
}

.tooltip-icon:hover {
  background: rgba(29, 185, 84, 0.3);
  border-color: rgba(29, 185, 84, 0.6);
  transform: scale(1.1);
}

.tooltip {
  position: absolute;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.95);
  color: white;
  padding: 12px;
  border-radius: 8px;
  font-size: 12px;
  text-align: left;
  line-height: 1.4;
  width: 300px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  pointer-events: none;
  z-index: 1000;
}

.tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: rgba(0, 0, 0, 0.95);
}

.tooltip-container:hover .tooltip {
  opacity: 1;
  visibility: visible;
}

@media (max-width: 600px) {
  .tooltip {
    width: 250px;
    left: 0;
    transform: none;
  }
  
  .tooltip::after {
    left: 20px;
    transform: none;
  }
}

.todo-section {
  border-top: 2px dashed #999;
  margin-top: 2rem;
  padding-top: 1rem;
  font-size: 0.9rem;
  color: #555;
}

.todo-section ul {
  list-style-type: disc;
  margin-left: 1.5rem;
}

.console-drawer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  transform: translateY(calc(100% - 40px));
  transition: transform 0.3s ease;
  z-index: 1000;
  max-height: 300px;
}

.console-drawer.expanded {
  transform: translateY(0);
}

.console-header {
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: white;
  font-size: 14px;
  font-weight: 500;
  user-select: none;
}

.console-toggle {
  transition: transform 0.3s ease;
}

.console-drawer.expanded .console-toggle {
  transform: rotate(180deg);
}

.console-content {
  padding: 20px;
  max-height: 240px;
  overflow-y: auto;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  line-height: 1.4;
}

.console-message {
  margin-bottom: 8px;
  padding: 4px 8px;
  border-radius: 4px;
  white-space: pre-wrap;
}

.console-message.info {
  color: #88ccff;
  background: rgba(136, 204, 255, 0.1);
}

.console-message.error {
  color: #ff6b7a;
  background: rgba(220, 53, 69, 0.1);
}

.console-message.success {
  color: #1ed760;
  background: rgba(29, 185, 84, 0.1);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

button:disabled:hover {
  transform: none !important;
  box-shadow: 0 4px 15px rgba(29, 185, 84, 0.3);
}

.login-btn-success {
  background: linear-gradient(45deg, #28a745, #34ce57) !important;
  cursor: default !important;
}

.login-btn-success:hover {
  transform: none !important;
}

.login-btn-success:disabled {
  opacity: 0.95;
  background: linear-gradient(45deg, #28a745, #34ce57) !important;
  color: #fff !important;
  cursor: not-allowed !important;
  box-shadow: 0 4px 15px rgba(40, 167, 69, 0.2);
}

.login-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
}

textarea#artistTextarea {
  width: 100%;
  min-height: 120px;
  padding: 14px 20px;
  background: rgba(0, 0, 0, 0.4);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 10px;
  color: white;
  font-size: 16px;
  font-family: inherit;
  transition: all 0.3s ease;
  resize: vertical;
}

textarea#artistTextarea:focus {
  outline: none;
  border-color: #1db954;
  box-shadow: 0 0 0 3px rgba(29, 185, 84, 0.1);
  background: rgba(0, 0, 0, 0.6);
}

textarea#artistTextarea:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: rgba(0, 0, 0, 0.2);
  border-color: rgba(255, 255, 255, 0.15);
}

.bulk-help {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  margin: -5px 5px 2px;
  font-style: italic;
  text-align: center;
}

.artist-status {
  margin-top: 20px;
  padding: 15px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 10px;
  display: none;
}

.artist-status.visible {
  display: block;
}

.artist-status-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.artist-status-item:last-child {
  border-bottom: none;
}

.status:empty {
  display: none;
}

.status-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 12px;
}

.status-icon.success {
  background: rgba(29, 185, 84, 0.3);
  color: #1ed760;
  border: 1px solid rgba(29, 185, 84, 0.5);
}

.status-icon.error {
  background: rgba(220, 53, 69, 0.3);
  color: #ff6b7a;
  border: 1px solid rgba(220, 53, 69, 0.5);
}

.status-icon.loading {
  background: rgba(255, 193, 7, 0.3);
  color: #ffc107;
  border: 1px solid rgba(255, 193, 7, 0.5);
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.output-area {
  position: relative;
}

.output-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
}

.output-header h3 {
  margin: 0;
  color: #1ed760;
  font-size: 1.2em;
}

.playlist-instructions {
  width: 400px;
}

@media (max-width: 600px) {
  .options-grid {
    grid-template-columns: 1fr;
  }
  
  .login-row {
    flex-direction: column;
    gap: 10px;
  }
  
  .permissions-tooltip,
  .playlist-instructions {
    width: 280px;
  }
}

.track-selection-section {
  max-height: 800px;
  overflow-y: auto;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 20px 10px 20px 0px;
}

.selection-controls {
  display: flex;
  gap: 10px;
}

.control-btn {
  padding: 8px 16px;
  font-size: 14px;
  background: rgba(255, 255, 255, 0.1);
  outline: 1px solid rgba(255, 255, 255, 0.2);
  outline-color: #7c7676;
}

.track-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-sizing: border-box;
  padding-right: 10px; /* Increased from 18px for more space */
  overflow-y: auto;
  background-clip: padding-box;
}

.artist-group {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  padding: 15px;
}

.artist-group h4 {
  color: #1ed760;
  margin-bottom: 15px;
  font-size: 1.1em;
}

.track-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  transition: background-color 0.2s ease;
  margin-bottom: 10px;
}

.track-item.disabled {
  opacity: 0.5;
  background: rgba(0, 0, 0, 0.2);
}

.track-checkbox {
  width: 18px;
  height: 18px;
  accent-color: #1db954;
}

.track-image {
  width: 50px;
  height: 50px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  object-fit: cover;
}

.track-info {
  flex: 1;
  min-width: 0;
}

.track-name {
  font-weight: 600;
  color: white;
  margin-bottom: 4px;
}

.track-details {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
}

.spotify-icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(29, 185, 84, 0.15);
  transition: box-shadow 0.2s, transform 0.2s;
  margin-left: 12px;
  text-decoration: none;
}

.spotify-icon-link svg {
  width: 28px;
  height: 28px;
  display: block;
}

.spotify-icon-link:hover {
  box-shadow: 0 4px 16px rgba(29, 185, 84, 0.25);
  transform: scale(1.08);
  background: #e9ffe6;
}

.playlist-duration {
  font-size: 16px;
  font-weight: 500;
  margin: 10px 0 14px 0;
  color: #1db954;
}

.youtube-icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px rgba(255, 0, 0, 0.15);
  transition: box-shadow 0.2s, transform 0.2s;
  margin-left: 8px;
  text-decoration: none;
}

.youtube-icon-link svg {
  width: 28px;
  height: 28px;
  display: block;
}

.youtube-icon-link:hover {
  box-shadow: 0 4px 16px rgba(255, 0, 0, 0.25);
  transform: scale(1.08);
  background: #ffeaea;
}