/* SonoPlay Website Styles */
/* Audio Purple + Clean Minimal Theme */

/* ==========================================================================
   1. CSS Variables
   ========================================================================== */

:root {
  /* Background colors */
  --bg-primary: #141420;
  --bg-secondary: #1c1c2e;
  --bg-card: #252538;
  --bg-card-hover: #2d2d48;

  /* Accent colors */
  --accent: #9d7cd8;
  --accent-hover: #b392f0;
  --accent-glow: rgba(157, 124, 216, 0.25);

  /* Text colors */
  --text-primary: #f0f0f5;
  --text-secondary: #a0a0b8;
  --text-muted: #6b6b80;

  /* UI colors */
  --border: #3a3a52;
  --code-bg: #0d0d14;

  /* Effects */
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  --shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.4);
  --transition: 0.3s ease;

  /* Typography */
  --font-main: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', Consolas, monospace;
}

/* ==========================================================================
   2. CSS Reset
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

/* ==========================================================================
   3. Body Styles
   ========================================================================== */

body {
  font-family: var(--font-main);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

/* ==========================================================================
   4. Container & Layout
   ========================================================================== */

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

section {
  padding: 80px 0;
}

/* ==========================================================================
   5. Typography
   ========================================================================== */

h1,
h2,
h3 {
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
}

h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  margin-bottom: 1rem;
}

h2 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  margin-bottom: 2rem;
  text-align: center;
}

h3 {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
}

p {
  margin-bottom: 1rem;
  color: var(--text-secondary);
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--accent-hover);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ==========================================================================
   6. Button Styles
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 500;
  transition: all var(--transition);
  cursor: pointer;
  border: none;
  text-decoration: none;
}

.btn-primary {
  background-color: var(--accent);
  color: var(--bg-primary);
}

.btn-primary:hover {
  background-color: var(--accent-hover);
  color: var(--bg-primary);
  box-shadow: 0 0 20px var(--accent-glow);
}

.btn-secondary {
  background-color: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ==========================================================================
   7. Placeholder Styles (for images)
   ========================================================================== */

.placeholder {
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--bg-card);
  border: 2px dashed var(--border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.placeholder::after {
  content: attr(data-label);
}

/* ========================================
   Navigation
   ======================================== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(20, 20, 32, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: 1px;
}

.logo:hover {
  color: var(--accent);
}

.logo-icon {
  font-size: 1.5rem;
}

.nav-links {
  display: flex;
  gap: 32px;
  list-style: none;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition);
}

.nav-links a:hover {
  color: var(--accent);
}

.nav-github {
  color: var(--text-secondary);
  transition: color var(--transition);
}

.nav-github:hover {
  color: var(--accent);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  transition: var(--transition);
}

/* Mobile Navigation */
@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .nav-links {
    position: absolute;
    top: 70px;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--bg-primary);
    padding: 20px;
    gap: 16px;
    border-bottom: 1px solid var(--border);
    display: none;
  }

  .nav-links.active {
    display: flex;
  }

  .nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }

  .nav-toggle.active span:nth-child(2) {
    opacity: 0;
  }

  .nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }
}

/* ========================================
   Hero Section
   ======================================== */
.hero {
  padding-top: 120px;
  padding-bottom: 80px;
  text-align: center;
  min-height: 100vh;
  display: flex;
  align-items: center;
}

.hero .container {
  width: 100%;
}

.hero-slider {
  max-width: 560px;
  margin: 0 auto 1.5rem;
  position: relative;
}

.slides-container {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.hero-slide {
  display: none;
}

.hero-slide.active {
  display: block;
}

.hero-slide img,
.hero-slide .placeholder {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 12px;
}

.slider-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: none;
  background: var(--border);
  cursor: pointer;
  transition: var(--transition);
}

.dot:hover,
.dot.active {
  background: var(--accent);
}

.hero h1 {
  max-width: 700px;
  margin: 0 auto 1rem;
}

.hero-subtitle {
  color: var(--text-secondary);
  font-size: 1.25rem;
  max-width: 600px;
  margin: 0 auto 2rem;
}

.hero-cta {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .hero {
    padding-top: 100px;
    min-height: auto;
  }

  .hero-subtitle {
    font-size: 1.1rem;
  }
}

/* ========================================
   Compatible Devices
   ======================================== */
.devices {
  background: var(--bg-secondary);
  padding: 60px 0;
  text-align: center;
}

.devices-title {
  color: var(--text-muted);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 2rem;
}

.devices-logos {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 32px;
  margin-bottom: 1.5rem;
}

.device-logo {
  color: var(--text-muted);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 1px;
  transition: color var(--transition);
  cursor: default;
}

.device-logo:hover {
  color: var(--accent);
}

.device-logo svg {
  width: 24px;
  height: 24px;
}

.devices-tagline {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

@media (max-width: 768px) {
  .devices-logos {
    gap: 24px;
  }

  .device-logo {
    font-size: 0.85rem;
  }
}

/* ========================================
   Why SonoPlay
   ======================================== */
.why {
  padding: 80px 0;
}

.why-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  max-width: 1000px;
  margin: 0 auto;
}

