/**
 * TikTok-Style Audio Feed - Production Grade
 * Mobile-first (375px), zero chrome, audio spectrum aesthetic
 */

/* ============================================
   FOUNDATIONS - Color System & Variables
   ============================================ */

:root {
  /* Color Palette - Modern Bold */
  --deep-space: #0a0a0f;
  --card-glass: rgba(18, 18, 24, 0.6);
  --border-subtle: rgba(255, 255, 255, 0.08);

  /* Gradients - Vibrant & Modern */
  --gradient-primary: linear-gradient(135deg, #ff3366 0%, #ff6b35 100%);
  --gradient-warm: linear-gradient(135deg, #ffa259 0%, #ff6b9d 100%);
  --gradient-generating: linear-gradient(90deg, #ff3366 0%, #ff6b35 50%, #ffa259 100%);

  /* Shadows - Colored Glows */
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.4), 0 2px 8px rgba(255, 51, 102, 0.15);
  --shadow-fab: 0 8px 24px rgba(255, 51, 102, 0.4), 0 4px 12px rgba(255, 107, 53, 0.3);
  --shadow-modal: 0 24px 64px rgba(0, 0, 0, 0.6);

  /* Typography */
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", system-ui, sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;

  /* Spacing System */
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;

  /* Animation Timing */
  --ease-smooth: cubic-bezier(0.4, 0.0, 0.2, 1);
  --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
  --duration-instant: 50ms;
  --duration-fast: 150ms;
  --duration-modal: 300ms;
}

/* ============================================
   BASE - Reset & Container
   ============================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

/* ============================================
   NAVIGATION - Minimal Top Bar
   ============================================ */

.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100vw;
  max-width: none;
  height: 56px;
  background: rgba(10, 11, 15, 0.95);
  backdrop-filter: blur(20px);
  border-bottom: 0.5px solid rgba(255, 255, 255, 0.06);
  z-index: 1001;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  margin: 0;
}

.top-nav__logo {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #ffffff;
  text-decoration: none;
  font-weight: 600;
  font-size: 16px;
}

.top-nav__logo:hover {
  color: #ffffff;
  text-decoration: none;
}

.top-nav__logo svg {
  stroke: #ffffff;
  flex-shrink: 0;
}

.top-nav__link {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  font-size: 14px;
  padding: 6px 10px;
  border-radius: 8px;
  transition: color 150ms, background 150ms;
}

.top-nav__link:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
}

.top-nav__tabs {
  display: flex;
  gap: 4px;
  align-items: center;
}

.top-nav__tab {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.4);
  text-decoration: none;
  transition: color 150ms, background 150ms;
}

.top-nav__tab:hover {
  color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.05);
}

.top-nav__tab--active {
  color: #ff3366;
}

.top-nav__tab--active:hover {
  color: #ff3366;
}

.top-nav__actions {
  display: flex;
  gap: 8px;
  align-items: center;
  position: relative;
}

.top-nav__hamburger {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: none;
  background: none;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: color 150ms, background 150ms;
}

.top-nav__hamburger:hover {
  color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.05);
}

.top-nav__menu {
  display: none;
  position: absolute;
  top: 48px;
  right: 0;
  min-width: 160px;
  background: rgba(18, 19, 26, 0.98);
  backdrop-filter: blur(20px);
  border: 0.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}

.top-nav__menu.active {
  display: block;
}

.top-nav__menu-item {
  display: block;
  width: 100%;
  padding: 10px 14px;
  border-radius: 8px;
  border: none;
  background: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  font-family: inherit;
  text-decoration: none;
  text-align: left;
  cursor: pointer;
  transition: background 150ms;
}

.top-nav__menu-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.top-nav__menu-item--danger {
  color: #ff3366;
}

.top-nav__btn {
  background: rgba(255, 255, 255, 0.05);
  border: 0.5px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.7);
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 150ms;
  white-space: nowrap;
  text-decoration: none;
}

.top-nav__btn:active {
  transform: scale(0.97);
}

.top-nav__btn--primary {
  background: var(--gradient-primary);
  color: white;
  border: none;
  box-shadow: 0 4px 12px rgba(255, 51, 102, 0.3);
}

.top-nav__btn--primary:hover {
  box-shadow: 0 6px 16px rgba(255, 51, 102, 0.4);
}

body {
  font-family: var(--font-body);
  background: var(--deep-space);
  color: #ffffff;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
}

/* Offset main content below fixed nav (56px nav + 8px breathing room) */
main {
  padding-top: 64px;
}

