/* ========================================
   Musk v. OpenAI Document Explorer
   Dark Theme, Mobile-First Design
   ======================================== */

:root {
  /* Colors - Deep investigative journalism aesthetic */
  --bg-primary: #0a0a0b;
  --bg-secondary: #111114;
  --bg-tertiary: #18181c;
  --bg-card: #1a1a1f;
  --bg-card-hover: #222228;
  --bg-modal: #0f0f12;
  
  --text-primary: #f5f5f7;
  --text-secondary: #a0a0a8;
  --text-muted: #6b6b74;
  
  --accent-primary: #f5a623;
  --accent-secondary: #e8940d;
  --accent-glow: rgba(245, 166, 35, 0.15);
  
  --juice-10: #ff3b3b;
  --juice-9: #ff5722;
  --juice-8: #ff9800;
  --juice-7: #ffc107;
  --juice-6: #cddc39;
  --juice-5: #8bc34a;
  --juice-low: #4a4a52;
  
  --border-color: #2a2a32;
  --border-subtle: #1f1f26;
  
  --success: #4caf50;
  --warning: #ff9800;
  --danger: #f44336;
  
  /* Typography */
  --font-display: 'Sora', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', monospace;
  
  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  
  /* Layout */
  --header-height: 100px;
  --tab-bar-height: 70px;
  --safe-area-bottom: env(safe-area-inset-bottom, 0px);
  
  /* Animation */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-display);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ========================================
   Header
   ======================================== */

.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-primary) 80%, transparent 100%);
  padding: var(--space-md) var(--space-md) var(--space-lg);
}

.header-content {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.case-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--accent-primary);
  background: var(--accent-glow);
  padding: 4px 12px;
  border-radius: 4px;
  margin-bottom: var(--space-sm);
  border: 1px solid rgba(245, 166, 35, 0.3);
}

.case-title {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.case-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: var(--space-xs);
}

/* ========================================
   Main Content Area
   ======================================== */

.app-main {
  padding-bottom: calc(var(--tab-bar-height) + var(--safe-area-bottom) + var(--space-md));
}

.view {
  display: none;
  padding: 0 var(--space-md);
  max-width: 800px;
  margin: 0 auto;
  animation: fadeIn 0.3s var(--ease-out);
}

.view.active {
  display: block;
}

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

/* ========================================
   Filter Bar
   ======================================== */

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
  padding: var(--space-md);
  background: var(--bg-secondary);
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
}

.filter-group {
  flex: 1;
  min-width: 200px;
}

.filter-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-sm);
}

.juice-filter {
  display: flex;
  gap: 4px;
}

.juice-btn {
  flex: 1;
  padding: 8px 4px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s var(--ease-out);
}

.juice-btn:hover {
  background: var(--bg-card);
  color: var(--text-secondary);
}

.juice-btn.active {
  background: var(--accent-glow);
  color: var(--accent-primary);
  border-color: var(--accent-primary);
}

.sort-group {
  min-width: 140px;
}

.sort-select {
  width: 100%;
  padding: 10px 12px;
  font-family: var(--font-display);
  font-size: 0.875rem;
  color: var(--text-primary);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b6b74' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

.sort-select:focus {
  outline: none;
  border-color: var(--accent-primary);
}

.doc-count {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: var(--space-md);
  padding-left: var(--space-xs);
}

/* ========================================
   Documents List
   ======================================== */

.documents-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.doc-card {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s var(--ease-out);
}

.doc-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-color);
  transform: translateX(4px);
}

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

.doc-card-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  flex-shrink: 0;
}

.doc-number {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

.juice-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 6px;
  color: var(--bg-primary);
}

.juice-badge[data-juice="10"] { background: var(--juice-10); }
.juice-badge[data-juice="9"] { background: var(--juice-9); }
.juice-badge[data-juice="8"] { background: var(--juice-8); }
.juice-badge[data-juice="7"] { background: var(--juice-7); }
.juice-badge[data-juice="6"] { background: var(--juice-6); }
.juice-badge[data-juice="5"] { background: var(--juice-5); }
.juice-badge[data-juice="4"],
.juice-badge[data-juice="3"],
.juice-badge[data-juice="2"],
.juice-badge[data-juice="1"],
.juice-badge[data-juice="0"] { 
  background: var(--juice-low); 
  color: var(--text-secondary);
}

.doc-card-content {
  flex: 1;
  min-width: 0;
}

