/* YTM API - Professional SaaS Styles with YouTube/Retro Vibes */

/* CSS Variables */
:root {
  --yt-red: #FF0000;
  --yt-red-dark: #CC0000;
  --yt-red-light: #FF4444;
  --bg-dark: #0a0a0b;
  --bg-card: #111113;
  --bg-card-hover: #18181b;
  --text-primary: #fafafa;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --border: #27272a;
  --border-light: #3f3f46;
  --accent-cyan: #00d4ff;
  --accent-purple: #a855f7;
  --accent-green: #22c55e;
  --accent-yellow: #eab308;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -4px rgba(0, 0, 0, 0.4);
}

/* Reset */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Background Effects */
.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: -2;
}

.bg-glow {
  position: fixed;
  top: -50%;
  left: 50%;
  transform: translateX(-50%);
  width: 150%;
  height: 100%;
  background: radial-gradient(ellipse at center, rgba(255, 0, 0, 0.08) 0%, transparent 60%);
  pointer-events: none;
  z-index: -1;
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Navigation */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 16px 0;
  background: rgba(10, 10, 11, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text-primary);
}

.logo-icon {
  font-size: 24px;
  color: var(--yt-red);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.7;
  }
}

.logo-text {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.logo-accent {
  color: var(--yt-red);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--text-primary);
}

.nav-github {
  color: var(--text-secondary) !important;
  transition: color 0.2s;
}

.nav-github:hover {
  color: var(--text-primary) !important;
}

/* Hero Section */
.hero {
  padding: 160px 24px 100px;
  text-align: center;
  max-width: 900px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(255, 0, 0, 0.1);
  border: 1px solid rgba(255, 0, 0, 0.2);
  border-radius: 50px;
  font-size: 13px;
  font-weight: 500;
  color: var(--yt-red-light);
  margin-bottom: 24px;
}

.badge-dot {
  width: 6px;
  height: 6px;
  background: var(--accent-green);
  border-radius: 50%;
  animation: blink 2s ease-in-out infinite;
}

@keyframes blink {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.3;
  }
}

.hero-title {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -2px;
  margin-bottom: 20px;
}

.hero-title-accent {
  display: block;
  background: linear-gradient(135deg, var(--yt-red) 0%, var(--accent-purple) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-description {
  font-size: 18px;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 32px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-bottom: 48px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--yt-red);
  color: white;
  box-shadow: 0 0 20px rgba(255, 0, 0, 0.3);
}

.btn-primary:hover {
  background: var(--yt-red-light);
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(255, 0, 0, 0.4);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-light);
}

.btn-arrow {
  transition: transform 0.2s;
}

.btn:hover .btn-arrow {
  transform: translateX(4px);
}

/* Hero Code Block */
.hero-code {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  text-align: left;
  max-width: 600px;
  margin: 0 auto;
  box-shadow: var(--shadow-lg);
}

.code-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--border);
}

.code-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.code-dot.red {
  background: #ff5f56;
}

.code-dot.yellow {
  background: #ffbd2e;
}

.code-dot.green {
  background: #27ca40;
}

.code-title {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.code-block {
  padding: 20px;
  margin: 0;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.7;
  overflow-x: auto;
}

.code-comment {
  color: var(--text-muted);
}

/* Sections */
.section {
  padding: 100px 0;
}

.section-title {
  font-size: 2.5rem;
  font-weight: 800;
  text-align: center;
  margin-bottom: 16px;
  letter-spacing: -1px;
}

.section-subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: 18px;
  margin-bottom: 48px;
}

/* Features Grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-top: 48px;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  transition: all 0.3s;
}

.feature-card:hover {
  border-color: var(--yt-red);
  transform: translateY(-4px);
  box-shadow: 0 0 30px rgba(255, 0, 0, 0.1);
}

.feature-icon {
  font-size: 32px;
  margin-bottom: 16px;
}

.feature-card h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}

.feature-card p {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
}

/* Endpoints Section */
.endpoints {
  background: linear-gradient(180deg, transparent 0%, rgba(255, 0, 0, 0.02) 100%);
}

.endpoint-group {
  margin-bottom: 48px;
}

.endpoint-group-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 24px;
  color: var(--text-primary);
}

.endpoint-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
}

.endpoint-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.method {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-mono);
}

.method.get {
  background: rgba(34, 197, 94, 0.15);
  color: var(--accent-green);
}

.endpoint-path {
  font-family: var(--font-mono);
  font-size: 16px;
  color: var(--text-primary);
}

.endpoint-desc {
  color: var(--text-secondary);
  margin-bottom: 24px;
}

/* Params Table */
.params-table {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 24px;
}

