/**
 * 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: 60px;
  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;
}

@media (min-width: 768px) {
  .top-nav {
    padding: 0 24px;
  }
}

@media (min-width: 1024px) {
  .top-nav {
    padding: 0 32px;
  }
}

@media (min-width: 1440px) {
  .top-nav {
    padding: 0 48px;
  }
}

@media (min-width: 1920px) {
  .top-nav {
    padding: 0 80px;
  }
}

.top-nav__logo {
  font-size: 18px;
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

@media (min-width: 768px) {
  .top-nav__logo {
    font-size: 20px;
  }
}

.top-nav__logo:hover {
  opacity: 0.8;
}

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

@media (min-width: 768px) {
  .top-nav__actions {
    gap: 12px;
  }
}

.top-nav__link {
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: color var(--duration-fast);
  white-space: nowrap;
}

@media (min-width: 768px) {
  .top-nav__link {
    font-size: 14px;
  }
}

.top-nav__link:hover {
  color: rgba(255, 255, 255, 0.9);
}

.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: 6px 12px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--duration-fast);
  white-space: nowrap;
}

@media (min-width: 768px) {
  .top-nav__btn {
    padding: 8px 16px;
    border-radius: 12px;
    font-size: 14px;
  }
}

.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;
}

/* 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: 9999;
  opacity: 0.4;
}

.feed-container {
  max-width: 100%;
  margin: 0 auto;
  min-height: 100vh;
  padding: var(--space-4);
  padding-bottom: 180px; /* Space for FAB + sticky player */
}

/* 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;
}

/* 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;
  height: 90vh;
  overflow-y: auto;
  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);
}

/* Input State */
.modal-input-state {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.modal-input-state form {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.modal-input-state 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-input-state textarea::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.modal-input-state 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 State */
.modal-refinement-state {
  display: none;
}

.modal-refinement-state.active {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow-y: auto;
}

.modal-refinement-state form {
  display: flex;
  flex-direction: column;
  flex: 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
   ============================================ */

.visibility-toggle {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 0.5px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
}

.visibility-toggle__label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.visibility-toggle__label svg {
  color: rgba(255, 255, 255, 0.5);
}

.visibility-toggle__options {
  display: flex;
  gap: 12px;
}

.visibility-option {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.visibility-option:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
}

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

.visibility-option svg {
  flex-shrink: 0;
}

.visibility-option span {
  font-weight: 600;
}

.visibility-option.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: rgba(255, 255, 255, 0.02);
  border-color: rgba(255, 255, 255, 0.05);
}

.visibility-option.disabled:hover {
  background: rgba(255, 255, 255, 0.02);
  border-color: rgba(255, 255, 255, 0.05);
}

/* 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 {
  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);
}
