* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: #f5f5f5;
  color: #333;
  line-height: 1.6;
}

.container {
 
  min-height: 100vh;
}

.sidebar {
  width: 280px;
  background: #2c3e50;
  color: #ecf0f1;
  padding: 20px;
  position: fixed;
  height: 100vh;
  overflow-y: auto;
  z-index: 1000;
}

.sidebar h1 {
  font-size: 1.5rem;
  margin-bottom: 10px;
  color: #3498db;
}

.sidebar .meta {
  font-size: 0.85rem;
  color: #95a5a6;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid #34495e;
}

.sidebar input[type="search"] {
  width: 100%;
  padding: 10px;
  margin-bottom: 20px;
  border: none;
  border-radius: 4px;
  background: #34495e;
  color: #ecf0f1;
  font-size: 0.9rem;
}

.sidebar input[type="search"]::placeholder {
  color: #95a5a6;
}

/* Section grouping in sidebar */
.nav-group {
  margin-bottom: 25px;
}

.nav-group-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #7f8c8d;
  margin-bottom: 10px;
  font-weight: 700;
}

.nav-list {
  list-style: none;
}

.nav-list li {
  margin-bottom: 8px;
}

.nav-list a {
  color: #ecf0f1;
  text-decoration: none;
  display: block;
  padding: 8px 12px;
  border-radius: 4px;
  transition: background 0.2s;
}

.nav-list a:hover {
  background: #34495e;
}

.nav-list .count {
  float: right;
  background: #3498db;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.85rem;
}

/* CGO-specific nav styling */
.nav-list a.cgo-link .count {
  background: #00bfa5;
}

.main-content {
  margin-left: 280px;
  padding: 40px;
  flex: 1;
  max-width: 1200px;
}

/* Base section styling */
.section {
  background: white;
  border-radius: 8px;
  padding: 30px;
  margin-bottom: 30px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  border-left: 4px solid #3498db;
}

