/* =============================================================================
   UNIFIED CSS SYSTEM - Single Source of Truth
   Replaces: style.css + Svelte component styles + all CSS variables
   ============================================================================= */

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

html {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: #000000;
  color: #ffffff;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* =============================================================================
   DESIGN TOKENS - Single Source of Truth
   ============================================================================= */

:root {
  /* Colors - Consistent across all components */
  --color-white: #ffffff;
  --color-black: #000000;

  /* Grays - Darker theme */
  --color-gray-50: #ffffff;
  --color-gray-100: #f5f5f5;
  --color-gray-200: #e5e5e5;
  --color-gray-300: #d4d4d4;
  --color-gray-400: #a3a3a3;
  --color-gray-500: #737373;
  --color-gray-600: #525252;
  --color-gray-700: #404040;
  --color-gray-800: #262626;
  --color-gray-900: #000000;

  /* Reds - Demon theme */
  --color-red-50: #fef2f2;
  --color-red-100: #fee2e2;
  --color-red-200: #fecaca;
  --color-red-300: #fca5a5;
  --color-red-400: #f87171;
  --color-red-500: #ef4444;
  --color-red-600: #dc2626;
  --color-red-700: #b91c1c;

  /* Greens */
  --color-green-50: #f0fdf4;
  --color-green-100: #dcfce7;
  --color-green-500: #22c55e;
  --color-green-600: #16a34a;
  --color-green-700: #15803d;

  /* Additional Reds */
  --color-red-800: #991b1b;
  --color-red-900: #7f1d1d;

  /* Spacing - Consistent scale */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;

  /* Font sizes */
  --text-xs: 12px;
  --text-sm: 14px;
  --text-base: 16px;
  --text-lg: 18px;
  --text-xl: 20px;
  --text-2xl: 24px;
  --text-3xl: 30px;

  /* Border radius */
  --radius-sm: 4px;
  --radius: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

  /* Z-index */
  --z-modal: 1000;
  --z-dropdown: 100;
  --z-header: 50;
}

/* =============================================================================
   UTILITY CLASSES - Atomic Design System
   ============================================================================= */

/* Layout */
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.block { display: block; }
.inline-block { display: inline-block; }
.hidden { display: none; }

.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-start { justify-content: flex-start; }
.justify-end { justify-content: flex-end; }

.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }

/* Spacing */
.p-0 { padding: 0; }
.p-1 { padding: var(--space-1); }
.p-2 { padding: var(--space-2); }
.p-3 { padding: var(--space-3); }
.p-4 { padding: var(--space-4); }
.p-5 { padding: var(--space-5); }
.p-6 { padding: var(--space-6); }
.p-8 { padding: var(--space-8); }

.px-2 { padding-left: var(--space-2); padding-right: var(--space-2); }
.px-3 { padding-left: var(--space-3); padding-right: var(--space-3); }
.px-4 { padding-left: var(--space-4); padding-right: var(--space-4); }
.px-6 { padding-left: var(--space-6); padding-right: var(--space-6); }

.py-2 { padding-top: var(--space-2); padding-bottom: var(--space-2); }
.py-3 { padding-top: var(--space-3); padding-bottom: var(--space-3); }
.py-4 { padding-top: var(--space-4); padding-bottom: var(--space-4); }

.m-0 { margin: 0; }
.m-1 { margin: var(--space-1); }
.m-2 { margin: var(--space-2); }
.m-3 { margin: var(--space-3); }
.m-4 { margin: var(--space-4); }

.mx-auto { margin-left: auto; margin-right: auto; }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }

/* Sizing */
.w-full { width: 100%; }
.w-auto { width: auto; }
.h-full { height: 100%; }
.h-auto { height: auto; }
.min-h-screen { min-height: 100vh; }