.doc-type {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--accent-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.doc-summary {
  font-size: 0.9rem;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.doc-card-arrow {
  flex-shrink: 0;
  color: var(--text-muted);
  opacity: 0;
  transform: translateX(-4px);
  transition: all 0.2s var(--ease-out);
}

.doc-card:hover .doc-card-arrow {
  opacity: 1;
  transform: translateX(0);
}

/* PDF Links */
.pdf-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: var(--space-sm);
  padding: 6px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-primary);
  background: var(--accent-glow);
  border: 1px solid rgba(245, 166, 35, 0.3);
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.2s var(--ease-out);
}

.pdf-link:hover {
  background: rgba(245, 166, 35, 0.25);
  border-color: var(--accent-primary);
  transform: translateY(-1px);
}

.pdf-link svg {
  flex-shrink: 0;
}

.pdf-link-large {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  width: 100%;
  padding: var(--space-md);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  background: linear-gradient(135deg, var(--bg-tertiary) 0%, rgba(245, 166, 35, 0.1) 100%);
  border: 1px solid var(--accent-primary);
  border-radius: 10px;
  text-decoration: none;
  transition: all 0.2s var(--ease-out);
}

.pdf-link-large:hover {
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(245, 166, 35, 0.2) 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(245, 166, 35, 0.2);
}

.pdf-link-large svg {
  color: var(--accent-primary);
}

.pdf-link-small {
  margin-left: auto;
  padding: 3px 8px;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--accent-primary);
  background: var(--accent-glow);
  border: 1px solid rgba(245, 166, 35, 0.3);
  border-radius: 4px;
  text-decoration: none;
  transition: all 0.2s var(--ease-out);
}

.pdf-link-small:hover {
  background: rgba(245, 166, 35, 0.25);
  border-color: var(--accent-primary);
}

/* ========================================
   Section Titles
   ======================================== */

.section-title {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: var(--space-lg);
}

.section-title .icon {
  font-size: 1.5rem;
}

/* ========================================
   Highlights Section
   ======================================== */

.highlights-container {
  padding-bottom: var(--space-xl);
}

.highlight-section {
  margin-bottom: var(--space-2xl);
}

/* Top 10 List */
.top10-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.top10-card {
  position: relative;
  padding: var(--space-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s var(--ease-out);
  overflow: hidden;
}

.top10-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--accent-primary);
}

.top10-card:hover {
  background: var(--bg-card-hover);
  transform: translateX(4px);
}

.top10-rank {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 700;
  color: var(--bg-tertiary);
  line-height: 1;
}

.top10-header {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  margin-bottom: var(--space-sm);
}

.top10-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
}

.top10-exhibit {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
}

.top10-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* Smoking Guns */
.smoking-guns-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.smoking-gun-card {
  padding: var(--space-lg);
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(245, 87, 34, 0.05) 100%);
  border: 1px solid rgba(245, 87, 34, 0.2);
  border-radius: 12px;
}

.smoking-gun-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--juice-9);
  margin-bottom: var(--space-md);
}

.smoking-gun-quote {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 400;
  font-style: italic;
  color: var(--text-primary);
  line-height: 1.6;
  padding-left: var(--space-md);
  border-left: 3px solid var(--juice-9);
  margin-bottom: var(--space-sm);
}

.smoking-gun-attribution {
  font-size: 0.8rem;
  color: var(--text-muted);
  padding-left: var(--space-md);
}

/* Revelations */
.revelations-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.revelation-card {
  padding: var(--space-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
}

.revelation-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent-primary);
  margin-bottom: var(--space-sm);
}

.revelation-content {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* Recommended Reading */
.recommended-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.recommended-card {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s var(--ease-out);
}

.recommended-card:hover {
  background: var(--bg-card-hover);
  transform: translateX(4px);
}

.recommended-rank {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent-primary);
  background: var(--accent-glow);
  border-radius: 8px;
  flex-shrink: 0;
}

.recommended-content {
  flex: 1;
}

.recommended-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.recommended-reason {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ========================================
   Quotes Gallery
   ======================================== */

.quotes-container {
  padding-bottom: var(--space-xl);
}

.quotes-gallery {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.quote-card {
  padding: var(--space-xl);
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-tertiary) 100%);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  position: relative;
}

.quote-card::before {
  content: '"';
  position: absolute;
  top: var(--space-md);
  left: var(--space-lg);
  font-family: Georgia, serif;
  font-size: 4rem;
  color: var(--accent-primary);
  opacity: 0.3;
  line-height: 1;
}

.quote-text {
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--text-primary);
  line-height: 1.7;
  margin-bottom: var(--space-md);
  padding-left: var(--space-xl);
}

.quote-attribution {
  font-size: 0.85rem;
  color: var(--text-muted);
  padding-left: var(--space-xl);
}

.quote-attribution strong {
  color: var(--accent-primary);
  font-weight: 600;
}

