/* The Dude – Harmoni Bot UI (from AI Discord musik bot UI template) */

:root {
  --bg: #22434a;
  --bg-deep: #1b363c;
  --bg-mid: #2e5860;
  --cream: #f2e8d5;
  --cream-soft: #e6e3d9;
  --cream-card: #e6d9c1;
  --ink: #1b2124;
  --ink-soft: #22232a;
  --accent: #c08a4e;
  --accent-hover: #d09a5c;
  --accent-deep: #a86f3c;
  --accent-press: #7d4f28;
  --accent-link: #e0a45e;
  --accent-brown: #8c5a2c;
  --online: #8fbf6a;
  --danger: #c45c4a;
  --font-body: "Figtree", system-ui, sans-serif;
  --font-heading: "Bricolage Grotesque", "Figtree", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--cream);
  font-family: var(--font-body);
  line-height: 1.5;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.05;
  margin: 0;
}

a {
  color: var(--accent-link);
}

a:hover {
  color: var(--cream);
}

img {
  display: block;
  max-width: 100%;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

::selection {
  background: color-mix(in srgb, var(--accent) 35%, transparent);
}

@keyframes blink {
  0%, 55% { opacity: 1; }
  56%, 100% { opacity: 0.25; }
}

input[type="range"] {
  accent-color: var(--accent);
}

/* ─── Shell ─── */

#app {
  min-height: 100vh;
  background: var(--bg);
  color: var(--cream);
}

.error-banner {
  margin: 12px 34px 0;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--danger);
  color: #fff;
  font-size: 14px;
}

/* ─── Login ─── */

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 48px 24px;
  background: radial-gradient(120% 90% at 50% 0%, var(--bg-mid) 0%, var(--bg) 55%, var(--bg-deep) 100%);
}

.login-layout {
  width: 100%;
  max-width: 900px;
  display: grid;
  grid-template-columns: 1fr 366px;
  gap: 56px;
  align-items: center;
}

.login-brand {
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.login-brand-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.login-avatar {
  width: 104px;
  height: 104px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--cream);
  box-shadow: 0 10px 28px rgba(12, 28, 32, 0.45);
}

.login-eyebrow {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent-link);
  margin-bottom: 5px;
}

.login-title {
  font-size: 52px;
}

.login-tagline {
  font-size: 27px;
  max-width: 15em;
  color: var(--cream);
}

.login-lead {
  font-size: 16px;
  max-width: 26em;
  margin: 0;
  color: rgba(242, 232, 213, 0.62);
}

.login-pills {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12px;
}

.login-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 13px;
  border-radius: 999px;
  background: rgba(242, 232, 213, 0.09);
  color: rgba(242, 232, 213, 0.8);
}

.login-pill-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--online);
  animation: blink 2.4s infinite;
}

.login-card {
  background: var(--cream);
  color: var(--ink);
  border-radius: 30px;
  padding: 30px 28px;
  box-shadow: 0 22px 50px rgba(11, 26, 30, 0.45);
}

.login-card h3 {
  font-size: 25px;
  margin: 0 0 5px;
}

.login-card-sub {
  font-size: 13.5px;
  margin: 0 0 22px;
  color: rgba(27, 33, 36, 0.6);
}

.login-error {
  font-size: 13.5px;
  margin: 0 0 22px;
  color: var(--danger);
  line-height: 1.45;
}

.btn-discord {
  width: 100%;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 0;
  border-radius: 999px;
  text-decoration: none;
  background: var(--accent-deep);
  color: #f8f2e6;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
  box-shadow: 0 3px 0 var(--accent-press);
}

.btn-discord:hover {
  background: var(--accent);
  color: #f8f2e6;
}

.btn-discord:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--accent-press);
}

.btn-discord-icon {
  width: 20px;
  height: 15px;
  flex-shrink: 0;
  display: block;
}

.login-fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.login-fields label {
  display: block;
  font-size: 11.5px;
  margin-bottom: 5px;
  color: rgba(27, 33, 36, 0.62);
}

.login-fields input {
  width: 100%;
  height: 44px;
  padding: 0 16px;
  font-size: 14px;
  color: var(--ink);
  background: var(--cream-card);
  border: 1px solid rgba(27, 33, 36, 0.1);
  border-radius: 999px;
  outline-color: var(--accent-deep);
}

.login-fields input:disabled {
  opacity: 1;
  cursor: not-allowed;
}