/* Colors */
.text-white { color: var(--color-white); }
.text-gray-500 { color: #a3a3a3; }
.text-gray-600 { color: #737373; }
.text-gray-700 { color: #d4d4d4; }
.text-gray-800 { color: #e5e5e5; }
.text-gray-900 { color: #f5f5f5; }
.text-red-500 { color: #ef4444; }
.text-red-600 { color: #dc2626; }
.text-green-600 { color: #16a34a; }

/* Text Colors for Demon Theme */
.text-slate-100 { color: #ffffff; }
.text-slate-300 { color: #d4d4d4; }
.text-slate-400 { color: #a3a3a3; }

.bg-white { background-color: #262626; }
.bg-gray-50 { background-color: #404040; }
.bg-gray-100 { background-color: #525252; }
.bg-gray-200 { background-color: #737373; }
.bg-red-500 { background-color: var(--color-red-500); }
.bg-red-600 { background-color: var(--color-red-600); }
.bg-green-500 { background-color: var(--color-green-500); }
.bg-green-600 { background-color: var(--color-green-600); }

/* Background Colors for Demon Theme */
.bg-slate-600 { background-color: #525252; }
.bg-slate-700 { background-color: #404040; }
.bg-slate-800 { background-color: #262626; }

/* Borders */
.border { border: 1px solid #525252; }
.border-2 { border: 2px solid #525252; }
.border-gray-200 { border-color: #525252; }
.border-gray-300 { border-color: #737373; }
.border-red-500 { border-color: #dc2626; }

/* Border Colors for Demon Theme */
.border-slate-500 { border-color: #737373; }
.border-slate-600 { border-color: #525252; }

/* Placeholder Colors for Demon Theme */
.placeholder-slate-400::placeholder { color: #a3a3a3; }

.border-t { border-top: 1px solid #525252; }
.border-b { border-bottom: 1px solid #525252; }
.border-l { border-left: 1px solid #525252; }
.border-r { border-right: 1px solid #525252; }

.rounded { border-radius: var(--radius); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }

/* Typography */
.text-xs { font-size: var(--text-xs); }
.text-sm { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-lg { font-size: var(--text-lg); }
.text-xl { font-size: var(--text-xl); }
.text-2xl { font-size: var(--text-2xl); }

.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

/* Shadows */
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow { box-shadow: var(--shadow); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-xl { box-shadow: var(--shadow-xl); }

/* Transitions */
.transition { transition: all 0.2s ease; }
.transition-colors { transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease; }

/* Cursor */
.cursor-pointer { cursor: pointer; }
.cursor-not-allowed { cursor: not-allowed; }

/* Opacity */
.opacity-50 { opacity: 0.5; }
.opacity-75 { opacity: 0.75; }

/* Z-index */
.z-modal { z-index: var(--z-modal); }
.z-dropdown { z-index: var(--z-dropdown); }

/* =============================================================================
   COMPONENT CLASSES - Reusable Patterns
   ============================================================================= */

/* Button Component */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  font-weight: 500;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  line-height: 1;
}

.btn-primary {
  background-color: var(--color-red-600);
  color: var(--color-white);
}

.btn-primary:hover:not(:disabled) {
  background-color: var(--color-red-700);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-success {
  background-color: var(--color-green-500);
  color: var(--color-white);
}

.btn-success:hover:not(:disabled) {
  background-color: var(--color-green-600);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-ghost {
  background-color: transparent;
  color: #a3a3a3;
  border: 1px solid #737373;
}

.btn-ghost:hover:not(:disabled) {
  background-color: #404040;
  color: #ffffff;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-sm {
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-xs);
}

.btn-lg {
  padding: var(--space-4) var(--space-6);
  font-size: var(--text-base);
}

/* Input Component */
.input {
  width: 100%;
  padding: var(--space-3);
  border: 2px solid #525252;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  line-height: 1.5;
  background-color: #262626;
  color: #ffffff;
  transition: border-color 0.2s ease;
}

.input:focus {
  outline: none;
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.2);
}

.input::placeholder {
  color: #a3a3a3;
}

.textarea {
  resize: vertical;
  min-height: 80px;
}

/* Card Component */
.card {
  background-color: #262626;
  border-radius: var(--radius-lg);
  border: 1px solid #525252;
  box-shadow: var(--shadow-sm);
}

.card-header {
  padding: var(--space-4);
  border-bottom: 1px solid #525252;
  background-color: #404040;
}

.card-body {
  padding: var(--space-4);
}

.card-footer {
  padding: var(--space-4);
  border-top: 1px solid #525252;
  background-color: #404040;
}

/* Event ID Link Styling */
.event-id-link {
  font-family: 'SF Mono', Consolas, Monaco, monospace;
  word-break: break-all;
  max-width: 100%;
  display: inline-block;
  overflow-wrap: break-word;
}

/* Archive Badge Styling - matches post-language style */
.archive-badge {
  display: inline-block;
  background: var(--color-green-600);
  color: var(--color-white);
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  border-radius: 0.25rem;
  margin-bottom: 0.5rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  animation: badgeAppear 0.3s ease-out;
  white-space: nowrap;
}

@keyframes badgeAppear {
  from {
    opacity: 0;
    transform: scale(0.8) translateY(-10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Action Buttons Container */
.action-buttons {
  display: flex;
  gap: var(--space-3);
  justify-content: center;
  margin-top: var(--space-2);
  padding: var(--space-3);
  background-color: var(--color-slate-700);
  border: 1px solid var(--color-slate-600);
  border-radius: var(--radius-md);
}

/* =============================================================================
   MODAL SYSTEM - Unified Implementation
   ============================================================================= */

.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 1rem;
}

.modal-content {
  background-color: #000000;
  border-radius: 0.75rem;
  width: 100%;
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
  border: 2px solid #dc2626;
  box-shadow: 0 25px 50px -12px rgba(220, 38, 38, 0.5);
  animation: modalSlideIn 0.2s ease-out;
  position: relative;
  z-index: 1;
}

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

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  border-bottom: 1px solid #dc2626;
  background-color: #262626;
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #ffffff;
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.25rem;
  color: #a3a3a3;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 0.25rem;
  transition: all 0.2s;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  background-color: #525252;
  color: #ffffff;
}

.modal-body {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* =============================================================================
   TAB SYSTEM - Unified Implementation
   ============================================================================= */

.tab-navigation {
  display: flex;
  border-bottom: 2px solid #525252;
  margin-top: var(--space-4);
  gap: 2px;
  overflow-x: auto;
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  background: none;
  border: none;
  color: #a3a3a3;
  cursor: pointer;
  transition: all 0.2s ease;
  border-radius: var(--radius) var(--radius) 0 0;
  font-size: var(--text-sm);
  font-weight: 500;
  white-space: nowrap;
  min-height: 44px;
  position: relative;
}

.tab-btn:hover {
  background-color: #404040;
  color: #ffffff;
}

.tab-btn.active {
  background-color: #262626;
  color: #dc2626;
  border-bottom: 2px solid #dc2626;
  margin-bottom: -2px;
}

.tab-content {
  padding: var(--space-4) 0;
  min-height: 200px;
  animation: tabFadeIn 0.2s ease-out;
}

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

.tab-section {
  background-color: #262626;
  border-radius: var(--radius-md);
  padding: var(--space-4);
  border: 1px solid #525252;
}

/* =============================================================================
   APPLICATION LAYOUT
   ============================================================================= */

/* Header */
header {
  background-color: #000000;
  border-bottom: 1px solid #dc2626;
  padding: var(--space-4) 0;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-4);
}

/* Navigation Tabs */
.tab-navigation-main {
  display: flex;
  border-bottom: 2px solid #dc2626;
  background-color: #000000;
}

.tab-button-main {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  background: none;
  border: none;
  color: #a3a3a3;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: var(--text-sm);
  font-weight: 500;
  border-bottom: 2px solid transparent;
}

.tab-button-main:hover {
  color: #ffffff;
  background-color: #262626;
}

.tab-button-main.active {
  color: #dc2626;
  border-bottom-color: #dc2626;
}

/* Status Bar */
.status-bar {
  background-color: #262626;
  border-bottom: 1px solid #525252;
  padding: var(--space-2) 0;
}

.status-item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  margin-right: var(--space-4);
  font-size: var(--text-xs);
}

.status-label {
  color: #a3a3a3;
}

.status-value {
  color: #ffffff;
  font-weight: 500;
}

/* Content Areas */
.tab-content-main {
  padding: var(--space-6);
  display: none;
}

.tab-content-main.active {
  display: block;
}

.empty-state {
  text-align: center;
  padding: var(--space-12);
  color: #a3a3a3;
}

/* Post Stream */
.post-stream {
  max-height: 600px;
  overflow-y: auto;
  border: 1px solid #525252;
  border-radius: var(--radius-md);
  background-color: #000000;
}

/* Enhanced Post Item Styling */
.post-item {
  padding: 1.25rem;
  border-bottom: 1px solid #525252;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #ffffff;
  background: linear-gradient(135deg, #000000 0%, #000000 100%);
  border-radius: 0;
  margin-bottom: 2px;
}

.post-item:hover {
  background: linear-gradient(135deg, #262626 0%, #404040 100%);
  border-left: 3px solid #dc2626;
  padding-left: calc(1.25rem - 3px);
}

.post-item:last-child {
  border-bottom: none;
}

/* Post Author Styling */
.post-author {
  font-weight: 600;
  color: #f87171;
  text-decoration: none;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  display: inline-block;
  transition: color 0.2s ease;
}

.post-author:hover {
  color: #fca5a5;
  text-decoration: underline;
}

/* Post Content Styling */
.post-content {
  color: #e5e5e5;
  line-height: 1.6;
  margin: 0.75rem 0;
  font-size: 0.95rem;
}

/* Post Language Tag */
.post-language {
  display: inline-block;
  background: #525252;
  color: #a3a3a3;
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  border-radius: 0.25rem;
  margin-bottom: 0.5rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Post URI Link */
.post-uri {
  font-family: 'SF Mono', Consolas, Monaco, monospace;
  font-size: 0.8rem;
  color: #a3a3a3;
  text-decoration: none;
  background: #262626;
  padding: 0.4rem 0.6rem;
  border-radius: 0.375rem;
  border: 1px solid #525252;
  display: inline-block;
  margin-top: 0.75rem;
  transition: all 0.2s ease;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.post-uri:hover {
  color: #ffffff;
  background: #525252;
  border-color: #737373;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(220, 38, 38, 0.3);
}

/* Post Meta Information */
.post-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.75rem;
  font-size: 0.8rem;
  color: #a3a3a3;
}

.post-timestamp {
  color: #737373;
  font-size: 0.75rem;
}

/* Post Header Layout */
.post-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.post-header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.post-header-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* =============================================================================
   RESPONSIVE DESIGN
   ============================================================================= */

@media (max-width: 640px) {
  .modal-backdrop {
    padding: var(--space-2);
  }

  .modal-content {
    max-height: 95vh;
  }

  .modal-header,
  .modal-body {
    padding: var(--space-3);
  }

  .tab-btn {
    padding: var(--space-2) var(--space-3);
    flex: 1;
    justify-content: center;
  }

  .tab-content {
    padding: var(--space-3) 0;
    min-height: 150px;
  }

  .tab-section {
    padding: var(--space-3);
  }

  .container {
    padding: 0 var(--space-3);
  }
}

@media (max-width: 480px) {
  .tab-btn .tab-label {
    display: none;
  }

  .tab-btn .tab-icon {
    font-size: var(--text-lg);
  }
}

/* Toast Notifications */
.toast {
  position: fixed;
  top: 1rem;
  right: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 0.375rem;
  color: #ffffff;
  font-size: 0.875rem;
  font-weight: 500;
  z-index: 10001;
  transform: translateY(-100px);
  opacity: 0;
  transition: all 0.3s ease;
  max-width: 300px;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast.success {
  background-color: #dc2626;
}

.toast.error {
  background-color: #ef4444;
}

.toast.info {
  background-color: #dc2626;
}

.toast.warning {
  background-color: #f59e0b;
  color: #1f2937;
}

/* =============================================================================
   PAGE LAYOUT COMPONENTS
   ============================================================================= */

/* Layout containers */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Header */
header {
  background: #000000;
  border-bottom: 1px solid #dc2626;
}

header .container {
  padding: 0.75rem 1rem;
  text-align: center;
}

header h1 {
  font-size: 1.875rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: #ffffff;
}

header h1 .title-text {
  background: linear-gradient(135deg, #dc2626, #991b1b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo {
  position: relative;
  font-size: 2rem;
  filter: drop-shadow(0 2px 4px rgba(220, 38, 38, 0.3));
  animation: logoGlow 3s ease-in-out infinite alternate;
}

@keyframes logoGlow {
  from {
    filter: drop-shadow(0 2px 4px rgba(220, 38, 38, 0.3));
  }
  to {
    filter: drop-shadow(0 4px 8px rgba(220, 38, 38, 0.6));
  }
}

.subtitle {
  color: #a3a3a3;
  font-size: 1.125rem;
  font-weight: 500;
}

/* Navigation Tabs */
.tab-navigation-main {
  background: #000000;
  border-bottom: 1px solid #dc2626;
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  padding: 0.5rem;
  overflow-x: auto;
  position: sticky;
  top: 0;
  z-index: 40;
}

.tab-button-main {
  background: none;
  border: none;
  padding: 0.75rem 0.5rem;
  font-size: 1rem;
  font-weight: 500;
  color: #a3a3a3;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: color 0.15s ease;
  position: relative;
  white-space: nowrap;
}

.tab-button-main:hover {
  color: #ffffff;
}

.tab-button-main.active {
  color: #dc2626;
}

.tab-button-main.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: #dc2626;
  border-radius: 0.125rem;
}

.tab-icon {
  font-size: 1.125rem;
}

.tab-label {
  font-weight: 600;
}

/* Status Bar */
.status-bar {
  background: #262626;
  padding: 0.25rem 1rem;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.75rem;
  border-bottom: 1px solid #525252;
  color: #a3a3a3;
  font-family: -apple-system, BlinkMacSystemFont, "SF Mono", Consolas, monospace;
}

.status-item {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.status-label {
  font-weight: 500;
}

.status-value {
  font-weight: 600;
  color: #ffffff;
}

/* Tab Content */
.tab-content-main {
  display: none;
  padding: 2rem 0;
  flex: 1;
}

.tab-content-main.active {
  display: block;
}

/* Main container */
main {
  flex: 1;
}

/* Footer */
footer {
  background: #000000;
  border-top: 1px solid #dc2626;
  padding: 1rem;
  text-align: center;
  color: #a3a3a3;
  font-size: 0.875rem;
}

footer a {
  color: #dc2626;
  text-decoration: none;
}

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

/* Page Specific Components */

/* Firehose Control Panel */
.firehose-control-panel {
  background: #000000;
  border: 1px solid #dc2626;
  border-radius: 0.5rem;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.control-row {
  display: flex;
  gap: 1.5rem;
  align-items: end;
  margin-bottom: 1rem;
}

.control-group {
  flex: 1;
}

.control-group label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: #ffffff;
}

.control-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.control-btn {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 0.375rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.control-btn.primary {
  background: #dc2626;
  color: white;
  border: 1px solid #b91c1c;
}

.control-btn.primary:hover {
  background: #b91c1c;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(220, 38, 38, 0.3);
}

.control-btn.secondary {
  background: #000000;
  color: white;
  border: 1px solid #dc2626;
}

.control-btn.secondary:hover {
  background: #262626;
  border-color: #b91c1c;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(220, 38, 38, 0.2);
}

.control-btn.tertiary {
  background: #262626;
  color: #a3a3a3;
  border: 1px solid #525252;
}

.control-btn.tertiary:hover {
  background: #404040;
  color: white;
  border-color: #737373;
  transform: translateY(-1px);
}

.control-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.status-inline {
  font-weight: 600;
  color: #6b7280;
}

/* Search Components */
.tab-controls {
  background: #000000;
  border: 1px solid #dc2626;
  border-radius: 0.5rem;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.search-bar {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
  align-items: center;
}

.search-bar input {
  flex: 1;
  padding: 0.75rem;
  border: 1px solid #525252;
  border-radius: 0.375rem;
  font-size: 1rem;
  background: #262626;
  color: #ffffff;
}

.search-bar button {
  padding: 0.75rem 1.5rem;
  background: #dc2626;
  color: white;
  border: none;
  border-radius: 0.375rem;
  font-weight: 500;
  cursor: pointer;
}

.search-bar button:hover {
  background: #b91c1c;
}

.search-options {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.search-options label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: #a3a3a3;
}

.search-options input[type="number"] {
  width: 4rem;
  padding: 0.25rem 0.5rem;
  border: 1px solid #525252;
  border-radius: 0.25rem;
  background: #262626;
  color: #ffffff;
}

/* Settings Components */
.settings-content {
  max-width: 800px;
  margin: 0 auto;
}

.setting-group {
  background: #000000;
  border: 1px solid #dc2626;
  border-radius: 0.5rem;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.setting-group h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #ffffff;
  border-bottom: 1px solid #dc2626;
  padding-bottom: 0.5rem;
}

.setting-item {
  margin-bottom: 1rem;
}

.setting-item:last-child {
  margin-bottom: 0;
}

.setting-item label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: #ffffff;
}

.setting-item input,
.setting-item textarea,
.setting-item select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #525252;
  border-radius: 0.375rem;
  font-size: 1rem;
  background: #262626;
  color: #ffffff;
}

.setting-item button {
  padding: 0.5rem 1rem;
  margin-right: 0.5rem;
  margin-top: 0.5rem;
  border: none;
  border-radius: 0.375rem;
  font-weight: 500;
  cursor: pointer;
  background: #dc2626;
  color: white;
}

.setting-item button:hover {
  background: #b91c1c;
}

.setting-item button.secondary {
  background: #6b7280;
}

.setting-item button.secondary:hover {
  background: #4b5563;
}

/* Nostr Settings - Simplified UI */
.key-actions {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.key-action-btn {
  padding: 0.5rem 1rem;
  background: #059669;
  color: white;
  border: none;
  border-radius: 0.375rem;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background-color 0.2s;
}

.key-action-btn:hover {
  background: #047857;
}

.import-section {
  margin-top: 0.75rem;
  padding: 1rem;
  background: #262626;
  border: 1px solid #525252;
  border-radius: 0.375rem;
}

.import-section input {
  margin-bottom: 0.75rem;
}

.import-section button {
  margin-right: 0.5rem;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 0.375rem;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
}

.key-display {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.key-display input {
  flex: 1;
}

.key-buttons {
  display: flex;
  gap: 0.5rem;
}

.key-buttons button {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 0.375rem;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background-color 0.2s;
}

.danger-btn {
  background: #dc2626 !important;
  color: white;
}

.danger-btn:hover {
  background: #b91c1c !important;
}

.primary-btn {
  background: #2563eb;
  color: white;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
}

.primary-btn:hover {
  background: #1d4ed8;
}

.secondary-btn {
  background: #64748b;
  color: white;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  border: none;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: all 0.2s;
}

.secondary-btn:hover {
  background: #475569;
}

.relay-actions {
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

.setting-description {
  font-size: 0.875rem;
  color: #94a3b8;
  margin-top: 0.25rem;
}

.setting-value {
  font-weight: 500;
  color: #e2e8f0;
}

.danger-button {
  background: #dc2626 !important;
  color: white;
}

.danger-button:hover {
  background: #b91c1c !important;
}

/* Content Areas */
.post-stream,
.post-list {
  background: #1e293b;
  border: 1px solid #475569;
  border-radius: 0.5rem;
  min-height: 400px;
  overflow-y: auto;
}

.empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 300px;
  color: #94a3b8;
  font-style: italic;
  text-align: center;
}

.empty-state p {
  font-size: 1.125rem;
}

/* Control Group Input Styling */
.control-group input {
  background: #334155;
  border: 1px solid #475569;
  color: #f8fafc;
  padding: 0.75rem;
  border-radius: 0.375rem;
  font-size: 1rem;
  width: 100%;
}

.control-group input:focus {
  outline: none;
  border-color: #0085ff;
  box-shadow: 0 0 0 2px rgba(0, 133, 255, 0.2);
}

.control-group input::placeholder {
  color: #94a3b8;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .control-row {
    flex-direction: column;
    align-items: stretch;
  }

  .search-bar {
    flex-direction: column;
  }

  .search-options {
    flex-direction: column;
    align-items: flex-start;
  }

  .control-actions {
    flex-direction: column;
  }

  header .container {
    padding: 0.5rem 1rem;
  }

  header h1 {
    font-size: 1.5rem;
  }

  .logo {
    font-size: 1.75rem;
  }
}