/* ===== MODERN REVISIONS PANEL STYLING ===== */

/* CSS Variables for consistent theming */
:root {
  --primary-blue: #3b82f6;
  --primary-blue-dark: #2563eb;
  --secondary-blue: #6366f1;
  --accent-purple: #8b5cf6;
  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --bg-primary: #ffffff;
  --bg-secondary: #f9fafb;
  --bg-tertiary: #f3f4f6;
  --border-light: #e5e7eb;
  --border-medium: #d1d5db;
  --success-green: #10b981;
  --warning-orange: #f59e0b;
  --danger-red: #ef4444;
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --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);
}

/* Old revs-header styles removed - now using collapsible header */

/* ===== HIGHLIGHT LEGEND ===== */
.hl-legend {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  padding: 1rem 1.25rem;
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}

.hl-key {
  display: flex;
    align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.hl-key i {
  width: 16px;
  height: 16px;
  border-radius: var(--radius-sm);
  display: inline-block;
  flex-shrink: 0;
}

.hl-key .k-term {
  background: var(--warning-orange);
}

.hl-key .k-sent {
  background: var(--primary-blue);
}

/* ===== ANNOTATED TRANSCRIPT ===== */
.annotated-transcript {
  background: var(--bg-secondary);
  border-left: 4px solid var(--primary-blue);
  padding: 1.25rem;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.6;
  color: var(--text-primary);
  font-size: 0.95rem;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

/* ===== UPLOAD SUMMARY ===== */
.upload-summary {
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-top: 1rem;
  box-shadow: var(--shadow-sm);
}

.summary-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-light);
}

.summary-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.summary-item .label {
  font-weight: 600;
  color: var(--text-primary);
  min-width: 120px;
  flex-shrink: 0;
  font-size: 0.9rem;
}

.summary-item .value {
  color: var(--text-secondary);
  font-size: 0.9rem;
    line-height: 1.4;
}

.summary-item .muted {
  color: var(--text-muted);
  font-size: 0.8rem;
  font-style: italic;
}

.summary-item .pending {
  color: var(--warning-orange);
  font-weight: 600;
}

.summary-item.uploaded-at {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: none;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ===== RISK ANALYSIS SECTION ===== */
.risk-analysis-content {
  padding: 1rem 1.25rem;
}

.risk-items {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1rem;
}

.risk-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem;
  background: white;
  border-radius: 8px;
  border: 1px solid var(--border-light);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.risk-content h4 {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 0.5rem 0;
  color: var(--text-primary);
}

.risk-content p {
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 0 0 0.5rem 0;
  color: var(--text-secondary);
}

.risk-advice {
  font-size: 0.85rem;
  color: var(--warning-orange);
  font-style: italic;
}

.risk-tag {
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.risk-tag.high-risk {
  background: #dc3545;
  color: white;
}

.risk-tag.medium-risk {
  background: #ffc107;
  color: #212529;
}

.risk-tag.low-risk {
  background: #6c757d;
  color: white;
}

.recommendation {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.5rem;
  background: #d4edda;
  border-radius: 8px;
  border: 1px solid #c3e6cb;
  margin-top: 1rem;
}

.rec-icon {
  background: #28a745;
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 600;
  flex-shrink: 0;
}

.rec-content h4 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.5rem 0;
  color: #155724;
}

.rec-content p {
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 0;
  color: #155724;
}

/* ===== NO RISK ANALYSIS STATE ===== */
.no-risk-analysis {
  text-align: center;
  padding: 2rem;
  color: var(--text-secondary);
}

.no-risk-analysis p {
  margin-bottom: 1.5rem;
  font-size: 1rem;
}

.no-risk-analysis .btn {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
}

/* ===== REVISION GROUPS ===== */
.revs-group {
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.revs-group > summary {
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
  padding: 1rem 1.25rem;
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-primary);
  cursor: pointer;
  user-select: none;
  border: none;
  outline: none;
  transition: all 0.3s ease;
  position: relative;
  list-style: none;
}

.revs-group > summary::-webkit-details-marker {
  display: none;
}

.revs-group > summary::marker {
  display: none;
}

.revs-group > summary:hover {
  background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--border-light) 100%);
}

.revs-group > summary::before {
  content: "▶";
  display: inline-block;
  margin-right: 0.75rem;
  transition: transform 0.3s ease;
  color: var(--primary-blue);
}

.revs-group[open] > summary::before {
  transform: rotate(90deg);
}

.revs-group > summary i {
  font-size: 1rem;
  width: 1.25rem;
  text-align: center;
  flex-shrink: 0;
  margin-right: 0.5rem;
}