/* Noise Texture Overlay */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  opacity: 0.4;
}

.feed-container {
  max-width: 100%;
  margin: 0 auto;
  min-height: 100vh;
  padding: var(--space-4);
  padding-top: 80px;
  padding-bottom: 100px;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 3px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 51, 102, 0.3);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 51, 102, 0.5);
}

/* ============================================
   PODCAST CARDS - Audio Spectrum Style
   ============================================ */

.podcast-card {
  position: relative;
  background: var(--card-glass);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  padding: var(--space-5);
  margin-bottom: var(--space-4);
  border: 0.5px solid var(--border-subtle);
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: transform var(--duration-fast) var(--ease-smooth),
              box-shadow var(--duration-fast) var(--ease-smooth),
              border-color var(--duration-fast) var(--ease-smooth);
  overflow: hidden;
}

.podcast-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 51, 102, 0.3);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), 0 4px 12px rgba(255, 51, 102, 0.2);
}

.podcast-card:active {
  transform: translateY(0);
}

/* Gradient Border Effect */
.podcast-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 20px;
  padding: 1px;
  background: var(--gradient-primary);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity var(--duration-fast) var(--ease-smooth);
}

.podcast-card:active {
  transform: scale(0.98);
}

.podcast-card:hover::before {
  opacity: 0.4;
}

.podcast-header {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.podcast-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(255, 51, 102, 0.3);
}

/* Spinning icon for generating state */
.podcast-icon--spin svg {
  animation: spin 1.2s linear infinite;
}

.podcast-meta {
  flex: 1;
  min-width: 0;
}

.podcast-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.3px;
  line-height: 1.3;
  margin-bottom: 4px;
  color: #ffffff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.podcast-info {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 400;
  letter-spacing: 0.2px;
}

.podcast-owner-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  color: #a78bfa;
  background: rgba(167, 139, 250, 0.12);
  padding: 2px 8px;
  border-radius: 10px;
  margin-right: 6px;
}

.podcast-card.shared {
  border-color: rgba(167, 139, 250, 0.3);
}

.podcast-card.shared:hover {
  border-color: rgba(167, 139, 250, 0.5);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), 0 4px 12px rgba(167, 139, 250, 0.15);
}

/* Failed State */
.podcast-card.failed {
  border-color: rgba(239, 68, 68, 0.4);
  opacity: 0.75;
  cursor: pointer;
}

.podcast-card.failed::before {
  opacity: 1;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(220, 38, 38, 0.08));
}

.podcast-card.failed:hover {
  opacity: 1;
  border-color: rgba(239, 68, 68, 0.6);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), 0 4px 12px rgba(239, 68, 68, 0.15);
}

.podcast-card.failed .podcast-info {
  color: rgba(239, 68, 68, 0.8);
  font-size: 12px;
}

/* Generating State - Animated Gradient */
.podcast-card.generating {
  border-color: rgba(255, 51, 102, 0.4);
}

.podcast-card.generating::before {
  opacity: 1;
  background: var(--gradient-generating);
  background-size: 200% 100%;
  animation: gradientShift 3s linear infinite;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

.progress-bar {
  height: 2px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
  margin-top: var(--space-3);
}

.progress-fill {
  height: 100%;
  background: var(--gradient-primary);
  width: 0%;
  transition: width 0.3s ease-out;
  box-shadow: 0 0 8px rgba(255, 51, 102, 0.6);
}

.progress-log {
  margin-top: 16px;
  max-height: 200px;
  overflow-y: auto;
  font-size: 11px;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.6);
  font-family: -apple-system-ui-monospaced, 'SF Mono', 'Cascadia Code', monospace;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  padding: 8px;
}

.progress-log::-webkit-scrollbar {
  width: 4px;
}

.progress-log::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 2px;
}

.progress-log::-webkit-scrollbar-thumb {
  background: rgba(255, 51, 102, 0.3);
  border-radius: 2px;
}

.progress-log::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 51, 102, 0.5);
}

/* ============================================
   FLOATING ACTION BUTTON - Pulse Animation
   ============================================ */

.fab {
  position: fixed;
  bottom: 100px;
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--gradient-primary);
  border: none;
  font-size: 28px;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1000;
  box-shadow: var(--shadow-fab);
  transition: transform var(--duration-fast) var(--ease-bounce),
              box-shadow var(--duration-fast) var(--ease-smooth);
  animation: fabPulse 3s ease-in-out infinite;
}

