/*
  Spotify Color API - Design System (refonte)
  ------------------------------------------------------------
  - Palette sombre, clair lisible
  - Styles cohérents: layout, cartes, boutons, formulaires
  - Composants: header, endpoints, NowPlaying, etc.
*/

:root {
  --bg: #0d1117;
  --panel: #0f141b;
  --panel-2: #111826;
  --line: #2a2f3a;
  --text: #c9d1d9;
  --muted: #8b949e;
  --pri: #238636;
  --accent: #58a6ff;
  --warn: #f85149;
}

/* Reset & base */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
html,
body {
  overflow-x: hidden;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial,
    sans-serif;
}
a {
  color: var(--accent);
  text-decoration: none;
}
a:not(.btn):hover {
  text-decoration: underline;
}

/* Typography */
h1,
h2,
h3 {
  color: var(--text);
  margin: 0 0 0.6rem;
  letter-spacing: -0.01em;
}
p {
  line-height: 1.5;
}
.muted {
  color: var(--muted);
}
.brand {
  font-weight: 800;
  color: var(--pri);
}

/* Header */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  background: #0e1116;
}
header a {
  color: inherit;
  text-decoration: none;
}

/* Layout */
.container {
  max-width: 920px;
  margin: 0 auto;
  padding: 22px;
}
.wrap {
  max-width: 980px;
  margin: 0 auto;
}
.shell {
  max-width: 900px;
  margin: 6vh auto 0;
  padding: 20px;
}
.grid {
  display: grid;
  gap: 14px;
}
.grid.auto {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.grid.two-col {
  grid-template-columns: 1.2fr 1fr;
  gap: 16px;
}
@media (max-width: 900px) {
  .grid.two-col {
    grid-template-columns: 1fr;
  }
}
.row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.hero {
  min-height: 86vh;
  display: grid;
  place-items: center;
  padding: 28px;
}
.hero-bg {
  background: radial-gradient(
      900px 500px at 10% 0%,
      rgba(29, 185, 84, 0.15),
      transparent
    ),
    radial-gradient(
      900px 500px at 90% 0%,
      rgba(105, 179, 255, 0.12),
      transparent
    ),
    var(--bg);
}

/* Surfaces */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.card:hover {
  border-color: #3d444d;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
}
.panel {
  background: #0f0f0f;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
}
main.wrap {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px;
  margin: 8vh auto;
}

/* Buttons */
.btn {
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #21262d;
  color: var(--text);
  cursor: pointer;
  display: inline-block;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.2;
  transition: background 0.15s ease, border-color 0.15s ease,
    transform 0.08s ease;
}
.btn:hover {
  background: #30363d;
  border-color: #3d444d;
  transform: translateY(-1px);
}
.btn:active {
  transform: translateY(0);
}
.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.btn.primary {
  background: var(--pri);
  border-color: #2ea043;
  color: #fff;
}
.btn.primary:hover {
  background: #2ea043;
  border-color: #3fb950;
}
.btn.accent {
  background: var(--accent);
  border-color: #6aa7ff;
  color: #0b1220;
}
.btn.accent:hover {
  background: #6aa7ff;
  border-color: #97c2ff;
}
.btn.secondary {
  background: #1b2230;
}
.btn.red {
  background: #da3633;
  border-color: #a40e0e;
  color: #fff;
}
.btn.red:hover {
  background: #f85149;
  border-color: #ff7b72;
}
.btn.block {
  display: block;
  width: 100%;
  text-align: center;
}
.cta {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 24px;
}

/* Forms */
label {
  display: block;
  margin: 8px 0 6px;
  color: var(--muted);
  font-size: 14px;
}
input,
select,
textarea {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #0b0b0b;
  color: #fff;
}

/* Chips */
.chip {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid var(--line);
  background: #0f141b;
}
.chip.ok {
  background: #0f2b1a;
  border-color: #2ea043;
  color: #a5d6b2;
}
.chip.warn {
  background: #2b1414;
  border-color: var(--warn);
  color: #ffadad;
}
.pill {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

/* Endpoint rows */
.endpoint {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 8px 0;
}
.endpoint code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: #9fbad1;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.endpoint .method {
  width: 44px;
  font-weight: 800;
  color: #ffd700;
}
.endpoint .url {
  color: #9ad;
}
.endpoint button {
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--muted);
  cursor: pointer;
}

/* User page specifics */
.cover {
  width: 140px;
  height: 140px;
  border-radius: 14px;
  overflow: hidden;
  background: var(--panel);
  display: grid;
  place-items: center;
}
.sw {
  width: 100%;
  height: 120px;
  border-radius: 10px;
  margin-top: 8px;
  transition: background-color 1s ease;
}
.actions {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Now Playing */
.np-wrap {
  margin-top: 10px;
}
.np-title {
  font-weight: 600;
  color: var(--text);
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.np-artist,
.np-album {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.np-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.status {
  display: flex;
  align-items: center;
  gap: 8px;
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #8b949e;
}
.status.playing .status-dot {
  background: #1db954;
  box-shadow: 0 0 0 0 rgba(29, 185, 84, 0.5);
  animation: pulse 1.6s infinite;
}
@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(29, 185, 84, 0.5);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(29, 185, 84, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(29, 185, 84, 0);
  }
}
.np-times {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}
.progress {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: #161b22;
  border: 1px solid var(--line);
  overflow: hidden;
  margin-top: 8px;
}
.progress .bar {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.5s linear, background-color 0.3s ease;
}

/* Utils */
.hidden {
  display: none !important;
}

/* Messages */
.msg {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #10151d;
  color: var(--text);
}
.msg.info {
  background: #0e1624;
  border-color: #273142;
}
.msg.success {
  background: #0f2b1a;
  border-color: #2ea043;
  color: #a5d6b2;
}
.msg.error {
  background: #2b1414;
  border-color: var(--warn);
  color: #ffadad;
}

/* Utilities */
.center {
  display: grid;
  place-items: center;
}
.space-y-1 > * + * {
  margin-top: 4px;
}
.space-y-2 > * + * {
  margin-top: 8px;
}
.space-y-3 > * + * {
  margin-top: 12px;
}
.mt-1 {
  margin-top: 4px;
}
.mt-2 {
  margin-top: 8px;
}
.mt-3 {
  margin-top: 14px;
}
.mt-4 {
  margin-top: 24px;
}
.mt-5 {
  margin-top: 32px;
}
.text-center {
  text-align: center;
}

/* Focus styles */
:focus {
  outline: none;
}
.btn:focus,
input:focus,
select:focus,
textarea:focus,
a:focus {
  box-shadow: 0 0 0 2px rgba(88, 166, 255, 0.35);
  border-color: #58a6ff;
}

/* Footer */
.site-footer {
  position: sticky;
  top: 100vh; /* pousse le footer en bas de page */
  width: 100%;
  border-top: 1px solid var(--line);
  background: #0e1116;
}
.site-footer .wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  justify-content: center;
}
.site-footer .sep {
  color: var(--line);
}