.quote-card.clickable {
  cursor: pointer;
  transition: all 0.2s var(--ease-out);
}

.quote-card.clickable:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(245, 166, 35, 0.15);
  border-color: var(--accent-primary);
}

.quote-card.clickable:active {
  transform: translateY(-2px);
}

.quote-doc-link {
  display: block;
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-subtle);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-primary);
  text-align: right;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.quote-card.clickable:hover .quote-doc-link {
  opacity: 1;
}

/* ========================================
   Search View
   ======================================== */

.search-container {
  padding-top: var(--space-md);
}

.search-box {
  position: relative;
  margin-bottom: var(--space-lg);
}

.search-icon {
  position: absolute;
  left: var(--space-md);
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: var(--space-md);
  padding-left: 48px;
  padding-right: 48px;
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--text-primary);
  background: var(--bg-secondary);
  border: 2px solid var(--border-color);
  border-radius: 12px;
  transition: all 0.2s var(--ease-out);
}

.search-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  background: var(--bg-tertiary);
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-clear {
  position: absolute;
  right: var(--space-sm);
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  font-size: 1.5rem;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s;
}

.search-clear:hover {
  color: var(--text-primary);
  background: var(--bg-card);
}

.search-results {
  min-height: 200px;
}

.search-placeholder {
  text-align: center;
  padding: var(--space-2xl) var(--space-md);
  color: var(--text-muted);
}

.search-placeholder .hint {
  font-size: 0.875rem;
  margin-top: var(--space-sm);
  color: var(--text-muted);
  opacity: 0.7;
}

.search-result-count {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: var(--space-md);
}

.search-results-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.search-result-card {
  padding: var(--space-md);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s var(--ease-out);
}

.search-result-card:hover {
  background: var(--bg-card-hover);
  transform: translateX(4px);
}

.search-result-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-xs);
}

.search-result-id {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-primary);
}

.search-result-type {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.search-result-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.search-result-text mark {
  background: var(--accent-glow);
  color: var(--accent-primary);
  padding: 0 2px;
  border-radius: 2px;
}

/* ========================================
   Modal
   ======================================== */

.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: flex-end;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.3s var(--ease-out);
}

.modal-content {
  position: relative;
  width: 100%;
  max-width: 800px;
  max-height: 95vh;
  max-height: 95dvh;
  background: var(--bg-modal);
  border-radius: 20px 20px 0 0;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.4s var(--ease-out);
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

/* Mobile: compact header, maximize content area */
@media screen and (max-width: 600px) {
  .modal-content {
    max-height: 100vh;
    max-height: 100dvh;
    height: calc(100vh - 20px);
    height: calc(100dvh - 20px);
    border-radius: 16px 16px 0 0;
  }
  
  .modal-header {
    position: relative;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-subtle);
    flex-shrink: 0;
    min-height: auto;
  }
  
  .modal-title-area {
    margin-bottom: 2px;
    flex-shrink: 0;
  }
  
  .modal-title {
    font-size: 0.9rem;
    line-height: 1.35;
    padding-right: 36px;
    margin-bottom: 0;
  }
  
  .modal-type {
    font-size: 0.65rem;
    margin-bottom: 0;
  }
  
  .modal-close {
    width: 28px;
    height: 28px;
    top: 8px;
    right: 8px;
  }
  
  .modal-close svg {
    width: 14px;
    height: 14px;
  }
  
  .modal-body {
    padding: 12px;
    flex: 1;
    overflow-y: auto;
  }
  
  .modal-nav {
    padding: 8px 12px;
    padding-bottom: calc(8px + var(--safe-area-bottom));
    flex-shrink: 0;
  }
  
  .nav-btn {
    padding: 8px 12px;
    font-size: 0.8rem;
  }
  
  /* Compact PDF button on mobile */
  .pdf-link-large {
    padding: 10px 12px;
    font-size: 0.8rem;
  }
}

.modal-header {
  padding: var(--space-lg);
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.modal-close {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s;
  z-index: 10;
}

.modal-close svg {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
}

.modal-close:hover {
  background: var(--bg-card);
}

.modal-close:hover svg {
  color: var(--text-primary);
}

.modal-title-area {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}

.doc-id-badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-tertiary);
  padding: 4px 8px;
  border-radius: 4px;
  flex-shrink: 0;
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
  padding-right: 48px;
}

.modal-type {
  font-size: 0.8rem;
  color: var(--accent-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-lg);
  -webkit-overflow-scrolling: touch;
}

.modal-section {
  margin-bottom: var(--space-xl);
}

.modal-section-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-sm);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.modal-section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}

.modal-section-content {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.8;
}

.modal-section-content p {
  margin-bottom: var(--space-md);
}