@keyframes fabPulse {
  0%, 100% {
    box-shadow: var(--shadow-fab);
  }
  50% {
    box-shadow: 0 8px 32px rgba(255, 51, 102, 0.6), 0 4px 16px rgba(255, 107, 53, 0.5);
  }
}

.fab:active {
  transform: scale(0.9);
}

.fab:hover {
  transform: scale(1.05);
  box-shadow: 0 12px 32px rgba(255, 51, 102, 0.5), 0 6px 16px rgba(255, 107, 53, 0.4);
}

/* ============================================
   MODAL - Slide Up with Glassmorphism
   ============================================ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(12px);
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-modal) var(--ease-smooth);
}

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

.modal-content {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 100%;
  margin: 0 auto;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: rgba(18, 19, 26, 0.95);
  backdrop-filter: blur(40px);
  border-radius: 28px 28px 0 0;
  padding: var(--space-6);
  padding-bottom: calc(var(--space-6) + env(safe-area-inset-bottom));
  box-shadow: var(--shadow-modal);
  border: 0.5px solid rgba(255, 255, 255, 0.1);
  border-bottom: none;
  transform: translateY(100%);
  transition: transform var(--duration-modal) var(--ease-smooth);
}

.modal-overlay.active .modal-content {
  transform: translateY(0);
}

/* Modal Handle */
.modal-handle {
  width: 40px;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  margin: 0 auto var(--space-5);
}

/* Modal form */
.modal-content form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.modal-content textarea {
  width: 100%;
  flex: 1;
  min-height: 120px;
  background: rgba(255, 255, 255, 0.05);
  border: 0.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: var(--space-4);
  font-family: var(--font-body);
  font-size: 16px;
  color: #ffffff;
  resize: none;
  margin-bottom: var(--space-4);
  transition: border-color var(--duration-fast) var(--ease-smooth),
              box-shadow var(--duration-fast) var(--ease-smooth);
}

.modal-content textarea::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.modal-content textarea:focus {
  outline: none;
  border-color: rgba(255, 51, 102, 0.5);
  box-shadow: 0 0 0 3px rgba(255, 51, 102, 0.1);
}

.refinement-label {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 16px;
  margin-top: 24px;
}

.chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: var(--space-5);
  padding: 12px 0;
}

.chip {
  padding: 14px 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 0.5px solid rgba(255, 255, 255, 0.15);
  border-radius: 24px;
  font-size: 15px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition: all var(--duration-instant) var(--ease-smooth);
  user-select: none;
  line-height: 1.4;
}

.chip:active {
  transform: scale(0.95);
}

.chip.selected {
  background: var(--gradient-primary);
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(255, 51, 102, 0.4);
}

.link-list {
  margin-bottom: var(--space-5);
}

.link-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  margin-bottom: var(--space-2);
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
}

.link-item input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
}

/* Buttons */
.modal-actions {
  display: flex;
  gap: var(--space-3);
}

.btn {
  flex: 1;
  padding: 16px;
  border: none;
  border-radius: 14px;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-smooth);
  letter-spacing: -0.2px;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.7);
  border: 0.5px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary:active {
  transform: scale(0.97);
  background: rgba(255, 255, 255, 0.05);
}

.btn-primary {
  background: var(--gradient-primary);
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(255, 51, 102, 0.4);
}

.btn-primary:active {
  transform: scale(0.97);
}

.btn-primary:hover {
  box-shadow: 0 6px 20px rgba(255, 51, 102, 0.5);
}

/* HTMX Loading States */
.btn-spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-left: 8px;
}

.htmx-request .btn-spinner {
  display: inline-block;
}

.htmx-request .btn-text {
  opacity: 0.7;
}

button[disabled] {
  opacity: 0.7;
  cursor: not-allowed;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

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

.hidden {
  display: none !important;
}

/* Loading Shimmer Effect */
@keyframes shimmer {
  0% {
    background-position: -400px 0;
  }
  100% {
    background-position: 400px 0;
  }
}

.shimmer {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.05) 0%,
    rgba(255, 255, 255, 0.1) 50%,
    rgba(255, 255, 255, 0.05) 100%
  );
  background-size: 400px 100%;
  animation: shimmer 1.5s infinite;
}

/* ============================================
   RESPONSIVE - Desktop & Tablet
   ============================================ */

/* Tablet (768px+) */
@media (min-width: 768px) {
  .feed-container {
    max-width: 100%;
    padding: var(--space-6) 24px;
  }

  .modal-content {
    max-width: 600px;
    border-radius: 28px;
    height: 85vh;
  }

  .podcast-card {
    margin-bottom: var(--space-6);
  }

  .fab {
    width: 64px;
    height: 64px;
    font-size: 28px;
    bottom: 100px;
    right: 40px;
  }
}

