/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */


/* ═══════════════════════════════════════════════════
   Design System — "Stripped Down"
   See public/style-guide.html for full reference
   ═══════════════════════════════════════════════════ */

/* --- Typography --- */

.page-heading {
  font-size: 2.2rem;
  font-weight: 300;
  letter-spacing: -0.03em;
  color: #111;
}

.section-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: #999;
  font-weight: 500;
}

.stat-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #bbb;
  font-weight: 500;
  margin-bottom: 2px;
}

.stat-value {
  font-size: 2rem;
  font-weight: 300;
  letter-spacing: -0.03em;
  color: #111;
}

.stat-value-text {
  font-size: 1.1rem;
  font-weight: 400;
  color: #111;
}

.text-body {
  font-size: 0.88rem;
  color: #111;
}

.text-body-medium {
  font-size: 0.88rem;
  font-weight: 500;
  color: #111;
}

.text-caption {
  font-size: 0.82rem;
  color: #999;
}

.text-small {
  font-size: 0.78rem;
  color: #bbb;
}

.text-micro {
  font-size: 0.72rem;
  color: #999;
}

/* --- Layout --- */

.section-divider {
  border-top: 1px solid #eee;
  padding-top: 32px;
  margin-top: 32px;
}

.border-divider {
  border-bottom: 1px solid #eee;
}

/* --- Buttons --- */

.btn-link {
  font-size: 0.82rem;
  color: #999;
  text-decoration: underline;
  background: none;
  border: none;
  cursor: pointer;
}

.btn-link-sm {
  font-size: 0.78rem;
  color: #999;
  text-decoration: underline;
  background: none;
  border: none;
  padding: 0;
  margin-top: 4px;
  cursor: pointer;
}

/* --- Status dots --- */

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50% !important;
  display: inline-block;
  flex-shrink: 0;
}

.status-dot-connected {
  background: #111;
}

.status-dot-disconnected {
  background: #ddd;
}

/* --- Toggle rows --- */

.toggle-row {
  padding: 16px 0;
  border-bottom: 1px solid #f0f0f0;
}

.toggle-label {
  font-size: 0.88rem;
  color: #111;
}

.toggle-description {
  font-size: 0.78rem;
  color: #bbb;
}

/* --- Navigation --- */

.nav-text {
  font-size: 0.82rem;
  font-weight: 500;
}

/* --- Homepage --- */

.hero-heading {
  font-size: clamp(2.8rem, 8vw, 5.5rem);
  font-weight: 300;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.hero-subtext {
  font-size: 1.15rem;
  color: #666;
  line-height: 1.6;
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
  font-weight: 400;
}

.hero-pill {
  font-size: 0.85rem;
  color: #999;
  font-weight: 400;
}

.hero-divider {
  width: 40px;
  height: 1px;
  background: #ddd;
  margin: 60px auto;
}

/* --- Album display --- */

.album-title {
  font-size: 2rem;
  font-weight: 300;
  letter-spacing: -0.03em;
  color: #111;
}

.artist-name {
  font-size: 1rem;
  font-weight: 400;
  color: #999;
}

/* --- Footer --- */

.footer-link {
  color: #bbb;
  text-decoration: none;
  transition: color 0.2s;
}

.footer-link:hover {
  color: #111;
}

/* Navigation links: muted gray with hover to black */
.nav-link {
  color: #bbb;
  transition: color 0.2s ease;
}

.nav-link:hover {
  color: #111;
}

/* Album display fade in animation on page load */
@keyframes albumFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#album_display {
  animation: albumFadeIn 0.5s ease-out;
}

/* Album hover 3D effect (no shadows, no border-radius) */
[data-album-hover-target="artwork"] {
  transform-style: preserve-3d;
  backface-visibility: hidden;
}

[data-album-hover-target="artwork"] img,
[data-album-hover-target="artwork"] > div {
  transition: transform 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

/* Modal animation enhancements */
[data-modal-target="backdrop"] {
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition:
    opacity 300ms cubic-bezier(0.4, 0.0, 0.2, 1),
    backdrop-filter 300ms cubic-bezier(0.4, 0.0, 0.2, 1);
}

[data-modal-target="panel"] {
  transition:
    opacity 300ms cubic-bezier(0.4, 0.0, 0.2, 1),
    transform 300ms cubic-bezier(0.4, 0.0, 0.2, 1);
  will-change: transform, opacity;
  border: 1px solid #eee;
}

/* Respect user's motion preferences */
@media (prefers-reduced-motion: reduce) {
  [data-modal-target="backdrop"],
  [data-modal-target="panel"] {
    transition: none !important;
  }

  #album_display {
    animation: none !important;
  }

  [data-album-hover-target="artwork"] {
    transition: none !important;
  }
}

/* Track listing fade-in animation */
@keyframes trackFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Track listing animations (monochrome) */
[data-track-listing-target="track"] {
  transition:
    background-color 0.2s ease-out,
    transform 0.2s ease-out;
  cursor: default;
}

[data-track-listing-target="track"]:hover {
  background-color: rgba(0, 0, 0, 0.02);
  transform: translateX(4px);
}

/* Track position number subtle highlight on hover */
[data-track-listing-target="track"]:hover .text-gray-500 {
  color: #111;
  transition: color 0.2s ease-out;
}

/* Smooth transitions for track titles */
[data-track-listing-target="track"] .text-gray-900 {
  transition: color 0.2s ease-out;
}

/* Side selector smooth transitions */
[data-track-listing-target="sideSelector"] {
  transition: border-color 0.2s ease-out;
}

/* Track list container for smooth height changes */
[data-track-listing-target="trackList"] {
  transition: height 0.3s ease-out;
}

/* Track filtering transitions */
[data-track-listing-target="track"].filtering {
  transform: scale(0.95);
  opacity: 0;
  transition:
    opacity 0.2s ease-out,
    transform 0.2s ease-out;
}

/* Track loading state shimmer (monochrome) */
[data-track-listing-target="track"].loading {
  background: linear-gradient(90deg,
    rgba(229, 231, 235, 0.1) 25%,
    rgba(229, 231, 235, 0.3) 50%,
    rgba(229, 231, 235, 0.1) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

/* Stat strip: single horizontal bar with hairline borders between items */
.stat-strip-item {
  border-bottom: 1px solid #eee;
}

.stat-strip-item:last-child {
  border-bottom: none;
}

@media (min-width: 640px) {
  .stat-strip-item {
    border-bottom: none;
    border-right: 1px solid #eee;
  }

  .stat-strip-item:last-child {
    border-right: none;
  }
}

/* Toggle switch (style guide: 40x22px, pill-shaped, black when on) */
.toggle-track {
  width: 40px;
  height: 22px;
  background: #ddd;
  border-radius: 11px;
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}

.toggle-track.on {
  background: #111;
}

.toggle-track.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.toggle-track .toggle-knob {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  top: 3px;
  left: 3px;
  transition: transform 0.2s;
}

.toggle-track.on .toggle-knob {
  transform: translateX(18px);
}

/* Disable track animations for reduced motion users */
@media (prefers-reduced-motion: reduce) {
  [data-track-listing-target="track"],
  [data-track-listing-target="sideSelector"],
  [data-track-listing-target="trackList"] {
    transition: none !important;
  }

  [data-track-listing-target="track"].loading {
    animation: none !important;
  }

  @keyframes trackFadeIn {
    from, to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  @keyframes shimmer {
    from, to {
      background-position: 0% 0;
    }
  }
}