.param-row {
  display: grid;
  grid-template-columns: 120px 150px 1fr;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.param-row:last-child {
  border-bottom: none;
}

.param-row.header {
  background: rgba(255, 255, 255, 0.02);
  font-weight: 600;
  color: var(--text-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.param-row code {
  color: var(--accent-cyan);
  font-family: var(--font-mono);
}

/* Response Example */
.response-example {
  margin-top: 24px;
}

.response-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
}

.copy-btn {
  padding: 6px 12px;
  background: var(--bg-card-hover);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.copy-btn:hover {
  background: var(--border);
  color: var(--text-primary);
}

.response-code {
  background: #0d0d0f;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  overflow-x: auto;
  color: var(--text-secondary);
}

/* Quality Grid */
.quality-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 24px 0;
}

.quality-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 24px;
  background: var(--bg-card-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.quality-item.highlight {
  border-color: var(--yt-red);
  background: rgba(255, 0, 0, 0.05);
}

.quality-name {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--accent-cyan);
  margin-bottom: 4px;
}

.quality-size {
  font-size: 12px;
  color: var(--text-muted);
}

.example-urls {
  margin-top: 24px;
}

.example-urls p {
  margin-bottom: 12px;
  font-size: 14px;
}

.example-urls code {
  display: block;
  padding: 12px 16px;
  background: #0d0d0f;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  overflow-x: auto;
}

/* Playground */
.playground {
  background: linear-gradient(180deg, rgba(255, 0, 0, 0.02) 0%, transparent 100%);
}

.playground-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.playground-controls {
  display: flex;
  gap: 16px;
  padding: 24px;
  background: rgba(255, 255, 255, 0.01);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.control-group {
  flex: 1;
  min-width: 200px;
}

.control-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.control-group input,
.control-group select {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
  font-family: var(--font-sans);
}

.control-group input:focus,
.control-group select:focus {
  outline: none;
  border-color: var(--yt-red);
}

.playground-controls .btn {
  align-self: flex-end;
}

.playground-url {
  padding: 16px 24px;
  background: #0d0d0f;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  overflow-x: auto;
}

.url-label {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

.playground-url code {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent-cyan);
}

.playground-results {
  min-height: 300px;
}

.results-tabs {
  display: flex;
  gap: 4px;
  padding: 16px 24px;
  background: rgba(255, 255, 255, 0.01);
  border-bottom: 1px solid var(--border);
}

.tab-btn {
  padding: 8px 16px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s;
}

.tab-btn:hover {
  color: var(--text-secondary);
}

.tab-btn.active {
  background: var(--yt-red);
  color: white;
}

.results-panel {
  display: none;
  padding: 24px;
}

.results-panel.active {
  display: block;
}

.results-placeholder {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

#json-output {
  background: #0d0d0f;
  padding: 20px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 13px;
  overflow-x: auto;
  max-height: 400px;
  color: var(--text-secondary);
}

/* Results Grid */
.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
}

.result-card {
  background: var(--bg-card-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: all 0.2s;
}

.result-card:hover {
  border-color: var(--yt-red);
  transform: scale(1.02);
}

.result-thumb {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: var(--bg-dark);
}

.result-info {
  padding: 16px;
}

.result-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.result-artist {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.result-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
}

/* Docs Section */
.docs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.doc-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.doc-card h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.doc-code {
  background: #0d0d0f;
  padding: 16px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  overflow-x: auto;
  color: var(--text-secondary);
}

.type-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.type-item {
  padding: 12px 16px;
  background: var(--bg-card-hover);
  border-radius: var(--radius-sm);
}

.type-name {
  font-weight: 600;
  color: var(--yt-red);
  margin-bottom: 4px;
  display: block;
}

.type-fields {
  font-size: 13px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* Footer */
.footer {
  border-top: 1px solid var(--border);
  padding: 60px 0 40px;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  gap: 48px;
  margin-bottom: 48px;
  flex-wrap: wrap;
}

.footer-brand {
  max-width: 300px;
}

.footer-brand .logo-icon {
  font-size: 28px;
}

.footer-brand .logo-text {
  font-size: 24px;
}

.footer-tagline {
  color: var(--text-muted);
  font-size: 14px;
  margin-top: 12px;
}

.footer-links {
  display: flex;
  gap: 64px;
  flex-wrap: wrap;
}

.footer-col h4 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.footer-col a {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  margin-bottom: 12px;
  transition: color 0.2s;
}

.footer-col a:hover {
  color: var(--yt-red);
}

.footer-bottom {
  text-align: center;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.footer-bottom p {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.footer-bottom a {
  color: var(--yt-red);
  text-decoration: none;
}

.footer-retro {
  font-size: 12px;
  color: var(--text-muted);
  opacity: 0.6;
}

.retro-star {
  color: var(--accent-yellow);
  animation: blink 2s ease-in-out infinite;
}

/* Loading Spinner */
.loading-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--yt-red);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Responsive */
@media (max-width: 768px) {
  .nav-links a:not(.nav-github):not(.nav-support) {
    display: none;
  }

  .nav-support {
    display: block !important;
    font-size: 14px;
    font-weight: 700;
    margin-right: 12px;
  }



  .hero {
    padding: 140px 20px 60px;
  }

  .hero-title {
    font-size: 2rem;
    letter-spacing: -1px;
  }

  .hero-actions {
    flex-direction: column;
    align-items: center;
  }

  .features-grid {
    grid-template-columns: 1fr;
  }

  .param-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .param-row.header {
    display: none;
  }

  .footer-links {
    gap: 32px;
  }
}

/* Ko-fi Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
  animation: fadeIn 0.3s;
}

.modal-content {
  background-color: transparent;
  margin: 5% auto;
  padding: 0;
  width: 90%;
  max-width: 500px;
  position: relative;
  animation: slideUp 0.3s;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
}

.close-btn {
  color: #aaa;
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 28px;
  font-weight: bold;
  z-index: 1001;
  cursor: pointer;
  transition: color 0.2s;
  background: rgba(0, 0, 0, 0.5);
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.close-btn:hover,
.close-btn:focus {
  color: white;
  background: var(--yt-red);
  text-decoration: none;
  cursor: pointer;
}

@keyframes fadeIn {
  from {
    opacity: 0
  }

  to {
    opacity: 1
  }
}

@keyframes slideUp {
  from {
    transform: translateY(50px);
    opacity: 0
  }

  to {
    transform: translateY(0);
    opacity: 1
  }
}