/* ALEX Synthwave Theme - Shared CSS */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
  /* Synthwave Dark Theme */
  --background: oklch(0.12 0.02 290);
  --foreground: oklch(0.95 0.02 290);
  --card: oklch(0.15 0.03 290);
  --card-foreground: oklch(0.95 0.02 290);
  --border: oklch(0.3 0.08 290);
  --input: oklch(0.2 0.04 290);
  --muted: oklch(0.2 0.04 290);
  --muted-foreground: oklch(0.65 0.1 290);
  --neon-pink: oklch(0.75 0.25 330);
  --neon-cyan: oklch(0.7 0.2 195);
  --sunset-orange: oklch(0.75 0.2 50);
  --grid-purple: oklch(0.4 0.15 290);
  --destructive: oklch(0.577 0.245 27.325);

  /* Hex fallbacks for older browsers */
  --bg-hex: #16111f;
  --card-hex: #1d1529;
  --border-hex: #3d2d5c;
  --fg-hex: #f0edf5;
  --muted-fg-hex: #9585b5;
  --pink-hex: #e840a0;
  --cyan-hex: #00c8d4;
  --orange-hex: #d48030;
}

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

body {
  font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--background);
  color: var(--foreground);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

code, pre, .font-mono {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
}

a {
  color: inherit;
  text-decoration: none;
}

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

/* Typography */
h1, h2, h3, h4, h5, h6 {
  line-height: 1.2;
  font-weight: 700;
}

/* Utility Classes */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.text-neon-pink { color: var(--neon-pink); }
.text-neon-cyan { color: var(--neon-cyan); }
.text-sunset-orange { color: var(--sunset-orange); }
.text-foreground { color: var(--foreground); }
.text-muted { color: var(--muted-foreground); }
.text-destructive { color: var(--destructive); }

.bg-card { background: var(--card); }
.bg-background { background: var(--background); }

/* Neon Glow Effects */
.neon-glow-pink {
  text-shadow:
    0 0 5px oklch(0.75 0.25 330),
    0 0 10px oklch(0.75 0.25 330),
    0 0 20px oklch(0.75 0.25 330),
    0 0 40px oklch(0.75 0.25 330);
}

.neon-glow-cyan {
  text-shadow:
    0 0 5px oklch(0.7 0.2 195),
    0 0 10px oklch(0.7 0.2 195),
    0 0 20px oklch(0.7 0.2 195),
    0 0 40px oklch(0.7 0.2 195);
}

.neon-glow-orange {
  text-shadow:
    0 0 5px oklch(0.75 0.2 50),
    0 0 10px oklch(0.75 0.2 50),
    0 0 20px oklch(0.75 0.2 50);
}

.neon-box-pink {
  box-shadow:
    0 0 5px oklch(0.75 0.25 330),
    0 0 10px oklch(0.75 0.25 330),
    0 0 20px oklch(0.75 0.25 330);
}

.neon-box-cyan {
  box-shadow:
    0 0 5px oklch(0.7 0.2 195),
    0 0 10px oklch(0.7 0.2 195),
    0 0 20px oklch(0.7 0.2 195);
}

/* Animations */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes pulseGlow {
  0%, 100% {
    text-shadow: 0 0 5px currentColor, 0 0 10px currentColor;
  }
  50% {
    text-shadow: 0 0 10px currentColor, 0 0 20px currentColor, 0 0 30px currentColor;
  }
}

@keyframes pulsePinkGlow {
  0%, 100% {
    box-shadow: 0 0 5px oklch(0.75 0.25 330), 0 0 10px oklch(0.75 0.25 330), 0 0 20px oklch(0.75 0.25 330);
  }
  50% {
    box-shadow: 0 0 10px oklch(0.75 0.25 330), 0 0 25px oklch(0.75 0.25 330), 0 0 40px oklch(0.75 0.25 330);
  }
}

