/* =========================================
   Cubet – Global styles (login, suggestions, recommendations)
   ========================================= */

/* ---- Design tokens ---- */
:root {
  --bg: #020003;
  --bg-deep: #000000;
  --neon1: #d946ef;
  --neon2: #3b82f6;
  --accent: #10b981;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --card: rgba(15, 23, 42, 0.65);
  --border: rgba(255, 255, 255, 0.08);
  --shadow-soft: 0 20px 50px -12px rgba(0, 0, 0, 0.7);
  --glass-blur: blur(24px) saturate(160%);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  min-height: 100vh;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.01em;
}

/* Custom selection (no ugly bright blue) */
::selection {
  background: rgba(217, 70, 239, 0.3);
  color: #ffffff;
}

/* ---- Animated background ---- */
.bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 15% 15%, rgba(217, 70, 239, 0.15), transparent 50%),
    radial-gradient(circle at 85% 85%, rgba(59, 130, 246, 0.15), transparent 50%),
    var(--bg-deep);
  opacity: 1;
  z-index: -2;
  animation: bg-pulse 20s ease-in-out infinite alternate;
}

/* ---- Layout shell (used on suggestions + recommendations) ---- */
.container {
  position: relative;
  z-index: 1;
  max-width: 1024px;
  margin: 0 auto;
  padding: 32px 24px 48px;
}

/* ---- Header / nav ---- */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}

.logo-icon {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease-out;
}

.logo-icon:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 8px 30px rgba(217, 70, 239, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
}

.brand {
  margin-left: 12px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: 14px;
  color: var(--text);
  background: linear-gradient(to right, #fff, #cbd5e1);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.topnav,
.topnav .link,
.topnav .muted {
  font-size: 13px;
  font-weight: 500;
}

.link,
.topnav a {
  color: #94a3b8;
  text-decoration: none;
  transition: color 0.15s ease;
}

.link:hover,
.topnav a:hover {
  color: #fff;
  text-decoration: none;
}

/* ---- Global components ---- */

.card {
  border-radius: 24px;
  padding: 24px;
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  animation: fade-up 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 13px;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  cursor: pointer;
  gap: 6px;
  transition:
    transform 0.16s cubic-bezier(0.22, 0.61, 0.36, 1),
    box-shadow 0.16s ease-out,
    background 0.16s ease-out,
    border-color 0.16s ease-out;
}

.btn.small {
  padding: 6px 12px;
  font-size: 12px;
}

.btn.primary {
  background: radial-gradient(circle at top left, #1db954, #169744);
  border-color: transparent;
  color: #020712;
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.7);
}

.btn:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.9);
}

.btn.primary:hover {
  background: radial-gradient(circle at top left, #25d25f, #14a140);
}

.btn:active {
  transform: translateY(0);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
}

.input {
  width: 100%;
  padding: 9px 11px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(3, 0, 12, 0.92);
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color 0.16s ease-out, box-shadow 0.16s ease-out,
    background 0.16s ease-out, transform 0.1s ease-out;
}

.input:focus {
  border-color: rgba(99, 179, 255, 0.9);
  box-shadow: 0 0 0 1px rgba(109, 205, 255, 0.7);
  background: rgba(8, 4, 24, 0.98);
  transform: translateY(-0.5px);
}

.input::placeholder {
  color: rgba(190, 176, 235, 0.65);
}

.muted {
  color: var(--muted);
}

.footer {
  margin-top: 24px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}

/* =========================================
   CLEAN LOGIN PAGE DESIGN
   ========================================= */

body.login-page {
  background: #050008;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  overflow: hidden;
}

body.login-page .bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 20% 10%, rgba(255, 54, 255, 0.18), transparent 60%),
    radial-gradient(circle at 80% 90%, rgba(70, 185, 255, 0.16), transparent 55%),
    #050008;
  filter: blur(0px);
  animation: bg-shift 18s ease-in-out infinite alternate;
  z-index: 0;
}

@keyframes bg-shift {
  from {
    transform: translate3d(0, 0, 0);
    opacity: 0.8;
  }

  to {
    transform: translate3d(0, -12px, 0);
    opacity: 1;
  }
}

.login-wrapper {
  z-index: 2;
  width: 100%;
  max-width: 420px;
  margin-inline: auto;
  padding: 0 20px;
}

.login-card {
  text-align: center;
  padding: 28px 26px 24px;
  border-radius: 22px;
  background: rgba(12, 4, 28, 0.88);
  backdrop-filter: blur(22px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.9);
  animation: fade-up 0.5s ease-out;
}

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 14px;
}

.logo .brand {
  font-weight: 700;
  letter-spacing: 0.18em;
  font-size: 13px;
  opacity: 0.9;
}

.login-card h1 {
  margin: 0;
  font-size: 26px;
  font-weight: 650;
}

.login-card .accent {
  background: linear-gradient(90deg, var(--neon1), var(--neon2));
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
}

.subtitle {
  color: rgba(210, 195, 245, 0.8);
  margin: 10px 0 22px;
  font-size: 13px;
  line-height: 1.5;
}

.spotify-btn {
  width: 100%;
  padding: 12px 16px;
  border: none;
  border-radius: 999px;
  background: radial-gradient(circle at 20% 30%, #1db954, #169744);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  color: #020712;
  transition: transform 0.16s cubic-bezier(0.22, 0.61, 0.36, 1), box-shadow 0.16s ease-out;
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.7);
}

.spotify-btn:hover {
  transform: translateY(-1.6px) scale(1.02);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.85);
}

.spotify-btn:active {
  transform: translateY(0);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.75);
}

.small-note {
  font-size: 11px;
  margin-top: 14px;
  color: rgba(190, 178, 225, 0.75);
}