/* Desktop (1024px+) */
@media (min-width: 1024px) {
  .feed-container {
    max-width: 100%;
    padding: var(--space-6) 32px;
  }

  .modal-content {
    max-width: 700px;
  }
}

/* Large Desktop (1440px+) */
@media (min-width: 1440px) {
  .feed-container {
    max-width: 100%;
    padding: var(--space-6) 48px;
  }

  .modal-content {
    max-width: 800px;
  }
}

/* ============================================
   VISIBILITY TOGGLE - Private/Public Selection
   ============================================ */

/* Refinement form */
.refinement-form {
  position: relative;
}

/* Visibility lock button (top-right corner) */
.visibility-lock {
  position: absolute;
  top: 0;
  right: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
}

.visibility-lock:hover {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.8);
}

.visibility-lock.unlocked {
  background: rgba(255, 51, 102, 0.15);
  border-color: #ff3366;
  color: #ff3366;
}

/* Refinement outline */
.refinement-outline {
  margin-bottom: 12px;
  padding: 10px;
  background: rgba(255, 51, 102, 0.06);
  border: 0.5px solid rgba(255, 51, 102, 0.2);
  border-radius: 10px;
  max-height: 25vh;
  overflow-y: auto;
}

.refinement-outline__title {
  font-size: 15px;
  font-weight: 600;
  color: #ff3366;
  margin-bottom: 6px;
}

.refinement-outline__hook {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  font-style: italic;
  margin-bottom: 8px;
}

.refinement-outline__meta {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.refinement-outline__section {
  padding: 2px 0 2px 10px;
  border-left: 2px solid rgba(255, 51, 102, 0.2);
  margin-bottom: 4px;
}

.refinement-outline__section-title {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.8);
}

.refinement-outline__duration {
  color: rgba(255, 255, 255, 0.35);
  font-size: 11px;
}

/* Sticky actions bar */
.modal-actions--sticky {
  position: sticky;
  bottom: 0;
  padding: 12px 0 0;
  background: var(--bg-card, #1a1b2e);
}

.btn--wide {
  flex: 2;
}

.link-item__text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Podcast Action Buttons */
.podcast-actions {
  display: flex;
  gap: 12px;
  padding: 16px 20px;
  border-top: 0.5px solid rgba(255, 255, 255, 0.05);
  justify-content: flex-end;
  background: rgba(0, 0, 0, 0.1);
}

.action-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  padding: 10px 16px;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
}

.action-btn svg {
  flex-shrink: 0;
}

.action-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.3);
  color: rgba(255, 255, 255, 0.95);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.action-btn:active {
  transform: translateY(0);
}

.action-btn-danger {
  border-color: rgba(255, 51, 102, 0.3);
}

.action-btn-danger:hover {
  background: rgba(255, 51, 102, 0.2);
  border-color: rgba(255, 51, 102, 0.6);
  color: #ff3366;
}

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


/* Log Section */
.log-section {
  padding: 12px 16px;
  border-top: 0.5px solid rgba(255, 255, 255, 0.05);
}

.log-toggle {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  padding: 8px 0;
  width: 100%;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: color 0.2s;
}

.log-toggle:hover {
  color: rgba(255, 255, 255, 0.9);
}

/* Log Chevron - CSS triangle instead of emoji */
.log-chevron {
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 5px solid currentColor;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  transition: transform 0.2s ease;
}

.log-chevron.expanded {
  transform: rotate(90deg);
}

.log-content {
  margin-top: 8px;
}

.log-output {
  width: 100%;
  height: 200px;
  font-family: 'SF Mono', 'Courier New', monospace;
  font-size: 11px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 12px;
  line-height: 1.4;
  white-space: pre-wrap;
  word-wrap: break-word;
  outline: none;
}

.log-output:focus {
  border-color: rgba(255, 51, 102, 0.4);
}

.log-output::selection {
  background: rgba(255, 51, 102, 0.3);
  color: white;
}

.podcast-cover {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* ============================================
   ERROR MODAL
   ============================================ */

.error-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

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

.error-modal {
  background: #1a1a24;
  border: 1px solid rgba(255, 51, 102, 0.4);
  border-radius: 16px;
  width: 100%;
  max-width: 560px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
}

.error-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.error-modal__title {
  font-size: 16px;
  font-weight: 600;
  color: #ff3366;
}

.error-modal__close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  font-size: 24px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}