/* Color-coded sections */
.revs-group--files > summary {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border-color: #0ea5e9;
}

.revs-group--files > summary:hover {
  background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
}

.revs-group--files > summary i {
  color: #0ea5e9;
}

.revs-group--risk > summary {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border-color: #f59e0b;
}

.revs-group--risk > summary:hover {
  background: linear-gradient(135deg, #fde68a 0%, #fcd34d 100%);
}

.revs-group--risk > summary i {
  color: #f59e0b;
}

.revs-group--page > summary {
  background: linear-gradient(135deg, #f3e8ff 0%, #e9d5ff 100%);
  border-color: #8b5cf6;
}

.revs-group--page > summary:hover {
  background: linear-gradient(135deg, #e9d5ff 0%, #ddd6fe 100%);
}

.revs-group--page > summary i {
  color: #8b5cf6;
}

.revs-group--complex > summary {
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  border-color: #10b981;
}

.revs-group--complex > summary:hover {
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
}

.revs-group--complex > summary i {
  color: #10b981;
}

.revs-group--jargon > summary {
  background: linear-gradient(135deg, #fef2f2 0%, #fecaca 100%);
  border-color: #ef4444;
}

.revs-group--jargon > summary:hover {
  background: linear-gradient(135deg, #fecaca 0%, #fca5a5 100%);
}

.revs-group--jargon > summary i {
  color: #ef4444;
}

/* Header section - neutral gray theme */
.revs-group--header > summary {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-color: #64748b;
}

.revs-group--header > summary:hover {
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
}

.revs-group--header > summary i {
  color: #64748b;
}

.revs-group--header .doc-title {
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text-primary);
  flex: 1;
}

.revs-group--header .expand-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 400;
  font-style: italic;
  margin-left: auto;
}

.revs-header-content {
  padding: 1rem 1.25rem;
}

/* ===== DOCUMENT NAVIGATION ===== */
.revs-navigation {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

/* Main page document navigation */
.document-navigation {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: #f8f9fa;
  border-bottom: 1px solid #e9ecef;
  margin-bottom: 0;
}

.document-navigation .nav-arrow {
  background: #007bff;
  color: white;
  border: none;
  border-radius: 6px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
}

.document-navigation .nav-arrow:hover:not(:disabled) {
  background: #0056b3;
  transform: translateY(-1px);
}

.document-navigation .nav-arrow:disabled {
  background: #6c757d;
  cursor: not-allowed;
  opacity: 0.6;
}

.document-navigation .doc-counter {
  font-size: 14px;
  font-weight: 500;
  color: #495057;
  min-width: 60px;
  text-align: center;
}

/* Revs container should take full height of tab-content */
#revs-container {
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* Docs container should also have proper height constraints */
#docs-container {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.revs-content {
  flex: 1;
  min-width: 0; /* Allow content to shrink */
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  max-height: calc(100vh - 200px); /* Account for header, tabs, and navigation */
}

/* Mobile adjustments for revs-content */
@media (max-width: 900px) {
  .revs-content {
    max-height: calc(100vh - 150px); /* Smaller offset on mobile */
  }
}

.nav-arrow {
  position: sticky;
  top: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: 50%;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 10;
  flex-shrink: 0;
}

.nav-arrow:hover:not(:disabled) {
  background: var(--primary-blue);
  color: white;
  border-color: var(--primary-blue);
  transform: scale(1.05);
  box-shadow: var(--shadow-md);
}

.nav-arrow:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.nav-arrow i {
  font-size: 0.875rem;
}

.nav-arrow--prev {
  margin-right: 0.5rem;
}

.nav-arrow--next {
  margin-left: 0.5rem;
}

.revs-group[open] > summary {
  border-bottom: 1px solid var(--border-light);
}

/* Add padding to revs-group content */
.revs-group > *:not(summary) {
  padding: 1rem 1.25rem;
}

/* Old downloads section removed - now using collapsible file downloads */

/* ===== REVISION LISTS ===== */
.revs-list {
  list-style: none;
  counter-reset: rev;
  padding: 0;
  margin: 0;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 1rem;
}

.revs-list li {
  counter-increment: rev;
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  margin-bottom: 1.5rem;
  padding: 1.25rem;
  position: relative;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
}

.revs-list li:last-child {
  margin-bottom: 0;
}

.revs-list li:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.revs-list li::before {
  content: counter(rev);
  position: absolute;
  top: -0.5rem;
  left: 1rem;
  background: var(--primary-blue);
  color: white;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
  box-shadow: var(--shadow-sm);
}
/* ===== EXPLAIN CARDS ===== */
.explain-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
  position: relative;
}

/* Add vertical colored bars for different card types */
.explain-card--jargon {
  border-left: 4px solid #ffc107;
}

.explain-card--sentence {
  border-left: 4px solid #17a2b8;
}

.explain-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.explain-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.explain-card__title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.4;
  flex: 1;
}

/* ===== BADGES ===== */
.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

.badge--sent {
  background: #17a2b8;
  color: white;
}

.badge--term {
  background: #ffc107;
  color: #212529;
}

/* ===== EXPLAIN CARD ROWS ===== */
.explain-card__row {
  margin-bottom: 0.75rem;
}

.explain-card__row:last-child {
  margin-bottom: 0;
}

.explain-card__key {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.explain-card__body {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
  background: var(--bg-secondary);
  padding: 0.75rem;
  border-radius: var(--radius-md);
  border-left: 3px solid var(--primary-blue);
}

.explain-card__row--rewrite .explain-card__body {
  border-left-color: var(--success-green);
  background: rgba(16, 185, 129, 0.05);
}

/* ===== NO DOCUMENT PLACEHOLDER ===== */
.no-doc-placeholder {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--text-muted);
  font-style: italic;
  background: var(--bg-secondary);
  border: 2px dashed var(--border-light);
  border-radius: var(--radius-xl);
  margin: 2rem 0;
}
/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
  /* Old revs-header styles removed */
  
  .nav-arrow {
    width: 2rem;
    height: 2rem;
  }
  
  .nav-arrow i {
    font-size: 0.75rem;
  }
  
  .hl-legend {
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
  }
  
  .upload-summary {
    padding: 1rem;
  }
  
  .summary-item {
    flex-direction: column;
    gap: 0.25rem;
  }
  
  .summary-item .label {
    min-width: auto;
  }
  
  /* Old downloads styles removed */
  
  .revs-group > summary {
    padding: 0.875rem 1rem;
    font-size: 0.95rem;
  }
  
  .annotated-transcript {
    padding: 1rem;
    font-size: 0.9rem;
  }
  
  .explain-card {
    padding: 1rem;
  }
  
  .explain-card__head {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }
  
  .explain-card__title {
    font-size: 0.95rem;
  }
}