.modal-section-content strong {
  color: var(--text-primary);
}

.modal-quote {
  padding: var(--space-md);
  margin: var(--space-md) 0;
  background: var(--bg-tertiary);
  border-left: 3px solid var(--accent-primary);
  border-radius: 0 8px 8px 0;
  font-style: italic;
  color: var(--text-primary);
}

.modal-people-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.person-tag {
  font-size: 0.8rem;
  color: var(--text-secondary);
  background: var(--bg-tertiary);
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--border-subtle);
}

/* Mobile modal section adjustments */
@media (max-width: 767px) {
  .modal-section {
    margin-bottom: var(--space-lg);
  }
  
  .modal-section-content {
    font-size: 0.9rem;
    line-height: 1.7;
  }
  
  .modal-quote {
    padding: var(--space-sm) var(--space-md);
    margin: var(--space-sm) 0;
    font-size: 0.9rem;
  }
  
  .person-tag {
    font-size: 0.7rem;
    padding: 3px 8px;
  }
  
  .pdf-link-large {
    padding: var(--space-sm) var(--space-md);
    font-size: 0.8rem;
  }
  
  .pdf-link-large svg {
    width: 16px;
    height: 16px;
  }
}

.modal-nav {
  display: flex;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  padding-bottom: calc(var(--space-md) + var(--safe-area-bottom));
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-secondary);
}

.nav-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md);
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s var(--ease-out);
}

.nav-btn svg {
  width: 18px;
  height: 18px;
}

.nav-btn:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

.nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* ========================================
   Tab Bar
   ======================================== */

.tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 150;
  display: flex;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-subtle);
  padding-bottom: var(--safe-area-bottom);
}

.tab-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: var(--space-sm) 0;
  background: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s var(--ease-out);
}

.tab-btn svg {
  width: 24px;
  height: 24px;
  color: var(--text-muted);
  transition: all 0.2s var(--ease-out);
}

.tab-btn span {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: all 0.2s var(--ease-out);
}

.tab-btn:hover svg,
.tab-btn:hover span {
  color: var(--text-secondary);
}

.tab-btn.active svg,
.tab-btn.active span {
  color: var(--accent-primary);
}

.tab-btn.active svg {
  filter: drop-shadow(0 0 8px var(--accent-primary));
}

/* ========================================
   Loading State
   ======================================== */

.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-2xl);
  gap: var(--space-md);
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-color);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.loading-text {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ========================================
   Responsive - Tablet and Desktop
   ======================================== */

@media (min-width: 768px) {
  :root {
    --header-height: 120px;
  }
  
  .case-title {
    font-size: 2.5rem;
  }
  
  .case-subtitle {
    font-size: 1rem;
  }
  
  .documents-list {
    gap: var(--space-md);
  }
  
  .doc-card {
    padding: var(--space-lg);
  }
  
  .modal-content {
    max-height: 85vh;
    border-radius: 20px;
    margin: auto;
    margin-bottom: 5vh;
  }
  
  .quotes-gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-lg);
  }
  
  .top10-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
  }
  
  .top10-card:first-child {
    grid-column: 1 / -1;
  }
}

@media (min-width: 1024px) {
  .tab-bar {
    position: fixed;
    top: 0;
    bottom: auto;
    left: 0;
    right: auto;
    width: 80px;
    height: 100vh;
    flex-direction: column;
    justify-content: center;
    border-top: none;
    border-right: 1px solid var(--border-subtle);
    padding-bottom: 0;
  }
  
  .tab-btn {
    padding: var(--space-md) 0;
  }
  
  .app-header {
    margin-left: 80px;
  }
  
  .app-main {
    margin-left: 80px;
    padding-bottom: var(--space-xl);
  }
  
  .view {
    max-width: 1000px;
  }
}

/* ========================================
   Utility Classes
   ======================================== */

/* ========================================
   Footer Credit
   ======================================== */

.app-footer {
  text-align: center;
  padding: var(--space-xl) var(--space-md);
  padding-bottom: calc(var(--tab-bar-height) + var(--safe-area-bottom) + var(--space-xl));
  color: var(--text-muted);
  font-size: 0.8rem;
}

.app-footer a {
  color: var(--accent-primary);
  text-decoration: none;
  font-weight: 600;
  transition: opacity 0.2s;
}

.app-footer a:hover {
  opacity: 0.8;
  text-decoration: underline;
}

.footer-sub {
  margin-top: var(--space-xs);
  font-size: 0.7rem;
  opacity: 0.6;
}

@media (min-width: 1024px) {
  .app-footer {
    margin-left: 80px;
    padding-bottom: var(--space-xl);
  }
}

/* ========================================
   Utility Classes
   ======================================== */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
