/* ==========================================================================
   OKF UNIFIED CATALOG EXPLORER - DESIGN SYSTEM & STYLESHEET
   ========================================================================== */

:root {
  /* Color Palette - Dark Glassmorphism & Cyberpunk Neon Accents */
  --bg-primary: #080912;
  --bg-secondary: #0f1120;
  --bg-card: rgba(18, 22, 38, 0.7);
  --bg-card-hover: rgba(26, 32, 56, 0.85);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-border-hover: rgba(0, 243, 255, 0.3);

  /* Category Neon Colors */
  --color-synth: #00f3ff;
  --color-synth-glow: rgba(0, 243, 255, 0.2);
  
  --color-dm: #ff0077;
  --color-dm-glow: rgba(255, 0, 119, 0.2);
  
  --color-vj: #00ff88;
  --color-vj-glow: rgba(0, 255, 136, 0.2);
  
  --color-gold: #ffb700;
  
  /* Text & Utility */
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  /* Fonts */
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Space Grotesk', system-ui, sans-serif;

  /* Shadows & Radius */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-glow: 0 0 25px rgba(0, 243, 255, 0.15);
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-main);
  line-height: 1.6;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  background: radial-gradient(circle at 15% 15%, rgba(0, 243, 255, 0.05) 0%, transparent 40%),
              radial-gradient(circle at 85% 50%, rgba(255, 0, 119, 0.04) 0%, transparent 40%),
              radial-gradient(circle at 50% 85%, rgba(0, 255, 136, 0.04) 0%, transparent 40%),
              var(--bg-primary);
}

.container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header & Hero */
.app-header {
  padding: 40px 0 24px;
  border-bottom: 1px solid var(--glass-border);
  background: linear-gradient(180deg, rgba(15, 17, 32, 0.8) 0%, transparent 100%);
  backdrop-filter: blur(12px);
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 16px;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(0, 243, 255, 0.08);
  border: 1px solid rgba(0, 243, 255, 0.2);
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--color-synth);
  text-transform: uppercase;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background-color: var(--color-synth);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--color-synth);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.hero-title {
  font-family: var(--font-display);
  font-size: 2.8rem;
  font-weight: 700;
  letter-spacing: -1px;
  line-height: 1.15;
  margin-bottom: 12px;
}

.highlight-cyan { color: var(--color-synth); text-shadow: 0 0 15px var(--color-synth-glow); }
.highlight-magenta { color: var(--color-dm); text-shadow: 0 0 15px var(--color-dm-glow); }
.highlight-green { color: var(--color-vj); text-shadow: 0 0 15px var(--color-vj-glow); }

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 850px;
  margin-bottom: 30px;
}

/* Stats Counter Bar */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  padding: 16px 20px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 16px;
  backdrop-filter: blur(10px);
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.2);
}

.stat-icon {
  font-size: 1.8rem;
}

.stat-number {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1;
}

.stat-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Category Selector & Search Controls */
.controls-section {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(8, 9, 18, 0.92);
  backdrop-filter: blur(16px);
  padding: 20px 0;
  border-bottom: 1px solid var(--glass-border);
}

.controls-wrapper {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.category-tabs {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.cat-btn {
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all var(--transition-fast);
}

.cat-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
}

.cat-btn.active[data-cat="all"] {
  background: rgba(255, 255, 255, 0.15);
  border-color: #ffffff;
  color: #ffffff;
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.1);
}

.cat-btn.active[data-cat="synthesizers"] {
  background: rgba(0, 243, 255, 0.15);
  border-color: var(--color-synth);
  color: var(--color-synth);
  box-shadow: 0 0 15px var(--color-synth-glow);
}

.cat-btn.active[data-cat="dance-music"] {
  background: rgba(255, 0, 119, 0.15);
  border-color: var(--color-dm);
  color: var(--color-dm);
  box-shadow: 0 0 15px var(--color-dm-glow);
}

.cat-btn.active[data-cat="vjing-visual-art"] {
  background: rgba(0, 255, 136, 0.15);
  border-color: var(--color-vj);
  color: var(--color-vj);
  box-shadow: 0 0 15px var(--color-vj-glow);
}

.search-and-sections {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 280px;
}

.search-box input {
  width: 100%;
  padding: 12px 18px 12px 44px;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 0.95rem;
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.search-box input:focus {
  border-color: var(--color-synth);
  box-shadow: 0 0 15px var(--color-synth-glow);
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.section-pills {
  display: flex;
  gap: 8px;
  background: rgba(0, 0, 0, 0.3);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
}

.sec-pill {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.sec-pill:hover {
  color: var(--text-main);
}

.sec-pill.active {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-main);
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

/* Grid & Cards */
.catalog-content {
  padding: 40px 0 80px;
}

.section-header {
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.section-header h2 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
}

.results-count {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  backdrop-filter: blur(12px);
  transition: all var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: transparent;
  transition: background var(--transition-fast);
}

.card[data-cat="synthesizers"]::before { background: var(--color-synth); }
.card[data-cat="dance-music"]::before { background: var(--color-dm); }
.card[data-cat="vjing-visual-art"]::before { background: var(--color-vj); }

.card:hover {
  transform: translateY(-4px);
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
  gap: 12px;
}

.card-badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 4px 10px;
  border-radius: 12px;
}

.card-badge.cat-synth { background: rgba(0, 243, 255, 0.12); color: var(--color-synth); border: 1px solid rgba(0, 243, 255, 0.3); }
.card-badge.cat-dm { background: rgba(255, 0, 119, 0.12); color: var(--color-dm); border: 1px solid rgba(255, 0, 119, 0.3); }
.card-badge.cat-vj { background: rgba(0, 255, 136, 0.12); color: var(--color-vj); border: 1px solid rgba(0, 255, 136, 0.3); }

.card-period {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-dim);
}

.card-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 10px;
  line-height: 1.3;
}