@keyframes gridScroll {
  0% { transform: perspective(500px) rotateX(60deg) translateY(0); }
  100% { transform: perspective(500px) rotateX(60deg) translateY(50px); }
}

.animate-fade-in-up {
  animation: fadeInUp 0.6s ease-out forwards;
}

.animate-fade-in {
  animation: fadeIn 0.5s ease-out forwards;
}

.animate-pulse-glow {
  animation: pulseGlow 2s ease-in-out infinite;
}

/* Delay utilities */
.delay-100 { animation-delay: 0.1s; opacity: 0; }
.delay-200 { animation-delay: 0.2s; opacity: 0; }
.delay-300 { animation-delay: 0.3s; opacity: 0; }
.delay-400 { animation-delay: 0.4s; opacity: 0; }
.delay-500 { animation-delay: 0.5s; opacity: 0; }
.delay-600 { animation-delay: 0.6s; opacity: 0; }

/* Card Styles */
.theme-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.5rem;
  transition: border-color 0.3s, background 0.3s;
}

.theme-card:hover {
  border-color: oklch(0.5 0.15 290);
}

.theme-card-pink:hover { border-color: oklch(0.6 0.2 330); }
.theme-card-cyan:hover { border-color: oklch(0.55 0.15 195); }
.theme-card-orange:hover { border-color: oklch(0.6 0.15 50); }

/* Badge Styles */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-family: 'JetBrains Mono', monospace;
  border: 1px solid;
}

.badge-pink {
  background: oklch(0.75 0.25 330 / 0.1);
  border-color: oklch(0.75 0.25 330 / 0.3);
  color: var(--neon-pink);
}

.badge-cyan {
  background: oklch(0.7 0.2 195 / 0.1);
  border-color: oklch(0.7 0.2 195 / 0.3);
  color: var(--neon-cyan);
}

.badge-orange {
  background: oklch(0.75 0.2 50 / 0.1);
  border-color: oklch(0.75 0.2 50 / 0.3);
  color: var(--sunset-orange);
}

/* Button Styles */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 9999px;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.3s;
  border: none;
  text-decoration: none;
}

.btn-pink {
  background: var(--neon-pink);
  color: var(--background);
  animation: pulsePinkGlow 2s ease-in-out infinite;
}

.btn-pink:hover {
  transform: scale(1.05);
}

.btn-cyan-outline {
  background: transparent;
  border: 1px solid var(--neon-cyan);
  color: var(--neon-cyan);
}

.btn-cyan-outline:hover {
  background: oklch(0.7 0.2 195 / 0.1);
}

.btn-orange {
  background: var(--sunset-orange);
  color: var(--background);
}

.btn-orange:hover {
  opacity: 0.9;
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted-foreground);
}

.btn-ghost:hover {
  color: var(--foreground);
  border-color: oklch(0.5 0.1 290);
}

/* Icon Box */
.icon-box {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.5rem;
  border: 1px solid;
  flex-shrink: 0;
}

.icon-box-lg {
  width: 3rem;
  height: 3rem;
  border-radius: 0.75rem;
}

.icon-box-pink {
  background: oklch(0.75 0.25 330 / 0.1);
  border-color: oklch(0.75 0.25 330 / 0.3);
  color: var(--neon-pink);
}

.icon-box-cyan {
  background: oklch(0.7 0.2 195 / 0.1);
  border-color: oklch(0.7 0.2 195 / 0.3);
  color: var(--neon-cyan);
}

.icon-box-orange {
  background: oklch(0.75 0.2 50 / 0.1);
  border-color: oklch(0.75 0.2 50 / 0.3);
  color: var(--sunset-orange);
}

/* Grid Floor Background */
.grid-floor {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50%;
  background-image:
    linear-gradient(to right, oklch(0.75 0.25 330 / 0.3) 1px, transparent 1px),
    linear-gradient(to top, oklch(0.75 0.25 330 / 0.3) 1px, transparent 1px);
  background-size: 40px 40px;
  transform: perspective(500px) rotateX(60deg);
  mask-image: linear-gradient(to top, white 50%, transparent 100%);
  -webkit-mask-image: linear-gradient(to top, white 50%, transparent 100%);
}