/* CGO/C section styling - distinct from Node.js */
.section.cgo-section {
  background: linear-gradient(to right, #e0f7fa 0%, #ffffff 15%);
  border-left: 4px solid #00bfa5;
}

.section-title {
  font-size: 2rem;
  margin-bottom: 20px;
  color: #2c3e50;
  border-bottom: 3px solid #3498db;
  padding-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.section.cgo-section .section-title {
  border-bottom-color: #00bfa5;
}

/* Language badges */
.lang-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.lang-badge.nodejs {
  background: #68a063;
  color: white;
}

.lang-badge.c {
  background: #00599c;
  color: white;
}

.lang-badge.cgo {
  background: #00bfa5;
  color: white;
}

details {
  margin-bottom: 15px;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  overflow: hidden;
}

/* CGO details have different border */
.cgo-section details {
  border-left: 3px solid #00bfa5;
}

summary {
  padding: 15px;
  cursor: pointer;
  background: #f8f9fa;
  font-weight: 600;
  user-select: none;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

summary:hover {
  background: #e9ecef;
}

details[open] summary {
  background: #3498db;
  color: white;
}

.cgo-section details[open] summary {
  background: #00bfa5;
}

.detail-content {
  padding: 20px;
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-right: 8px;
}

.badge-get { background: #28a745; color: white; }
.badge-post { background: #007bff; color: white; }
.badge-put { background: #ffc107; color: #333; }
.badge-delete { background: #dc3545; color: white; }
.badge-patch { background: #6c757d; color: white; }
.badge-code { background: #e9ecef; color: #333; padding: 2px 6px; }
.badge-struct { background: #00bfa5; color: white; }
.badge-function { background: #00838f; color: white; }

.info-grid {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 10px;
  margin: 15px 0;
}

.info-label {
  font-weight: 600;
  color: #666;
}

.info-value {
  color: #333;
}

/* Memory/thread safety callouts */
.callout {
  margin: 15px 0;
  padding: 15px;
  border-radius: 6px;
  border-left: 4px solid;
}

.callout-memory {
  background: #fff3e0;
  border-color: #ff9800;
}

.callout-thread {
  background: #e8f5e9;
  border-color: #4caf50;
}

.callout-warning {
  background: #ffebee;
  border-color: #f44336;
}

.callout-title {
  font-weight: 700;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.callout-title::before {
  font-size: 1.2rem;
}

.callout-memory .callout-title::before {
  content: '🧠';
}

.callout-thread .callout-title::before {
  content: '⚡';
}

.callout-warning .callout-title::before {
  content: '⚠️';
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 15px 0;
}

th, td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #e0e0e0;
}

th {
  background: #f8f9fa;
  font-weight: 600;
  color: #666;
}

.anchor-link {
  color: #3498db;
  text-decoration: none;
  font-weight: 500;
}

.anchor-link:hover {
  text-decoration: underline;
}

.list-links {
  list-style: none;
  padding: 0;
}

.list-links li {
  margin: 8px 0;
}

code {
  background: #f0f8ff;
  padding: 2px 6px;
  border-radius: 3px;
  font-family: 'Courier New', monospace;
  color: black;
  font-size: 0.9em;
}

.cgo-section code {
  background: #e0f2f1;
}

.empty {
  color: #999;
  font-style: italic;
}

h3 {
  margin: 20px 0 10px 0;
  color: #2c3e50;
  font-size: 1.2rem;
}

h4 {
  margin: 15px 0 8px 0;
  color: #546e7a;
  font-size: 1rem;
}

.route-path {
  font-family: 'Courier New', monospace;
  font-size: 1.1rem;
}

/* Field table styling for C structs */
.field-table {
  margin: 20px 0;
}

.field-table th {
  background: #00bfa5;
  color: white;
}

.field-table code {
  background: #e0f2f1;
  color: #004d40;
}

/* ============================================================ */
/* VIOLATIONS REPORT STYLES */
/* Matching the original dark blue/gray aesthetic */
/* ============================================================ */

/* Override body for violations report */
body.violations-report {
  background: #f5f5f5;
  padding: 0;
}

body.violations-report .container {
  max-width: 1400px;
  margin: 20px auto;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  overflow: hidden;
  display: block;
  min-height: auto;
}

/* Violations header - match sidebar style */
.violations-header {
  background: #2c3e50;
  color: #ecf0f1;
  padding: 40px;
  text-align: center;
  border-bottom: 4px solid #3498db;
}

.violations-header h1 {
  font-size: 2rem;
  margin-bottom: 10px;
  color: #3498db;
}

.violations-header p {
  font-size: 1rem;
  color: #ecf0f1;
  opacity: 0.9;
}

/* Stats grid */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0;
  padding: 0;
  background: white;
  border-bottom: 1px solid #e0e0e0;
}

.stat-card {
  background: white;
  padding: 30px 20px;
  text-align: center;
  border-right: 1px solid #e0e0e0;
  border-bottom: 4px solid #e0e0e0;
  transition: all 0.2s;
}

.stat-card:last-child {
  border-right: none;
}

.stat-card:hover {
  background: #f8f9fa;
}

.stat-card.critical { border-bottom-color: #dc3545; }
.stat-card.high { border-bottom-color: #e67e22; }
.stat-card.medium { border-bottom-color: #f39c12; }
.stat-card.low { border-bottom-color: #27ae60; }

.stat-number {
  font-size: 2.5em;
  font-weight: bold;
  color: #2c3e50;
  line-height: 1;
  margin-bottom: 8px;
}

.stat-label {
  color: #7f8c8d;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 1px;
  font-weight: 700;
}

/* Content area for violations */
.violations-content {
  padding: 40px;
}

/* Search bar */
.violations-search {
  margin-bottom: 30px;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 6px;
  border-left: 4px solid #3498db;
}

.violations-search input {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  font-size: 0.95rem;
  font-family: inherit;
  background: white;
  transition: border-color 0.2s;
}

.violations-search input:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.violations-search input::placeholder {
  color: #95a5a6;
}

.search-results-count {
  margin-top: 10px;
  font-size: 0.85rem;
  color: #7f8c8d;
}

.violation-item.hidden {
  display: none;
}

/* Violation sections - match details/summary style */
.violation-section {
  margin-bottom: 15px;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  overflow: hidden;
}

.violation-section-header {
  padding: 15px;
  cursor: pointer;
  background: #f8f9fa;
  font-weight: 600;
  user-select: none;
  transition: background 0.2s;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-left: 4px solid #e0e0e0;
}

.violation-section-header:hover {
  background: #e9ecef;
}

.violation-section-header.critical {
  border-left-color: #dc3545;
}

.violation-section-header.high {
  border-left-color: #e67e22;
}

.violation-section-header.medium {
  border-left-color: #f39c12;
}

.violation-section-header.low {
  border-left-color: #27ae60;
}

/* Open state - match details[open] summary style */
.violation-section-header:not(.collapsed) {
  background: #3498db;
  color: white;
  border-left-color: #3498db;
}

.violation-section-header.critical:not(.collapsed) {
  background: #dc3545;
  border-left-color: #dc3545;
}

.violation-section-header.high:not(.collapsed) {
  background: #e67e22;
  border-left-color: #e67e22;
}

.violation-section-header.medium:not(.collapsed) {
  background: #f39c12;
  border-left-color: #f39c12;
}

.violation-section-header.low:not(.collapsed) {
  background: #27ae60;
  border-left-color: #27ae60;
}

.violation-section-title {
  font-size: 1.1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}

.violation-section-count {
  background: rgba(255,255,255,0.3);
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 600;
}

.toggle-icon {
  font-size: 1.2em;
  transition: transform 0.2s ease;
}

.violation-section-header.collapsed .toggle-icon {
  transform: rotate(-90deg);
}

/* ✅ FIXED: Remove max-height limit to show all violations */
.violation-section-content {
  max-height: none;
  overflow: visible;
  transition: max-height 0.3s ease, overflow 0s 0.3s;
}

.violation-section-content.collapsed {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, overflow 0s;
}

/* Individual violation items */
.violation-item {
  padding: 20px;
  border-bottom: 1px solid #e0e0e0;
  background: white;
  transition: background 0.2s ease;
}

.violation-item:hover {
  background: #f8f9fa;
}

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

.violation-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 10px;
}

.violation-rule {
  font-weight: 600;
  color: #2c3e50;
  font-size: 1rem;
}

.violation-badge {
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.violation-badge.critical {
  background: #dc3545;
  color: white;
}

.violation-badge.high {
  background: #e67e22;
  color: white;
}

.violation-badge.medium {
  background: #f39c12;
  color: white;
}

.violation-badge.low {
  background: #27ae60;
  color: white;
}

.violation-message {
  color: #555;
  margin-bottom: 12px;
  font-size: 0.95em;
}

.violation-details {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 10px;
  font-size: 0.9em;
  background: #f8f9fa;
  padding: 12px;
  border-radius: 4px;
  border-left: 3px solid #e0e0e0;
}

.violation-details.critical { border-left-color: #dc3545; }
.violation-details.high { border-left-color: #e67e22; }
.violation-details.medium { border-left-color: #f39c12; }
.violation-details.low { border-left-color: #27ae60; }

.detail-label {
  font-weight: 600;
  color: #666;
}

.detail-value {
  color: #333;
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
}

.code-snippet {
  background: #2c3e50;
  color: #ecf0f1;
  padding: 15px;
  border-radius: 4px;
  overflow-x: auto;
  margin-top: 10px;
  font-family: 'Courier New', monospace;
  font-size: 0.85em;
  line-height: 1.5;
  border-left: 3px solid #3498db;
}

.empty-state {
  text-align: center;
  padding: 40px;
  color: #95a5a6;
}

.empty-state-icon {
  font-size: 3em;
  margin-bottom: 10px;
  color: #bdc3c7;
}

/* Footer */
.violations-footer {
  background: #34495e;
  color: #ecf0f1;
  padding: 20px;
  text-align: center;
  font-size: 0.9em;
  border-top: 1px solid #2c3e50;
}

/* ============================================================ */
/* DASHBOARD (Repo List) STYLES */
/* Matches the aesthetic of docs + violations reports */
/* ============================================================ */

body.dashboard {
  background: #f5f5f5;
  padding: 30px;
}

.dashboard .container {
  max-width: 1400px;
  margin: 0 auto;
}

.dashboard-header {
  text-align: center;
  margin-bottom: 40px;
}

.dashboard-header h1 {
  font-size: 2.2rem;
  color: #2c3e50;
  margin-bottom: 8px;
}

.dashboard-header .meta {
  color: #7f8c8d;
  font-size: 0.9rem;
}

/* EMPTY STATE */
.dashboard-empty {
  text-align: center;
  background: white;
  padding: 60px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.dashboard-empty-icon {
  font-size: 3rem;
  color: #bdc3c7;
  margin-bottom: 15px;
}

/* REPO CARD */
.repo-card {
  background: white;
  padding: 25px;
  margin-bottom: 30px;
  border-radius: 8px;
  border-left: 4px solid #3498db;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.repo-card h2 {
  font-size: 1.6rem;
  color: #2c3e50;
  margin-bottom: 20px;
}

/* STATS GRID (inside each repo card) */
.repo-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 15px;
  margin-bottom: 20px;
}

.repo-stat-item {
  text-align: center;
  padding: 12px;
  border-radius: 6px;
  background: #f8f9fa;
  border: 1px solid #e0e0e0;
}

.repo-stat-item.critical { border-left: 4px solid #dc3545; }
.repo-stat-item.high     { border-left: 4px solid #e67e22; }
.repo-stat-item.medium   { border-left: 4px solid #f39c12; }
.repo-stat-item.low      { border-left: 4px solid #27ae60; }

.repo-stat-value {
  font-size: 1.4rem;
  font-weight: bold;
  color: #2c3e50;
}

.repo-stat-label {
  font-size: 0.75rem;
  color: #7f8c8d;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ACTION BUTTONS */
.repo-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.btn-repo {
  display: inline-block;
  padding: 10px 16px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  color: white;
  background: #3498db;
  transition: opacity 0.15s, background 0.15s;
}

.btn-repo:hover {
  background: #2980b9;
}

.btn-documentation {
  background: #3498db;
}

.btn-violations {
  background: #e67e22;
}

.btn-violations:hover {
  background: #d35400;
}

/* DISABLED BUTTON */
.btn-repo.disabled {
  background: #bdc3c7;
  cursor: not-allowed;
  opacity: 0.6;
  pointer-events: none;
}

/* META INFO */
.repo-meta {
  margin-top: 10px;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 6px;
  border-left: 4px solid #3498db;
}

.repo-meta-item {
  margin-bottom: 8px;
  font-size: 0.9rem;
}

.repo-meta-label {
  font-weight: 700;
  color: #2c3e50;
  margin-right: 5px;
}