.btn-email {
  width: 100%;
  height: 44px;
  border: 1.5px solid rgba(27, 33, 36, 0.18);
  border-radius: 999px;
  background: transparent;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
}

.btn-email:hover:not(:disabled) {
  background: rgba(27, 33, 36, 0.06);
}

button.btn-discord,
button.btn-email {
  appearance: none;
  -webkit-appearance: none;
}

/* ─── Overlay link ─── */

.link-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.link-submit {
  margin-top: 4px;
}

.link-alert {
  margin: 0 0 18px;
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.4;
}

.link-alert-error {
  background: color-mix(in srgb, var(--danger) 16%, var(--cream));
  color: #7a2f24;
}

.link-alert-success {
  background: color-mix(in srgb, var(--online) 22%, var(--cream));
  color: #2f4d1f;
}

.link-device {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 22px;
  padding: 16px 18px;
  border-radius: 18px;
  background: var(--cream-card);
  border: 1px solid rgba(27, 33, 36, 0.08);
}

.link-device-label {
  font-size: 13px;
  color: rgba(27, 33, 36, 0.62);
  word-break: break-word;
}

.link-code {
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--ink);
}

.link-actions {
  display: flex;
  flex-direction: column;
}

/* Margin i stället för gap — syns även om en gammal stylesheet ligger kvar i cache */
.link-actions > * + * {
  margin-top: 16px;
}

/* ─── Top nav ─── */

.topnav {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 16px 34px;
}

.topnav-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-right: 10px;
}

.topnav-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.topnav-name {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.03em;
}

.topnav-spacer {
  margin-right: auto;
}

.topnav-user {
  font-size: 13px;
  color: rgba(242, 232, 213, 0.55);
}

.btn-nav {
  height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: rgba(242, 232, 213, 0.6);
  font: 500 13px var(--font-body);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.btn-nav:hover {
  background: rgba(242, 232, 213, 0.1);
  color: var(--cream);
}

/* ─── Dashboard ─── */

.dash {
  max-width: 1220px;
  margin: 0 auto;
  padding: 34px 34px 56px;
}

.dash-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin: 0 0 24px;
}

.dash-head h2 {
  font-size: 32px;
}

.dash-head p {
  margin: 8px 0 0;
  font-size: 14px;
  color: rgba(242, 232, 213, 0.55);
}

.dash-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.guild-picker {
  position: relative;
  display: inline-flex;
  align-items: center;
  z-index: 5;
}

.guild-picker-trigger {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 38px;
  min-width: 168px;
  max-width: 240px;
  padding: 0 14px 0 16px;
  border: 1px solid rgba(242, 232, 213, 0.22);
  border-radius: 10px;
  background: rgba(242, 232, 213, 0.07);
  color: var(--cream);
  font: 600 13.5px var(--font-body);
  letter-spacing: -0.01em;
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.guild-picker-trigger:hover {
  background: rgba(242, 232, 213, 0.12);
  border-color: rgba(242, 232, 213, 0.38);
}

.guild-picker-trigger:focus {
  outline: none;
}

.guild-picker-trigger:focus-visible,
.guild-picker.is-open .guild-picker-trigger {
  border-color: var(--accent-link);
  box-shadow: 0 0 0 3px rgba(224, 164, 94, 0.28);
}

.guild-picker-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
}

.guild-picker-chevron {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-right: 2px solid rgba(242, 232, 213, 0.7);
  border-bottom: 2px solid rgba(242, 232, 213, 0.7);
  transform: translateY(-1px) rotate(45deg);
  transition: transform 0.15s ease;
}

.guild-picker.is-open .guild-picker-chevron {
  transform: translateY(2px) rotate(225deg);
}

.guild-picker-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  min-width: max(100%, 200px);
  margin: 0;
  padding: 6px;
  border: 1px solid rgba(242, 232, 213, 0.18);
  border-radius: 12px;
  background: var(--bg-mid);
  box-shadow: 0 16px 36px rgba(11, 26, 30, 0.35);
  z-index: 20;
}

.guild-picker-menu[hidden] {
  display: none;
}

.guild-picker-option {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--cream);
  font: 500 13.5px var(--font-body);
  text-align: left;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}

.guild-picker-option:hover,
.guild-picker-option:focus-visible {
  outline: none;
  background: rgba(224, 164, 94, 0.22);
  color: var(--cream);
}