.card-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 18px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
}

.tag-item {
  font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 3px 8px;
  border-radius: 4px;
  color: var(--text-muted);
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 14px;
  border-top: 1px solid var(--glass-border);
}

.btn-open-detail {
  background: transparent;
  border: none;
  color: var(--color-synth);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: gap var(--transition-fast);
}

.btn-open-detail:hover {
  gap: 10px;
  text-decoration: underline;
}

/* Modal View */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 5, 12, 0.85);
  backdrop-filter: blur(12px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-smooth);
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-window {
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border-hover);
  border-radius: var(--radius-lg);
  max-width: 800px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
  transform: scale(0.95);
  transition: transform var(--transition-smooth);
  position: relative;
}

.modal-backdrop.active .modal-window {
  transform: scale(1);
}

.modal-header {
  padding: 24px 30px;
  border-bottom: 1px solid var(--glass-border);
  position: relative;
}

.btn-close-modal {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: var(--text-main);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast);
}

.btn-close-modal:hover {
  background: rgba(255, 0, 119, 0.3);
}

.modal-body {
  padding: 30px;
  font-size: 0.98rem;
  line-height: 1.7;
}

.modal-body h1, .modal-body h2, .modal-body h3 {
  font-family: var(--font-display);
  margin-top: 20px;
  margin-bottom: 12px;
  color: var(--text-main);
}

.modal-body p {
  margin-bottom: 16px;
  color: var(--text-muted);
}

.modal-body ul {
  margin-bottom: 20px;
  padding-left: 20px;
  color: var(--text-muted);
}

.modal-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  background: rgba(0, 0, 0, 0.25);
  padding: 16px 20px;
  border-radius: var(--radius-md);
  margin-bottom: 24px;
  border: 1px solid var(--glass-border);
}

.meta-item-label {
  font-size: 0.75rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.meta-item-val {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
}

/* Footer */
.app-footer {
  border-top: 1px solid var(--glass-border);
  padding: 40px 0;
  background: rgba(8, 9, 18, 0.6);
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 16px;
}

.footer-links a {
  color: var(--color-synth);
  text-decoration: none;
  font-weight: 500;
}

.footer-links a:hover {
  text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
  .hero-title { font-size: 2rem; }
  .cards-grid { grid-template-columns: 1fr; }
  .search-and-sections { flex-direction: column; align-items: stretch; }
  .section-pills { overflow-x: auto; width: 100%; }
}

/* TTS Audio Player Styles */
.tts-player-panel {
  background: linear-gradient(135deg, rgba(157, 78, 221, 0.15), rgba(0, 243, 255, 0.08));
  border: 1px solid rgba(157, 78, 221, 0.35);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 20px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.tts-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 10px;
}

.tts-title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: #e9d5ff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tts-equalizer {
  display: inline-flex;
  align-items: flex-end;
  gap: 3px;
  height: 16px;
}

.tts-eq-bar {
  width: 3px;
  background: var(--color-dm);
  border-radius: 2px;
  height: 4px;
  transition: height 0.15s ease;
}

.tts-equalizer.playing .tts-eq-bar {
  animation: eqBounce 0.6s ease-in-out infinite alternate;
}

.tts-equalizer.playing .tts-eq-bar:nth-child(1) { animation-delay: 0.0s; background: var(--color-synth); }
.tts-equalizer.playing .tts-eq-bar:nth-child(2) { animation-delay: 0.2s; background: var(--color-dm); }
.tts-equalizer.playing .tts-eq-bar:nth-child(3) { animation-delay: 0.4s; background: var(--color-vj); }
.tts-equalizer.playing .tts-eq-bar:nth-child(4) { animation-delay: 0.1s; background: var(--color-gold); }

@keyframes eqBounce {
  0% { height: 4px; }
  100% { height: 16px; }
}

.tts-controls-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.tts-btn {
  background: linear-gradient(135deg, #9d4edd, #ff0077);
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition-fast);
}

.tts-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(157, 78, 221, 0.4);
}

.tts-btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  border: 1px solid var(--glass-border);
}

.tts-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.2);
  box-shadow: none;
}

.tts-select {
  background: rgba(0, 0, 0, 0.6);
  color: var(--text-main);
  border: 1px solid var(--glass-border);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  outline: none;
  max-width: 260px;
}

.tts-rate-select {
  background: rgba(0, 0, 0, 0.6);
  color: var(--text-main);
  border: 1px solid var(--glass-border);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  outline: none;
}

.tts-reading-highlight {
  background: rgba(157, 78, 221, 0.25) !important;
  border-left: 4px solid var(--neon-magenta) !important;
  padding-left: 14px !important;
  transition: all 0.3s ease;
}