/* =========================================
   Suggestions (Discover) page
   ========================================= */

.card.discover h2 {
  font-size: 22px;
  margin-top: 0;
  margin-bottom: 8px;
}

.card.discover>p.muted {
  margin-top: 0;
  margin-bottom: 18px;
}

.prefs {
  display: grid;
  grid-template-columns: 2fr 1.4fr 1.4fr auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
}

.field {
  width: 100%;
}

#preview.card {
  margin-top: 18px;
  border-radius: 18px;
  background: rgba(5, 1, 18, 0.96);
}

/* =========================================
   Recommendation cards (used on recs + dashboard)
   ========================================= */

.recs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.rec {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 15px;
  background: rgba(8, 4, 26, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.04);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.75);
}

.rec:hover {
  border-color: rgba(137, 188, 255, 0.8);
  background: rgba(15, 8, 48, 0.96);
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.9);
}

.rec .meta h4 {
  margin: 0 0 4px;
  font-size: 14px;
}

.rec .meta p {
  margin: 0;
  font-size: 13px;
}

.thumb {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
}

/* Recommendations page info bits */
.rec-header {
  display: flex;
  align-items: center;
  padding-top: 4px;
  /* Align with top text */
}

.rec-left {
  flex: 1;
  display: flex;
  gap: 12px;
  min-width: 0;
  overflow: hidden;
}

.rec-cover {
  width: 52px;
  height: 52px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  background: #111;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

.rec-meta {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  flex: 1;
}

/* Scoped specifically to override the global section title style */
.rec .rec-title {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0 0 2px 0;
}

.rec .rec-artist {
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0.8;
}

.rec-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  margin-left: auto;
}

.rec-info {
  font-size: 13px;
  margin-bottom: 16px;
}

.rec-btn {
  margin-bottom: 18px;
}

/* ===== Recommendations toolbar + ratings ===== */

.rec-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.rec-title {
  margin: 0 0 4px;
  font-size: 20px;
}

.rec-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

/* Rating stars row */
.rating-row {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
}

.rating-stars {
  display: inline-flex;
  gap: 2px;
}

.rating-stars .star {
  cursor: pointer;
  font-size: 12px;
  color: #555a6f;
  transition: transform 0.1s ease-out, color 0.1s ease-out;
}

.rating-stars .star.hovered,
.rating-stars .star.filled {
  color: #ffd66b;
  transform: translateY(-0.5px);
}

/* =========================================
   Animations
   ========================================= */

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes bg-pulse {
  from {
    opacity: 0.8;
    transform: translate3d(0, 0, 0);
  }

  to {
    opacity: 1;
    transform: translate3d(0, -6px, 0);
  }
}

/* =========================================
   Responsive
   ========================================= */

@media (max-width: 768px) {
  .container {
    padding: 18px 14px 28px;
  }

  .header {
    flex-direction: row;
    align-items: center;
  }

  .prefs {
    grid-template-columns: 1fr;
  }

  .recs-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .login-wrapper {
    padding: 0 16px;
  }

  .login-card {
    padding: 24px 20px 20px;
  }

  .rec-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .rec-actions {
    justify-content: flex-start;
  }
}

/* ============================
   CUBET CUSTOM CURSOR
   ============================ */

/* Hide normal browser cursor everywhere */
body {
  cursor: none;
}

/* Base style used by both custom cursor elements */
#cubet-cursor-main,
#cubet-cursor-loading {
  position: fixed;
  top: 0;
  left: 0;
  width: 40px;
  /* size of the cursor area */
  height: 40px;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  will-change: transform, opacity;
}

/* -------- Main triangle cursor -------- */

#cubet-cursor-main {
  opacity: 1;
  transition: opacity 0.15s ease-out, transform 0.08s ease-out;
}

/* White inner triangle */
#cubet-cursor-main::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 18px solid #ffffff;
  /* inner triangle color */
}

/* Black outer triangle acting like a stroke */
#cubet-cursor-main::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -48%);
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-bottom: 22px solid #000000;
  /* outer stroke */
  z-index: -1;
}

/* Slight scale effect during click */
body.cubet-clicking #cubet-cursor-main {
  transform: translate(-50%, -50%) scale(0.9);
}

/* -------- Circular loading cursor -------- */

#cubet-cursor-loading {
  opacity: 0;
  transition: opacity 0.2s ease-out;
}

/* Outer circle */
#cubet-cursor-loading::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid #ffffff;
  transform: translate(-50%, -50%);
}

/* Inner circle */
#cubet-cursor-loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  transform: translate(-50%, -50%);
}

/* When loading is active */
#cubet-cursor-loading.is-active {
  opacity: 1;
}

/* ============================
   PAGE TRANSITIONS
   ============================ */

body {
  opacity: 0;
  transition: opacity 0.4s ease-in-out;
}

body.page-loaded {
  opacity: 1;
}

body.page-exiting {
  opacity: 0;
}

/* Search Results Dropdown */
.search-results-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-top: 8px;
  max-height: 400px;
  overflow-y: auto;
  z-index: 100;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(12px);
}

.search-result-item {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  gap: 12px;
  cursor: pointer;
  transition: background 0.1s;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item:hover {
  background: rgba(255, 255, 255, 0.1);
}

.search-result-img {
  width: 40px;
  height: 40px;
  border-radius: 4px;
  object-fit: cover;
}

.search-result-info {
  flex: 1;
  min-width: 0;
}

.search-result-title {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #fff;
}

.search-result-artist {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Vibe Tuner Sliders */
input[type=range] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  background: transparent;
}

input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  height: 20px;
  width: 20px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  margin-top: -8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

input[type=range]::-webkit-slider-runnable-track {
  width: 100%;
  height: 4px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
}

input[type=range]:focus {
  outline: none;
}
