/* ============================================================
   RADIOTV PROMPTS — style.css
   Dark-first, Glassmorphism design
   Fonts: Manrope + DM Sans
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@300;400;500;600;700;800;900&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&display=swap');

/* ── CSS Variables ─────────────────────────────────────────── */
:root {
  --red:           #FF0000;
  --red-dim:       rgba(255, 0, 0, 0.15);
  --red-glow:      rgba(255, 0, 0, 0.30);
  --blue:          #2563EB;
  --blue-dim:      rgba(37, 99, 235, 0.15);

  /* Dark Theme */
  --bg:            #0B0D17;
  --bg-mid:        #0F1220;
  --surface:       #141828;
  --surface-2:     #1a2035;
  --border:        rgba(255, 255, 255, 0.10);
  --border-bright: rgba(255, 255, 255, 0.18);
  --text-primary:  #FFFFFF;
  --text-secondary:#B0BAC9;
  --text-muted:    #8B95A5;
  --glass:         rgba(255, 255, 255, 0.06);
  --glass-hover:   rgba(255, 255, 255, 0.09);
  --prompt-bg:     #1a2035;
  --prompt-border: rgba(255, 255, 255, 0.12);
  --scrollbar-bg:  rgba(255,255,255,0.08);

  --font-heading:  'Manrope', sans-serif;
  --font-body:     'DM Sans', sans-serif;

  --radius-sm:     8px;
  --radius-md:     12px;
  --radius-lg:     16px;
  --radius-xl:     24px;

  --ease:          cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --t-fast:        0.15s var(--ease);
  --t-base:        0.3s var(--ease);
  --t-slow:        0.5s var(--ease);
}

/* ── Light Theme ───────────────────────────────────────────── */
[data-theme="light"] {
  --bg:            #FBFBFB;
  --bg-mid:        #F3F4F8;
  --surface:       #FFFFFF;
  --surface-2:     #F8F9FC;
  --border:        rgba(0, 0, 0, 0.08);
  --border-bright: rgba(0, 0, 0, 0.14);
  --text-primary:  #0B0D17;
  --text-secondary:#374151;
  --text-muted:    #6B7280;
  --glass:         rgba(0, 0, 0, 0.03);
  --glass-hover:   rgba(0, 0, 0, 0.05);
  --prompt-bg:     #FFFFFF;
  --prompt-border: #E5E7EB;
  --scrollbar-bg:  rgba(0,0,0,0.10);
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }

body {
  background-color: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background-color var(--t-base), color var(--t-base);
}

/* Noise overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
  opacity: 0.35;
}
[data-theme="light"] body::before { opacity: 0.12; }

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--scrollbar-bg); border-radius: 2px; }

/* ── Ambient Blobs ─────────────────────────────────────────── */
.ambient-layer {
  position: fixed; inset: 0;
  pointer-events: none; z-index: 0; overflow: hidden;
}
.blob {
  position: absolute; border-radius: 50%;
  filter: blur(100px); opacity: 0.18;
  animation: blobFloat 12s ease-in-out infinite alternate;
}
.blob-1 { width: 600px; height: 600px; background: var(--red); top: -200px; left: -100px; animation-delay: 0s; }
.blob-2 { width: 400px; height: 400px; background: var(--blue); bottom: 0; right: -100px; animation-delay: -4s; }
.blob-3 { width: 300px; height: 300px; background: var(--red); top: 50%; left: 50%; transform: translate(-50%,-50%); animation-delay: -8s; opacity: 0.08; }
[data-theme="light"] .blob { opacity: 0.08; }

@keyframes blobFloat {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(30px, -40px) scale(1.05); }
}

/* ── Typography ────────────────────────────────────────────── */
h1, h2, h3, h4, h5 {
  font-family: var(--font-heading);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

/* ── Wrapper ───────────────────────────────────────────────── */
.wrapper { max-width: 1280px; margin: 0 auto; padding: 0 24px; }
@media (max-width: 640px) { .wrapper { padding: 0 16px; } }

/* ═══════════════════════════════════════════════════════════
   HEADER
═══════════════════════════════════════════════════════════ */
.site-header {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 16px 40px;
  display: flex; align-items: center; justify-content: space-between;
  transition: all var(--t-slow);
}
.site-header.scrolled {
  background: rgba(11, 13, 23, 0.88);
  backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border);
  padding: 12px 40px;
}
[data-theme="light"] .site-header.scrolled { background: rgba(251, 251, 251, 0.88); }

.header-logo {
  display: flex; align-items: center; gap: 10px; text-decoration: none;
}

