/* ===================================
   DARK MINIMALIST THEME
   =================================== */

:root {
  --bg-primary: #0a0a0a;
  --bg-secondary: #121212;
  --bg-tertiary: #1a1a1a;
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-medium: rgba(255, 255, 255, 0.1);
  --text-primary: #f5f5f5;
  --text-secondary: #a1a1a1;
  --text-tertiary: #666666;
  --accent: #8b5cf6;
  --accent-hover: #7c3aed;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

::selection {
  background: rgba(139, 92, 246, 0.3);
  color: white;
}

/* ===================================
   TYPOGRAPHY - PROSE STYLES
   =================================== */

.prose {
  line-height: 1.7;
  color: var(--text-secondary);
}

.prose > :first-child {
  margin-top: 0 !important;
}

.prose > :last-child {
  margin-bottom: 0 !important;
}

.prose p {
  margin: 0.875rem 0;
}

.prose strong {
  font-weight: 600;
  color: var(--text-primary);
}

.prose em {
  font-style: italic;
}

.prose u {
  text-decoration: underline;
}

.prose h1 {
  margin: 1.5rem 0 0.875rem;
  font-size: 1.75rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
}

.prose h2 {
  margin: 1.25rem 0 0.75rem;
  font-size: 1.375rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text-primary);
}

.prose h3 {
  margin: 1rem 0 0.625rem;
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-primary);
}

.prose ul,
.prose ol {
  margin: 0.875rem 0;
  padding-left: 1.5rem;
}

.prose ul {
  list-style: disc;
}

.prose ol {
  list-style: decimal;
}

.prose li {
  margin: 0.375rem 0;
}

.prose blockquote {
  margin: 1.25rem 0;
  padding-left: 1rem;
  border-left: 2px solid var(--border-medium);
  color: var(--text-secondary);
  font-style: italic;
}

.prose a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease;
}

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

.prose code {
  font-family:
    ui-monospace, "SF Mono", "Cascadia Code", "Roboto Mono", Consolas, monospace;
  font-size: 0.875em;
  padding: 0.2rem 0.4rem;
  border-radius: 0.375rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
}

.prose pre {
  margin: 1.25rem 0;
  padding: 1rem;
  overflow-x: auto;
  border-radius: 0.75rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
}

.prose pre code {
  background: transparent;
  border: 0;
  padding: 0;
  font-size: 0.875rem;
}

.prose table {
  width: 100%;
  margin: 1.25rem 0;
  border-collapse: collapse;
}

.prose th,
.prose td {
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--border-subtle);
  text-align: left;
}

.prose thead th {
  background: var(--bg-tertiary);
  font-weight: 600;
  color: var(--text-primary);
}

.prose hr {
  margin: 2rem 0;
  border: 0;
  border-top: 1px solid var(--border-subtle);
}

.prose.prose-invert {
  color: var(--text-secondary);
}

/* ===================================
   CARDS & COMPONENTS
   =================================== */

.script-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 0.75rem;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.script-card:hover {
  background: var(--bg-tertiary);
  border-color: var(--border-medium);
  transform: translateY(-2px);
}

/* ===================================
   BUTTONS
   =================================== */

.btn-action {
  background: var(--bg-secondary);
  border: 1px solid var(--border-medium);
  color: var(--text-primary);
  padding: 0.625rem 1.25rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s ease;
  cursor: pointer;
}

.btn-action:hover {
  background: var(--bg-tertiary);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

.btn-glass {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 0.625rem 1.25rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s ease;
  cursor: pointer;
}

.btn-glass:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border-medium);
}

.btn-primary {
  background: white;
  color: #0a0a0a;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  transition: all 0.2s ease;
  cursor: pointer;
}

.btn-primary:hover {
  background: #e5e5e5;
  transform: translateY(-1px);
}

.btn-play {
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid rgba(139, 92, 246, 0.2);
  color: var(--accent);
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s ease;
  cursor: pointer;
}

.btn-play:hover {
  background: rgba(139, 92, 246, 0.15);
  border-color: rgba(139, 92, 246, 0.3);
}

/* ===================================
   UTILITY CLASSES
   =================================== */

.glass-card {
  background: rgba(255, 255, 255, 0.02);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
}

.text-balance {
  text-wrap: balance;
}

.script-title {
  word-wrap: break-word;
  overflow-wrap: break-word;
  word-break: break-word;
  line-height: 1.3;
}

@media (max-width: 640px) {
  .script-title {
    font-size: 1.5rem;
  }
}

/* ===================================
   VIDEO MODAL
   =================================== */

.video-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(8px);
  z-index: 1000;
  animation: fadeIn 0.2s ease;
}

.video-modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-modal-content {
  position: relative;
  width: 90%;
  max-width: 900px;
  aspect-ratio: 16/9;
  background: #000;
  border-radius: 0.5rem;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  animation: slideUp 0.2s ease;
}

.video-modal-content iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.video-modal-close {
  position: absolute;
  top: -50px;
  right: 0;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-medium);
  color: white;
  font-size: 1.25rem;
  width: 36px;
  height: 36px;
  padding: 0;
  cursor: pointer;
  border-radius: 0.375rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.video-modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
}

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

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@media (max-width: 640px) {
  .video-modal-content {
    width: 95%;
  }
  .video-modal-close {
    top: -45px;
    width: 32px;
    height: 32px;
  }
}