.guild-picker-option.is-selected {
  background: var(--accent);
  color: var(--ink-soft);
  font-weight: 700;
}

.guild-picker-option.is-selected:hover,
.guild-picker-option.is-selected:focus-visible {
  background: var(--accent-hover);
  color: var(--ink-soft);
}

.btn-outline {
  height: 38px;
  padding: 0 16px;
  border: 1px solid rgba(242, 232, 213, 0.2);
  border-radius: 10px;
  background: transparent;
  color: var(--cream);
  font: 500 13.5px var(--font-body);
}

.btn-outline:hover:not(:disabled) {
  background: rgba(242, 232, 213, 0.08);
}

.btn-accent {
  height: 38px;
  padding: 0 18px;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: var(--ink-soft);
  font: 600 13.5px var(--font-body);
}

.btn-accent:hover:not(:disabled) {
  background: var(--accent-hover);
}

.dash-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.dash-main {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

/* Now playing */

.now-card {
  border-radius: 24px;
  background: var(--cream-soft);
  color: var(--ink);
  padding: 26px;
}

.now-label {
  font-size: 12px;
  color: rgba(27, 33, 36, 0.5);
  margin: 0 0 20px;
}

.now-row {
  display: flex;
  gap: 22px;
  align-items: center;
}

.now-cover {
  width: 132px;
  height: 132px;
  flex: none;
  border-radius: 16px;
  object-fit: cover;
}

.now-meta {
  min-width: 0;
  flex: 1;
}

.now-meta h3 {
  font-size: 26px;
  margin: 0 0 7px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.now-artist {
  margin: 0 0 4px;
  font-size: 15px;
  color: rgba(27, 33, 36, 0.62);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.now-sub {
  margin: 0;
  font-size: 13px;
  color: rgba(27, 33, 36, 0.42);
}

.progress-wrap {
  margin: 24px 0 0;
}

.progress-track {
  height: 4px;
  border-radius: 999px;
  background: rgba(27, 33, 36, 0.14);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--accent-deep);
  width: 0%;
}

.progress-times {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  margin-top: 9px;
  color: rgba(27, 33, 36, 0.5);
  font-variant-numeric: tabular-nums;
}

.player-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 18px 0 0;
  flex-wrap: wrap;
}

.btn-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(27, 33, 36, 0.06);
  color: rgba(27, 33, 36, 0.78);
  padding: 0;
  cursor: pointer;
}

.btn-icon:hover:not(:disabled) {
  background: rgba(27, 33, 36, 0.12);
  color: var(--ink);
}

.btn-icon:disabled {
  cursor: default;
  opacity: 0.45;
}

.btn-icon svg,
.btn-play svg,
.volume-wrap svg,
.queue-empty-icon svg {
  display: block;
  width: 1em;
  height: 1em;
  flex: none;
}

.btn-icon svg {
  width: 18px;
  height: 18px;
}

.btn-play {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--bg);
  color: var(--cream);
  padding: 0;
  cursor: pointer;
}

.btn-play:hover:not(:disabled) {
  background: var(--bg-mid);
}

.btn-play:disabled {
  cursor: default;
  opacity: 0.55;
}

.btn-play svg {
  width: 18px;
  height: 18px;
}

.volume-wrap {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 148px;
  flex: none;
  color: var(--ink);
}

.volume-wrap svg {
  opacity: 0.45;
  flex: none;
}

.volume-wrap input {
  flex: 1;
  min-width: 0;
}

.volume-label {
  font-size: 12px;
  min-width: 34px;
  text-align: right;
  color: rgba(27, 33, 36, 0.55);
  font-variant-numeric: tabular-nums;
}

/* Stats */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.stat-card {
  border-radius: 16px;
  padding: 16px 18px;
  background: rgba(242, 232, 213, 0.06);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stat-card span:first-child {
  font-size: 12px;
  color: rgba(242, 232, 213, 0.45);
}

.stat-card span:last-child {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.03em;
}

/* Queue */

.queue-card {
  border-radius: 24px;
  background: rgba(242, 232, 213, 0.06);
  padding: 24px;
  display: flex;
  flex-direction: column;
}

.queue-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 0 0 14px;
  gap: 12px;
}

.queue-head h4 {
  font-size: 19px;
}

.queue-head span {
  font-size: 12.5px;
  color: rgba(242, 232, 213, 0.45);
}