/* Grid Pattern Background */
.grid-pattern {
  background-image:
    linear-gradient(to right, oklch(0.75 0.25 330 / 0.1) 1px, transparent 1px),
    linear-gradient(to bottom, oklch(0.75 0.25 330 / 0.1) 1px, transparent 1px);
  background-size: 40px 40px;
}

/* Section spacing */
.section {
  padding: 4rem 1rem;
}

.section-lg {
  padding: 6rem 1rem;
}

/* Table styles */
.theme-table {
  width: 100%;
  border-collapse: collapse;
}

.theme-table th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.875rem;
  color: var(--muted-foreground);
  background: var(--card);
  border-bottom: 1px solid var(--border);
}

.theme-table td {
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  border-bottom: 1px solid var(--border);
}

.theme-table tr:last-child td {
  border-bottom: none;
}

.theme-table tr:nth-child(even) {
  background: oklch(0.13 0.02 290);
}

/* Pill / Tag */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  border-radius: 9999px;
  background: var(--card);
  border: 1px solid var(--border);
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

/* Responsive grid */
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
.grid-4 { display: grid; grid-template-columns: 1fr; gap: 1rem; }

@media (min-width: 640px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
}

/* Prose / Article styles */
.prose { max-width: none; }
.prose h2 { font-size: 1.5rem; color: var(--foreground); margin-top: 3rem; margin-bottom: 1rem; }
.prose h3 { font-size: 1.25rem; color: var(--foreground); margin-top: 2rem; margin-bottom: 0.75rem; }
.prose p { color: var(--muted-foreground); line-height: 1.75; margin-bottom: 1rem; }
.prose strong { color: var(--foreground); }
.prose ul, .prose ol { color: var(--muted-foreground); padding-left: 1.5rem; margin-bottom: 1rem; }
.prose li { margin-bottom: 0.5rem; }
.prose hr { border: none; border-top: 1px solid var(--border); margin: 2rem 0; }
.prose table { width: 100%; font-size: 0.875rem; margin-bottom: 1rem; }
.prose th { text-align: left; padding: 0.75rem; color: var(--muted-foreground); font-weight: 500; border-bottom: 1px solid var(--border); }
.prose td { padding: 0.75rem; border-bottom: 1px solid oklch(0.2 0.03 290); }
.prose .text-green { color: oklch(0.7 0.2 145); }
.prose .text-red { color: oklch(0.65 0.2 25); }
.prose .text-yellow { color: oklch(0.75 0.15 85); }

/* Accordion styles for FAQ */
.accordion-item { border-bottom: 1px solid var(--border); }
.accordion-item:last-child { border-bottom: none; }

.accordion-trigger {
  width: 100%;
  padding: 1.25rem 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  text-align: left;
  background: none;
  border: none;
  color: var(--foreground);
  cursor: pointer;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
  transition: color 0.2s;
}

.accordion-trigger:hover { color: var(--muted-foreground); }

.accordion-trigger svg {
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
  margin-top: 0.25rem;
  color: var(--muted-foreground);
  transition: transform 0.2s;
}

.accordion-item.open .accordion-trigger svg {
  transform: rotate(180deg);
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
}

.accordion-item.open .accordion-content {
  max-height: 500px;
}

.accordion-content p {
  padding-bottom: 1.25rem;
  font-size: 0.875rem;
  color: var(--muted-foreground);
  line-height: 1.7;
}

/* Timeline */
.timeline {
  position: relative;
  padding-left: 2rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0.9375rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--neon-pink), var(--neon-cyan), var(--sunset-orange));
}

.timeline-dot {
  position: absolute;
  left: 0;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--background);
  border: 2px solid var(--neon-pink);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.timeline-dot-inner {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  background: var(--neon-pink);
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--background); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted-foreground); }