/* ── Logo Image ── */
.logo-img {
  width: 46px; height: 46px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--red);
  box-shadow: 0 0 16px var(--red-glow);
  flex-shrink: 0;
  transition: box-shadow var(--t-base);
}
.header-logo:hover .logo-img { box-shadow: 0 0 28px var(--red-glow); }

.logo-text {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  line-height: 1;
}
.logo-text span { color: var(--red); }

.header-actions { display: flex; align-items: center; gap: 12px; }

.theme-toggle {
  width: 42px; height: 42px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--glass);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  transition: all var(--t-base);
  backdrop-filter: blur(10px);
}
.theme-toggle:hover { border-color: var(--border-bright); color: var(--text-primary); background: var(--glass-hover); }

@media (max-width: 640px) {
  .site-header { padding: 14px 16px; }
  .site-header.scrolled { padding: 10px 16px; }
}

/* ═══════════════════════════════════════════════════════════
   HERO
═══════════════════════════════════════════════════════════ */
.hero {
  position: relative; z-index: 1;
  padding: 150px 0 72px;
  text-align: center;
}

.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px;
  border-radius: 100px;
  border: 1px solid var(--border);
  background: var(--glass);
  backdrop-filter: blur(10px);
  font-family: var(--font-heading);
  font-size: 12px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 28px;
  animation: fadeSlideUp 0.8s var(--ease) both;
}

.pulse-dot {
  width: 6px; height: 6px;
  border-radius: 50%; background: var(--red);
  box-shadow: 0 0 8px var(--red-glow);
  animation: pulseDot 2s ease-in-out infinite;
}

.hero-title {
  font-size: clamp(42px, 7vw, 88px);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 0.95;
  margin-bottom: 24px;
  animation: fadeSlideUp 0.8s var(--ease) 0.1s both;
}
.hero-title .accent {
  background: linear-gradient(135deg, var(--red) 0%, #ff6b35 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: clamp(15px, 2vw, 19px);
  color: var(--text-secondary);
  max-width: 580px; margin: 0 auto 40px;
  font-weight: 400; line-height: 1.65;
  animation: fadeSlideUp 0.8s var(--ease) 0.2s both;
}

.hero-stats {
  display: flex; align-items: center; justify-content: center;
  gap: 40px;
  animation: fadeSlideUp 0.8s var(--ease) 0.3s both;
}
.stat-item { text-align: center; }
.stat-number {
  font-family: var(--font-heading);
  font-size: 26px; font-weight: 800;
  color: var(--text-primary); letter-spacing: -0.04em; line-height: 1;
}
.stat-label { font-size: 12px; color: var(--text-muted); font-weight: 500; margin-top: 4px; }
.stat-divider { width: 1px; height: 36px; background: var(--border); }

@media (max-width: 640px) {
  .hero { padding: 120px 0 56px; }
  .hero-stats { gap: 20px; }
  .stat-number { font-size: 20px; }
}

/* ═══════════════════════════════════════════════════════════
   SEARCH
═══════════════════════════════════════════════════════════ */
.search-section {
  position: relative; z-index: 1;
  padding: 0 0 48px;
}

.search-bar-wrapper {
  position: relative;
  max-width: 560px; margin: 0 auto;
}

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

#searchInput {
  width: 100%;
  padding: 16px 18px 16px 50px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 15px;
  outline: none;
  transition: all var(--t-base);
  box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}
#searchInput::placeholder { color: var(--text-muted); }
#searchInput:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px var(--red-dim), 0 4px 20px rgba(0,0,0,0.1);
}

.search-clear {
  position: absolute; right: 14px; top: 50%;
  transform: translateY(-50%);
  width: 28px; height: 28px;
  border-radius: 6px; border: none;
  background: var(--glass); color: var(--text-muted);
  cursor: pointer; display: none;
  align-items: center; justify-content: center;
  font-size: 12px; transition: all var(--t-fast);
}
.search-clear.visible { display: flex; }
.search-clear:hover { background: var(--glass-hover); color: var(--text-primary); }

/* ═══════════════════════════════════════════════════════════
   RESULTS META
═══════════════════════════════════════════════════════════ */
.results-meta {
  position: relative; z-index: 1;
  display: flex; align-items: center;
  margin-bottom: 32px;
}
.results-count { font-size: 14px; color: var(--text-muted); font-weight: 500; }
.results-count strong { color: var(--text-primary); font-family: var(--font-heading); }

/* ═══════════════════════════════════════════════════════════
   PROMPTS GRID
═══════════════════════════════════════════════════════════ */
.prompts-section { position: relative; z-index: 1; padding-bottom: 100px; }