.queue-list {
  display: flex;
  flex-direction: column;
}

.queue-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-top: 1px solid rgba(242, 232, 213, 0.1);
}

.queue-item:hover {
  background: rgba(242, 232, 213, 0.04);
}

.queue-n {
  width: 14px;
  font-size: 12.5px;
  color: rgba(242, 232, 213, 0.35);
  font-variant-numeric: tabular-nums;
}

.queue-text {
  min-width: 0;
  flex: 1;
}

.queue-title {
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.queue-artist {
  font-size: 12.5px;
  color: rgba(242, 232, 213, 0.45);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.queue-len {
  font-size: 12.5px;
  color: rgba(242, 232, 213, 0.38);
  font-variant-numeric: tabular-nums;
}

.btn-remove {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: rgba(242, 232, 213, 0.35);
  padding: 0;
}

.btn-remove:hover:not(:disabled) {
  background: rgba(242, 232, 213, 0.12);
  color: var(--cream);
}

.queue-add {
  display: flex;
  gap: 9px;
  margin: 20px 0 0;
}

.queue-add input {
  flex: 1;
  min-width: 0;
  height: 40px;
  padding: 0 15px;
  font-size: 13.5px;
  color: var(--cream);
  background: transparent;
  border: 1px solid rgba(242, 232, 213, 0.2);
  border-radius: 10px;
  outline-color: var(--accent);
}

.queue-add input::placeholder {
  color: rgba(242, 232, 213, 0.35);
}

.queue-add input:disabled {
  opacity: 0.7;
}

.queue-add .btn-accent {
  flex: none;
  height: 40px;
}

.queue-empty {
  padding: 18px 0 6px;
  font-size: 14px;
  color: rgba(242, 232, 213, 0.45);
}

.queue-empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 8px;
  min-height: 168px;
  padding: 8px 0 4px;
}

.queue-empty-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  margin-bottom: 4px;
  background: rgba(242, 232, 213, 0.08);
  color: rgba(242, 232, 213, 0.72);
}

.queue-empty-icon svg {
  width: 28px;
  height: 28px;
}

.queue-empty-title {
  margin: 0;
  font-size: 16px;
  font-weight: 650;
  color: rgba(242, 232, 213, 0.88);
}

.queue-empty-copy {
  margin: 0;
  max-width: 28ch;
  font-size: 13.5px;
  line-height: 1.45;
  color: rgba(242, 232, 213, 0.5);
}

.queue-empty-steps {
  margin: 8px 0 0;
  padding: 0 0 0 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12.5px;
  color: rgba(242, 232, 213, 0.55);
}

.queue-empty-steps li::marker {
  color: rgba(242, 232, 213, 0.35);
}

/* ─── Admin ─── */

.admin-banner {
  margin: 0 34px;
  padding: 10px 16px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent-deep) 85%, #000);
  color: var(--cream);
  font-weight: 600;
  text-align: center;
  font-size: 13.5px;
  letter-spacing: 0.02em;
}

.admin-section {
  margin-bottom: 36px;
}

.admin-section h2 {
  font-size: 24px;
  margin: 0 0 14px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  background: rgba(242, 232, 213, 0.04);
  border-radius: 16px;
  overflow: hidden;
}

.data-table th,
.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(242, 232, 213, 0.1);
  text-align: left;
}

.data-table th {
  color: rgba(242, 232, 213, 0.5);
  font-weight: 500;
  background: rgba(242, 232, 213, 0.06);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.data-table tbody tr:hover {
  background: rgba(242, 232, 213, 0.05);
}

.data-table td {
  color: rgba(242, 232, 213, 0.88);
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
  color: rgba(242, 232, 213, 0.55);
  font-size: 0.9rem;
}

/* ─── Responsive ─── */

@media (max-width: 900px) {
  .login-layout {
    grid-template-columns: 1fr;
    gap: 36px;
    max-width: 420px;
  }

  .login-title {
    font-size: 42px;
  }

  .dash-grid {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .topnav,
  .dash {
    padding-left: 18px;
    padding-right: 18px;
  }

  .error-banner,
  .admin-banner {
    margin-left: 18px;
    margin-right: 18px;
  }

  .dash-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .now-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .login-avatar {
    width: 80px;
    height: 80px;
  }

  .data-table {
    display: block;
    overflow-x: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