@media (max-width: 480px) {
  /* Old revs-header styles removed */
  
  .upload-summary {
    padding: 0.875rem;
  }
  
  /* Old downloads styles removed */
  
  .revs-group > summary {
    padding: 0.75rem 0.875rem;
    font-size: 0.9rem;
  }
  
  .annotated-transcript {
    padding: 0.875rem;
    font-size: 0.85rem;
  }
  
  .explain-card {
    padding: 0.875rem;
  }
  
  .explain-card__body {
    padding: 0.625rem;
    font-size: 0.85rem;
  }
}

/* ===== DARK MODE SUPPORT ===== */
@media (prefers-color-scheme: dark) {
  :root {
    --text-primary: #f9fafb;
    --text-secondary: #d1d5db;
    --text-muted: #9ca3af;
    --bg-primary: #1f2937;
    --bg-secondary: #374151;
    --bg-tertiary: #4b5563;
    --border-light: #4b5563;
    --border-medium: #6b7280;
  }
  
  /* Old revs-header styles removed */
  
  .hl-legend {
    background: var(--bg-primary);
  }
  
  .upload-summary {
    background: var(--bg-primary);
  }
  
  /* Old downloads styles removed */
  
.revs-group {
    background: var(--bg-primary);
  }
  
  .revs-group > summary {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
  }
  
  .revs-group > summary:hover {
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--border-light) 100%);
  }
  
  .annotated-transcript {
    background: var(--bg-secondary);
  }
  
  .revs-list li {
    background: var(--bg-primary);
  }
  
  .explain-card {
    background: var(--bg-primary);
  }
  
  .explain-card__body {
    background: var(--bg-secondary);
  }
}

/* File Downloads Styles */
.file-downloads {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.file-download {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: 0.5rem;
  text-decoration: none;
  color: var(--text-primary);
  transition: all 0.2s ease;
}

.file-download:hover {
  background: var(--bg-hover);
  border-color: var(--primary-blue);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.file-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  background: var(--primary-blue);
  border-radius: 0.375rem;
  color: white;
  flex-shrink: 0;
}

.file-icon svg {
  width: 1.25rem;
  height: 1.25rem;
}

.file-info {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  flex: 1;
}

.file-name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.875rem;
}

.file-type {
  font-size: 0.75rem;
  color: var(--text-secondary);
}