.why-card {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 32px;
  border: 1px solid var(--border);
}

.why-card h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.why-card p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
  line-height: 1.7;
}

.why-card p:last-child {
  margin-bottom: 0;
}

.why-quote {
  font-style: italic;
  color: var(--text-muted);
  border-left: 3px solid var(--border);
  padding-left: 16px;
  font-size: 0.95rem;
}

.why-flow {
  background: var(--code-bg);
  border-radius: 8px;
  padding: 16px;
  text-align: center;
  margin: 1rem 0;
}

.why-flow code {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 1.1rem;
}

.why-problem {
  border-color: rgba(239, 68, 68, 0.3);
}

.why-solution {
  border-color: rgba(157, 124, 216, 0.5);
}

@media (max-width: 768px) {
  .why-grid {
    grid-template-columns: 1fr;
  }
}

/* ========================================
   Features
   ======================================== */
.features {
  background: var(--bg-secondary);
  padding: 80px 0;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
  max-width: 1000px;
  margin: 0 auto;
}

.feature-card {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 24px;
  border: 1px solid var(--border);
  transition: var(--transition);
}

.feature-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 20px var(--accent-glow);
  transform: translateY(-4px);
}

.feature-img {
  margin-bottom: 16px;
  border-radius: 8px;
  overflow: hidden;
}

.feature-img img,
.feature-img .placeholder {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
}

.feature-card h3 {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.feature-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
  margin: 0;
}

@media (max-width: 768px) {
  .features-grid {
    grid-template-columns: 1fr;
  }
}

/* ========================================
   Gallery
   ======================================== */
.gallery {
  padding: 80px 0;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 1rem;
}

.gallery-item {
  cursor: pointer;
  border-radius: 8px;
  overflow: hidden;
  transition: var(--transition);
  border: 1px solid var(--border);
}

.gallery-item:hover {
  transform: scale(1.02);
  border-color: var(--accent);
}

.gallery-item img,
.gallery-item .placeholder {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
}

.gallery-hint {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

@media (max-width: 1024px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .gallery-grid {
    grid-template-columns: 1fr;
  }
}

/* ========================================
   Lightbox
   ======================================== */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 20px;
}

.lightbox.active {
  display: flex;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 2.5rem;
  cursor: pointer;
  transition: color var(--transition);
  line-height: 1;
}

.lightbox-close:hover {
  color: var(--accent);
}

.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 2rem;
  cursor: pointer;
  padding: 20px;
  transition: color var(--transition);
}

.lightbox-prev {
  left: 20px;
}

.lightbox-next {
  right: 20px;
}

.lightbox-prev:hover,
.lightbox-next:hover {
  color: var(--accent);
}

.lightbox-content {
  max-width: 90vw;
  max-height: 80vh;
}

.lightbox-image {
  max-width: 100%;
  max-height: 80vh;
  width: auto;
  border-radius: 8px;
  object-fit: contain;
}

.lightbox-caption {
  color: var(--text-secondary);
  margin-top: 1rem;
  font-size: 1rem;
}

/* ========================================
   Install
   ======================================== */
.install {
  background: var(--bg-secondary);
  padding: 80px 0;
  text-align: center;
}

.install-tabs {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.tab-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.95rem;
  transition: var(--transition);
}

.tab-btn:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}

.tab-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg-primary);
}

.tab-content {
  display: none;
  max-width: 700px;
  margin: 0 auto 24px;
  position: relative;
}

.tab-content.active {
  display: block;
}

.tab-content pre {
  background: var(--code-bg);
  border-radius: 8px;
  padding: 24px;
  text-align: left;
  overflow-x: auto;
  border: 1px solid var(--border);
}

.tab-content code {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-primary);
  line-height: 1.6;
}

.copy-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: var(--transition);
}

.copy-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.copy-btn.copied {
  border-color: #22c55e;
  color: #22c55e;
}

.unraid-content {
  background: var(--bg-card);
  border-radius: 8px;
  padding: 40px;
  border: 1px solid var(--border);
}

.unraid-content p {
  color: var(--text-secondary);
  margin: 0.5rem 0;
}

.install-requirements {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

/* ========================================
   Support
   ======================================== */
.support {
  padding: 80px 0;
  text-align: center;
}

.support-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  max-width: 600px;
  margin: 0 auto;
}

.support-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px 24px;
  text-decoration: none;
  transition: var(--transition);
}

.support-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 0 20px var(--accent-glow);
}

.support-icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 1rem;
}

.support-card h3 {
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.support-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin: 0;
}

@media (max-width: 640px) {
  .support-grid {
    grid-template-columns: 1fr;
  }
}

/* ========================================
   Footer
   ======================================== */
.footer {
  background: var(--bg-secondary);
  padding: 40px 0;
  text-align: center;
  border-top: 1px solid var(--border);
}

.footer p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 0.9rem;
  transition: color var(--transition);
}

.footer-links a:hover {
  color: var(--accent);
}

.footer-links span {
  color: var(--border);
}