.error-modal__close:hover {
  color: white;
}

.error-modal__meta {
  padding: 12px 20px;
  font-size: 12px;
  font-family: 'SF Mono', 'Fira Code', monospace;
  color: rgba(255, 255, 255, 0.5);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.error-modal__body {
  flex: 1;
  overflow: auto;
  padding: 16px 20px;
  margin: 0;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 12px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.8);
  white-space: pre-wrap;
  word-break: break-word;
  background: rgba(0, 0, 0, 0.2);
}

.error-modal__actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding: 16px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* Feed Empty State */

.feed-empty-state {
  text-align: center;
  padding: 60px 20px;
  color: rgba(255, 255, 255, 0.3);
}

.feed-empty-state__icon {
  margin-bottom: 16px;
}

.feed-empty-state__title {
  font-size: 15px;
  font-weight: 500;
}

.feed-empty-state__sub {
  font-size: 13px;
  margin-top: 8px;
  opacity: 0.6;
}

.feed-empty-state__cta {
  display: inline-block;
  margin-top: 20px;
  padding: 12px 24px;
  background: linear-gradient(135deg, #ff3366 0%, #ff6b35 100%);
  color: white;
  text-decoration: none;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 500;
}

/* Episode Detail — Next Prompt Card */

.next-prompt-card {
  margin-top: 24px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 16px;
}

.next-prompt-label {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 8px;
}

.next-prompt-textarea {
  width: 100%;
  min-height: 60px;
  font-family: inherit;
  font-size: 14px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 10px;
  color: rgba(255, 255, 255, 0.9);
  resize: vertical;
}

.next-prompt-btn {
  margin-top: 10px;
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 24px;
  background: linear-gradient(135deg, #ff3366 0%, #ff6b35 100%);
  color: white;
  border: none;
  cursor: pointer;
  width: 100%;
}

/* =====================================================
   VIDEO PLAYER MODAL — TikTok fullscreen player
   ===================================================== */

.video-modal {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 4000;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translateY(100%);
  transition: transform 0.32s cubic-bezier(0.32, 0, 0, 1);
  overscroll-behavior: contain;
}

.video-modal.active {
  transform: translateY(0);
}

.video-modal__video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* Tap-to-toggle overlay — covers the video area */
.video-modal__tap {
  position: absolute;
  inset: 0;
  z-index: 1;
  cursor: pointer;
}

/* Close button — top right */
.video-modal__close {
  position: absolute;
  top: max(16px, env(safe-area-inset-top, 16px));
  right: 16px;
  z-index: 10;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  border: none;
  color: #fff;
  font-size: 18px;
  line-height: 36px;
  text-align: center;
  cursor: pointer;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* Bottom info + progress */
.video-modal__bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 5;
  padding: 0 0 max(24px, env(safe-area-inset-bottom, 24px)) 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.75));
  pointer-events: none;
}

.video-modal__progress-bar {
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.2);
  cursor: pointer;
  pointer-events: all;
}

.video-modal__progress-fill {
  height: 100%;
  background: var(--gradient-primary);
  width: 0%;
  transition: width 0.25s linear;
}

.video-modal__title {
  padding: 10px 16px 0;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  line-height: 1.3;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

/* Play/pause flash icon */
.video-modal__flash {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  z-index: 6;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 28px;
  pointer-events: none;
  transition: transform 0.15s ease-out, opacity 0.3s ease-out;
  opacity: 0;
}

.video-modal__flash.show {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}

.video-modal__flash.hide {
  transform: translate(-50%, -50%) scale(1.3);
  opacity: 0;
}

.progress-fill--generating {
  width: 50%;
}

/* ── Create mode tabs (Auto-Generate / Voice Studio) ─────────── */
.create-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.create-tab {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.create-tab:hover {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.8);
}

.create-tab--active {
  background: var(--gradient-primary);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 2px 12px rgba(255, 51, 102, 0.3);
}

/* ── Voice Studio teaser panel ───────────────────────────────── */
.voice-teaser {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 24px 16px 8px;
  text-align: center;
}

.voice-teaser__icon {
  font-size: 2.5rem;
  line-height: 1;
  filter: drop-shadow(0 0 16px rgba(255, 51, 102, 0.5));
}

.voice-teaser__title {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.voice-teaser__desc {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1.55;
  max-width: 280px;
}

.voice-teaser__btn {
  margin-top: 4px;
  width: 100%;
  text-align: center;
  text-decoration: none;
  display: block;
}