#promptsGrid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}
@media (min-width: 768px)  { #promptsGrid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { #promptsGrid { grid-template-columns: repeat(3, 1fr); } }

/* ═══════════════════════════════════════════════════════════
   PROMPT CARD
═══════════════════════════════════════════════════════════ */
.prompt-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: all var(--t-base);
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  cursor: pointer;
  animation: cardReveal 0.5s var(--ease) both;
}
.prompt-card:hover {
  border-color: var(--red);
  transform: translateY(-5px);
  box-shadow: 0 16px 48px rgba(255,0,0,0.12), 0 0 0 1px var(--red);
}

/* Card Image */
.card-image-wrapper {
  position: relative; height: 190px;
  overflow: hidden; flex-shrink: 0;
}
.card-image-wrapper img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.6s var(--ease);
}
.prompt-card:hover .card-image-wrapper img { transform: scale(1.06); }
.card-image-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0) 40%, rgba(0,0,0,0.65) 100%);
}

/* Card Body */
.card-body {
  padding: 22px;
  display: flex; flex-direction: column; gap: 14px;
  flex: 1;
}

.card-title {
  font-family: var(--font-heading);
  font-size: 19px; font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary); line-height: 1.25;
}

/* Card excerpt (first 2 lines of prompt) */
.card-excerpt {
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Tags */
.card-tags {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: auto;
}
.tag {
  padding: 4px 9px;
  border-radius: 6px;
  font-size: 11px; font-weight: 500;
  background: var(--glass);
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: all var(--t-fast);
}
.tag:hover { background: var(--glass-hover); color: var(--text-secondary); }

/* Read more hint */
.card-read-more {
  display: flex; align-items: center; gap: 6px;
  font-family: var(--font-heading);
  font-size: 13px; font-weight: 700;
  color: var(--red);
  margin-top: 6px;
  transition: gap var(--t-fast);
}
.prompt-card:hover .card-read-more { gap: 10px; }

/* ═══════════════════════════════════════════════════════════
   NO RESULTS
═══════════════════════════════════════════════════════════ */
#noResults {
  display: none; text-align: center;
  padding: 80px 24px; grid-column: 1 / -1;
}
#noResults.visible { display: block; }
.no-results-icon {
  width: 64px; height: 64px; border-radius: 16px;
  background: var(--glass); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; color: var(--text-muted);
  margin: 0 auto 20px;
}
.no-results-title { font-family: var(--font-heading); font-size: 20px; font-weight: 800; color: var(--text-primary); margin-bottom: 8px; }
.no-results-sub { font-size: 14px; color: var(--text-muted); }

/* ═══════════════════════════════════════════════════════════
   SKELETON LOADER
═══════════════════════════════════════════════════════════ */
.skeleton-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden; height: 380px;
}
.skeleton-block {
  background: linear-gradient(90deg, var(--glass) 25%, var(--glass-hover) 50%, var(--glass) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.6s ease-in-out infinite;
  border-radius: 6px;
}

/* ═══════════════════════════════════════════════════════════
   DETAIL PAGE
═══════════════════════════════════════════════════════════ */
#detailPage {
  display: none;
  position: fixed; inset: 0;
  background: var(--bg);
  z-index: 200;
  overflow-y: auto;
}
#detailPage.open { display: block; }

