/* Shared "Add track" button + modal, self-contained like player.css. */

.at-trigger-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border-radius: 10px;
  border: 1.5px solid rgba(99, 102, 241, 0.5);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(236, 72, 153, 0.1) 100%);
  color: rgba(255,255,255,0.9);
  font-size: 0.85rem;
  font-weight: 700;
  font-family: inherit;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(8px);
  position: relative;
  overflow: hidden;
}

.at-trigger-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.15) 50%, transparent 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.at-trigger-btn:hover {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.3) 0%, rgba(236, 72, 153, 0.2) 100%);
  color: #ffffff;
  border-color: rgba(99, 102, 241, 0.8);
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.35);
  transform: translateY(-2px);
}

.at-trigger-btn:hover::before {
  opacity: 1;
}

.at-trigger-btn:active {
  transform: translateY(0);
}

.at-trigger-icon {
  font-size: 1rem;
  line-height: 1;
  font-weight: 800;
  color: #c4b5fd;
  transition: color 0.3s ease;
}

.at-trigger-btn:hover .at-trigger-icon {
  color: #f0abfc;
}

@media (max-width: 760px) {
  .at-trigger-btn {
    width: 40px;
    height: 40px;
    padding: 0;
    justify-content: center;
  }

  .at-trigger-label {
    display: none;
  }
}

/* ==================== Modal ==================== */

.at-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 8, 20, 0.72);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3000;
  padding: 16px;
  animation: atFadeIn 0.2s ease both;
}

.at-overlay[hidden] { display: none; }

@keyframes atFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.at-box {
  width: 100%;
  max-width: 420px;
  background: linear-gradient(160deg, #171b3a 0%, #14183a 100%);
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.03) inset;
  animation: atBoxIn 0.25s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes atBoxIn {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.at-box h3 {
  margin: 0 0 6px;
  font-size: 1.2rem;
  font-weight: 800;
  color: #ffffff;
}

.at-subtitle {
  margin: 0 0 18px;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.55);
  line-height: 1.4;
}

.at-field {
  margin-bottom: 14px;
}

.at-field label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  color: rgba(255,255,255,0.75);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.at-field input {
  width: 100%;
  height: 42px;
  box-sizing: border-box;
  border-radius: 12px;
  border: 1.5px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.04);
  color: #ffffff;
  font-family: inherit;
  font-size: 0.9rem;
  padding: 0 12px;
  transition: border-color 0.2s ease;
}

.at-field input:focus {
  outline: none;
  border-color: #6366f1;
}

.at-field .at-hint {
  margin-top: 6px;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.4);
  line-height: 1.4;
}

.at-message {
  margin-top: 4px;
  font-size: 0.82rem;
  min-height: 1.2em;
  line-height: 1.4;
}

.at-message.error { color: #f87171; }
.at-message.success { color: #34d399; }
.at-message.info { color: rgba(255,255,255,0.6); }

.at-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.at-btn {
  min-height: 40px;
  padding: 0 18px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  border: 1.5px solid rgba(255,255,255,0.15);
  background: transparent;
  color: #ffffff;
  transition: all 0.2s ease;
}

.at-btn.primary {
  border-color: rgba(99, 102, 241, 0.7);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.35) 0%, rgba(236, 72, 153, 0.25) 100%);
}

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

.at-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(255,255,255,0.4);
}

/* ==================== Toast (sign-in prompt etc.) ==================== */

.at-toast-container {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  padding: 0 12px;
  width: 100%;
  pointer-events: none;
}

.at-toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 380px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(20, 22, 46, 0.95);
  border: 1px solid rgba(248, 113, 113, 0.55);
  color: #ffffff;
  font-size: 0.85rem;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
  animation: atToastIn 0.25s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.at-toast.leaving {
  animation: atToastOut 0.2s ease forwards;
}

@keyframes atToastIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes atToastOut {
  to { opacity: 0; transform: translateY(-10px); }
}