/* Audio player button */
.audio-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  transition: all 0.3s;
  color: var(--background);
}

.audio-btn.playing {
  background: var(--neon-pink);
  box-shadow: 0 0 20px oklch(0.75 0.25 330), 0 0 40px oklch(0.75 0.25 330 / 0.5);
}

.audio-btn:not(.playing) {
  background: var(--neon-cyan);
  box-shadow: 0 0 20px oklch(0.7 0.2 195), 0 0 40px oklch(0.7 0.2 195 / 0.5);
}

.audio-btn:disabled {
  background: var(--muted);
  color: var(--muted-foreground);
  cursor: not-allowed;
  box-shadow: none;
}

/* SVG icon sizing */
.icon-sm { width: 1rem; height: 1rem; }
.icon-md { width: 1.25rem; height: 1.25rem; }
.icon-lg { width: 1.5rem; height: 1.5rem; }

/* Page-level padding for nav */
.page-content {
  padding-top: 60px;
  min-height: 100vh;
}

/* Gradient overlays */
.gradient-pink-cyan {
  background: linear-gradient(135deg, oklch(0.75 0.25 330 / 0.1), var(--card), oklch(0.7 0.2 195 / 0.1));
}

.gradient-orange-pink {
  background: linear-gradient(135deg, oklch(0.75 0.2 50 / 0.1), var(--card), oklch(0.75 0.25 330 / 0.1));
}

.gradient-cyan-pink {
  background: linear-gradient(135deg, oklch(0.7 0.2 195 / 0.05), var(--card), oklch(0.75 0.25 330 / 0.05));
}

/* ===== MOBILE RESPONSIVE ===== */

/* Prevent horizontal overflow */
html, body {
  overflow-x: hidden;
}

/* Table horizontal scroll */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 0.75rem;
  border: 1px solid var(--border);
}

.table-wrap .theme-table {
  min-width: 500px;
}

/* Prose table scroll */
.prose-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 1rem;
}

.prose-table-wrap table {
  min-width: 400px;
}

/* Touch-friendly minimum button size */
.btn {
  min-height: 44px;
}

@media (max-width: 768px) {
  /* Reduce section spacing */
  .section { padding: 2.5rem 1rem; }
  .section-lg { padding: 3.5rem 1rem; }

  /* Smaller cards */
  .theme-card { padding: 1.25rem; }

  /* Smaller badges */
  .badge { font-size: 0.8rem; padding: 0.3rem 0.6rem; }

  /* Smaller pills */
  .pill { font-size: 0.8rem; padding: 0.3rem 0.6rem; }

  /* Prose mobile */
  .prose h2 { font-size: 1.25rem; margin-top: 2rem; }
  .prose h3 { font-size: 1.1rem; margin-top: 1.5rem; }
  .prose p { font-size: 0.9rem; }

  /* Accordion mobile */
  .accordion-trigger { font-size: 0.9rem; padding: 1rem 0; }
  .accordion-content p { font-size: 0.8rem; }

  /* Timeline mobile */
  .timeline { padding-left: 1.75rem; }
  .timeline-dot { width: 1.5rem; height: 1.5rem; }
  .timeline-dot-inner { width: 0.5rem; height: 0.5rem; }
  .timeline::before { left: 0.6875rem; }

  /* Page content - tighter nav offset */
  .page-content { padding-top: 52px; }
}

@media (max-width: 480px) {
  /* Even tighter spacing */
  .section { padding: 2rem 0.75rem; }
  .section-lg { padding: 2.5rem 0.75rem; }
  .container { padding: 0 0.75rem; }

  /* Stack buttons vertically on small screens */
  .btn { font-size: 0.8rem; padding: 0.65rem 1.25rem; }

  /* Grids always 1-col on small mobile */
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; gap: 0.75rem; }

  /* Smaller icon boxes */
  .icon-box { width: 2.25rem; height: 2.25rem; }
  .icon-box-lg { width: 2.5rem; height: 2.5rem; }
}