.detail-header {
  position: sticky; top: 0;
  background: rgba(11,13,23,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 14px 32px;
  display: flex; align-items: center; gap: 16px;
  z-index: 10;
}
[data-theme="light"] .detail-header { background: rgba(251,251,251,0.92); }

.detail-back {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 9px 18px;
  border-radius: 9px;
  cursor: pointer;
  font-family: var(--font-heading);
  font-size: 13px; font-weight: 700;
  transition: all var(--t-base);
  flex-shrink: 0;
}
.detail-back:hover { background: var(--red); border-color: var(--red); color: #fff; }

.detail-header-title {
  font-family: var(--font-heading);
  font-size: 16px; font-weight: 800;
  color: var(--text-primary);
  flex: 1;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.detail-body {
  max-width: 860px; margin: 0 auto;
  padding: 48px 32px 100px;
}

.detail-hero-img {
  width: 100%; max-height: 380px; object-fit: cover;
  border-radius: 16px; margin-bottom: 32px;
  border: 1px solid var(--border);
}

.detail-title {
  font-family: var(--font-heading);
  font-size: clamp(28px, 5vw, 44px);
  font-weight: 900; letter-spacing: -0.03em;
  color: var(--text-primary);
  margin-bottom: 28px; line-height: 1.1;
}

.detail-section-label {
  font-family: var(--font-heading);
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--red); margin-bottom: 12px;
}

/* Prompt box */
.detail-prompt-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 32px;
}
.detail-prompt-text {
  font-family: 'Courier New', monospace;
  font-size: 14px; line-height: 1.85;
  color: var(--text-secondary);
  white-space: pre-wrap; word-break: break-word;
}
.detail-copy-btn {
  margin-top: 20px;
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--red); color: #fff;
  border: none; border-radius: 9px;
  padding: 11px 22px;
  font-family: var(--font-heading);
  font-size: 14px; font-weight: 700;
  cursor: pointer; transition: all var(--t-base);
  box-shadow: 0 0 20px var(--red-glow);
}
.detail-copy-btn:hover { opacity: 0.85; transform: translateY(-2px); }
.detail-copy-btn.copied { background: #16A34A; box-shadow: 0 0 20px rgba(22,163,74,0.4); }

/* Tags in detail */
.detail-tags {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-bottom: 32px;
}

/* Divider */
.detail-divider {
  border: none; border-top: 1px solid var(--border);
  margin: 32px 0;
}

/* Steps */
.detail-steps {
  list-style: none;
  display: flex; flex-direction: column; gap: 14px;
  margin-bottom: 48px;
}
.detail-step {
  display: flex; gap: 16px; align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px;
  transition: border-color var(--t-base);
}
.detail-step:hover { border-color: var(--red); }
.detail-step-num {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--red); color: #fff;
  font-family: var(--font-heading);
  font-size: 12px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; margin-top: 1px;
}
.detail-step-text {
  font-size: 14.5px; line-height: 1.65;
  color: var(--text-secondary);
}

@media (max-width: 640px) {
  .detail-body { padding: 28px 16px 72px; }
  .detail-header { padding: 12px 16px; }
  .detail-header-title { display: none; }
}

/* ═══════════════════════════════════════════════════════════
   TOAST
═══════════════════════════════════════════════════════════ */
#toastContainer {
  position: fixed; bottom: 32px; right: 24px;
  z-index: 2000;
  display: flex; flex-direction: column; gap: 10px;
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  border: 1px solid var(--border-bright);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  font-family: var(--font-heading);
  font-size: 14px; font-weight: 600;
  color: var(--text-primary);
  backdrop-filter: blur(20px);
  animation: toastIn 0.35s var(--ease) both;
  pointer-events: all;
  min-width: 220px;
}
.toast.toast-success .toast-icon { color: #16A34A; }
.toast.toast-error   .toast-icon { color: var(--red); }
.toast.exiting { animation: toastOut 0.3s var(--ease) both; }

/* ═══════════════════════════════════════════════════════════
   FOOTER
═══════════════════════════════════════════════════════════ */
.site-footer {
  position: relative; z-index: 1;
  border-top: 1px solid var(--border);
  padding: 40px 0; text-align: center;
}
.footer-logo-wrap {
  display: flex; align-items: center; justify-content: center;
  gap: 10px; margin-bottom: 10px;
}
.footer-logo-img {
  width: 38px; height: 38px;
  border-radius: 50%; object-fit: cover;
  border: 2px solid var(--red);
}
.footer-logo-text {
  font-family: var(--font-heading);
  font-size: 16px; font-weight: 800;
  letter-spacing: -0.02em; color: var(--text-primary);
}
.footer-logo-text span { color: var(--red); }
.footer-sub { font-size: 13px; color: var(--text-muted); }

/* ═══════════════════════════════════════════════════════════
   KEYFRAMES
═══════════════════════════════════════════════════════════ */
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes cardReveal {
  from { opacity: 0; transform: translateY(20px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes pulseDot {
  0%, 100% { opacity: 1; box-shadow: 0 0 6px var(--red-glow); }
  50%       { opacity: 0.5; box-shadow: 0 0 16px var(--red-glow); }
}
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(20px); }
}

/* ── Utilities ─────────────────────────────────────────────── */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border-width: 0;
}
.hidden { display: none !important; }

/* Stagger delays */
#promptsGrid .prompt-card:nth-child(1) { animation-delay: 0ms; }
#promptsGrid .prompt-card:nth-child(2) { animation-delay: 70ms; }
#promptsGrid .prompt-card:nth-child(3) { animation-delay: 140ms; }
#promptsGrid .prompt-card:nth-child(4) { animation-delay: 210ms; }
#promptsGrid .prompt-card:nth-child(5) { animation-delay: 280ms; }
#promptsGrid .prompt-card:nth-child(6) { animation-delay: 350ms; }
