/* frontend/papersfeed.css */

:root {
  color-scheme: light;
  --bg-page: #f5f7fa;
  --bg-surface: #ffffff;
  --bg-soft: #f0f0f0;
  --bg-soft-hover: #e8e8e8;
  --text-primary: #1f2937;
  --text-muted: #666;
  --border-subtle: #e1e5e9;
  --border-strong: #d1d5db;
  --shadow-soft: 0 2px 4px rgba(0, 0, 0, 0.1);
  --heatmap-empty-color: #ebedf0;
  --heatmap-muted-color: #666;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg-page: #0b1220;
  --bg-surface: #111827;
  --bg-soft: #1f2937;
  --bg-soft-hover: #334155;
  --text-primary: #e2e8f0;
  --text-muted: #94a3b8;
  --border-subtle: #334155;
  --border-strong: #475569;
  --shadow-soft: 0 8px 24px rgba(0, 0, 0, 0.35);
  --heatmap-empty-color: #1f2937;
  --heatmap-muted-color: #94a3b8;
}

/* Password Overlay */
.password-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(245, 247, 250, 0.95);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.password-overlay.hidden {
  display: none;
}

.password-card {
  background: white;
  border-radius: 12px;
  padding: 40px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
  text-align: center;
  max-width: 360px;
  width: 90%;
}

.password-card h2 {
  margin: 0 0 8px 0;
  color: #333;
  font-size: 24px;
}

.password-card p {
  margin: 0 0 24px 0;
  color: #666;
  font-size: 14px;
}

.password-input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e1e5e9;
  border-radius: 8px;
  font-size: 16px;
  box-sizing: border-box;
  transition: border-color 0.2s;
}

.password-input:focus {
  outline: none;
  border-color: #1a73e8;
}

.password-submit {
  width: 100%;
  padding: 12px;
  margin-top: 12px;
  background-color: #1a73e8;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
}

.password-submit:hover {
  background-color: #1558b7;
}

.password-error {
  color: #d32f2f;
  font-size: 13px;
  margin: 12px 0 0 0;
  min-height: 18px;
}

.password-card.shake {
  animation: shake 0.4s ease-in-out;
}

@keyframes shake {

  0%,
  100% {
    transform: translateX(0);
  }

  20% {
    transform: translateX(-10px);
  }

  40% {
    transform: translateX(10px);
  }

  60% {
    transform: translateX(-6px);
  }

  80% {
    transform: translateX(6px);
  }
}

body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  transition: background-color 0.25s ease, color 0.25s ease;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 30px;
  padding: 20px;
  background-color: var(--bg-surface);
  box-shadow: var(--shadow-soft);
  transition: background-color 0.25s ease, box-shadow 0.25s ease;
}

.header-title {
  flex-shrink: 0;
}

.header-desc {
  margin: 0;
  color: var(--text-muted);
}

h1 {
  margin: 0 0 10px 0;
  color: var(--text-primary);
}

.reading-progress {
  width: 320px;
  max-width: 100%;
  margin-top: 10px;
}

.reading-progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: #4b5563;
  font-weight: 500;
  margin-bottom: 6px;
}

.reading-progress-track {
  height: 8px;
  border-radius: 999px;
  background-color: #e5e7eb;
  overflow: hidden;
}

.reading-progress-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #9bd69b 0%, #4ea84e 100%);
  transition: width 0.25s ease;
}

/* Heatmap container styles */
.heatmap-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
  /* Allow shrinking */
  padding: 0 20px;
  width: 100%;
  /* Ensure full width */
}

.heatmap-title {
  font-size: 12px;
  color: var(--heatmap-muted-color);
  margin-bottom: 8px;
  font-weight: 500;
  min-height: 16px;
  /* Reserve space to prevent layout shift */
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  /* Space between dropdown and legend */
  /* Width will be set dynamically by JavaScript to match heatmap */
}

.heatmap-dropdown {
  font-size: 12px;
  color: var(--heatmap-muted-color);
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  padding: 2px 6px;
  cursor: pointer;
  font-weight: 500;
  outline: none;
  flex-shrink: 0;
  /* Don't shrink the dropdown */
}

.heatmap-dropdown:hover {
  border-color: #1a73e8;
}

.heatmap-dropdown:focus {
  border-color: #1a73e8;
  box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.2);
}

.heatmap-legend {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--heatmap-muted-color);
  flex-shrink: 0;
  /* Don't shrink the legend */
}

.heatmap-legend {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--heatmap-muted-color);
  flex-shrink: 0;
  /* Don't shrink the legend */
}

.legend-cell {
  width: 10px;
  height: 10px;
  border: 1px solid var(--border-strong);
  border-radius: 2px;
}

.legend-cell.level-0 {
  background-color: #ebedf0;
}

.legend-cell.level-1 {
  background-color: #c6e48b;
}

.legend-cell.level-2 {
  background-color: #7bc96f;
}

.legend-cell.level-3 {
  background-color: #239a3b;
}

.legend-cell.level-4 {
  background-color: #196127;
}

/* Heatmap SVG styles */
.heatmap-cell {
  stroke: #fff;
  stroke-width: 1px;
  cursor: pointer;
  rx: 2px;
  ry: 2px;
}

.heatmap-cell:hover {
  stroke: #333;
  stroke-width: 2px;
}

.month-label {
  font-size: 10px;
  fill: var(--heatmap-muted-color);
  font-weight: 500;
}

.day-label {
  font-size: 9px;
  fill: var(--heatmap-muted-color);
}

/* Heatmap tooltip */
.heatmap-tooltip {
  position: absolute;
  background: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  pointer-events: none;
  z-index: 1000;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.controls {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex: 1;
  max-width: 500px;
  position: relative;
}

.search-box {
  flex: 1;
  flex-grow: 1;
  position: relative;
}

#search-input {
  width: 100%;
  padding: 12px 40px 12px 16px;
  border: 2px solid var(--border-subtle);
  border-radius: 8px;
  font-size: 16px;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

#search-input:focus {
  outline: none;
  border-color: #1a73e8;
}

.clear-search-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 18px;
  color: var(--text-muted);
  cursor: pointer;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.filter-button {
  padding: 8px 15px;
  background-color: var(--bg-soft);
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--text-primary);
}

.filter-button:hover {
  background-color: var(--bg-soft-hover);
}

/* Match header filter button height to the search input */
#sidebar-toggle {
  height: 44px;
}

.theme-toggle {
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: linear-gradient(145deg, var(--bg-surface) 0%, var(--bg-soft) 100%);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.theme-toggle:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.12);
}

.theme-toggle:focus-visible {
  outline: none;
  border-color: #1a73e8;
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.22);
}

.theme-toggle i {
  font-size: 14px;
}

/* Filter Status Bar */
.filter-status-bar {
  background-color: #e3f2fd;
  border-bottom: 1px solid #bbdefb;
  padding: 10px 20px;
  transition: all 0.3s ease;
}

.filter-status-content {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-status-label {
  font-weight: 600;
  color: #1565c0;
  font-size: 14px;
}

.filter-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1;
}

.filter-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: #1976d2;
  color: white;
  padding: 4px 8px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 500;
}

.filter-badge-remove {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  font-size: 14px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 2px;
}

.filter-badge-remove:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.clear-all-filters-btn {
  background-color: #f44336;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
}

.clear-all-filters-btn:hover {
  background-color: #d32f2f;
}

.dashboard-container {
  display: flex;
  flex: 1;
  overflow: hidden;
  position: relative;
}

.main-content {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#papers-table {
  flex: 1;
  width: 100%;
}

/* Shared sidebar styles */
.sidebar {
  background-color: var(--bg-surface);
  box-shadow: -2px 0 5px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: all 0.3s ease;
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 0;
  z-index: 100;
}

.sidebar.active {
  width: 400px;
  padding: 20px;
}

/* Filter sidebar specific */
#sidebar h3 {
  margin-top: 0;
  margin-bottom: 15px;
}

.filter-section {
  margin-bottom: 20px;
}

.filter-section h4 {
  margin-top: 0;
  margin-bottom: 10px;
  border-bottom: 1px solid #eee;
  padding-bottom: 5px;
}

/* Details sidebar specific */
#details-sidebar {
  z-index: 101;
  /* Higher than filter sidebar */
  overflow-x: hidden;
}

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

.close-button {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: #666;
  padding: 8px;
  z-index: 10;
}

.close-button:hover {
  color: #333;
}

.details-scroll-content {
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px 20px 20px 20px;
  /* Top padding leaves space for close button */
  box-sizing: border-box;
  max-width: 100%;
}

.details-header h2 {
  margin: 0;
  line-height: 1.3;
  word-break: break-word;
  overflow-wrap: anywhere;
  max-width: 100%;
}

.delete-paper-btn {
  flex-shrink: 0;
  background-color: #f44336;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 10px;
  margin-top: 2px;
}

.delete-paper-btn:hover {
  background-color: #d32f2f;
}

.delete-paper-btn:active {
  background-color: #b71c1c;
}

/* Inline table delete button */
.table-delete-btn {
  background: none;
  border: none;
  color: #999;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  transition: all 0.2s ease;
}

.table-delete-btn:hover {
  background-color: #ffebee;
  color: #f44336;
}

.table-delete-btn:active {
  background-color: #ffcdd2;
  color: #d32f2f;
}

/* Inline table read toggle button */
.table-read-btn {
  background: none;
  border: none;
  color: #ccc;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 14px;
  transition: all 0.2s ease;
}

.table-read-btn:hover {
  color: #4caf50;
}

.table-read-btn.read {
  color: #4caf50;
}

.table-read-btn.read:hover {
  color: #2e7d32;
}

.quick-note-placeholder {
  color: #9ca3af;
  font-style: italic;
}

.quick-note-value {
  display: block;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.detail-section {
  margin-bottom: 25px;
  background-color: #f9f9f9;
  border-radius: 6px;
  padding: 15px;
  overflow-x: hidden;
  word-break: break-word;
}

.detail-section h3 {
  margin-top: 0;
  margin-bottom: 15px;
  color: #333;
  font-size: 1.1em;
  border-bottom: 1px solid #eee;
  padding-bottom: 8px;
}

.quick-note-input {
  width: 100%;
  min-height: 90px;
  resize: vertical;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 10px;
  font-size: 14px;
  box-sizing: border-box;
}

.quick-note-input:focus {
  outline: none;
  border-color: #1a73e8;
  box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.15);
}

.quick-note-help {
  margin-top: 8px;
  color: #6b7280;
  font-size: 12px;
}

.detail-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.detail-table th {
  text-align: left;
  padding: 8px;
  color: #666;
  font-weight: 600;
  width: 30%;
  vertical-align: top;
}

.detail-table td {
  padding: 8px;
  vertical-align: top;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.abstract-box {
  max-height: 300px;
  overflow-y: auto;
  padding: 15px;
  background-color: white;
  border-radius: 4px;
  line-height: 1.5;
  white-space: pre-line;
}

.tag {
  display: inline-block;
  background-color: #e8f0fe;
  padding: 3px 8px;
  margin: 2px;
  border-radius: 12px;
  font-size: 12px;
}

.loading {
  text-align: center;
  padding: 40px;
  font-size: 18px;
  color: var(--text-muted);
}

.sessions-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

.sessions-table th {
  background-color: #f2f2f2;
  padding: 8px;
  text-align: left;
}

.sessions-table td {
  padding: 8px;
  border-bottom: 1px solid #eee;
}

/* Tabulator customizations */
.tabulator {
  border: none;
  background-color: transparent;
}

.tabulator-row {
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
}

.tabulator-row:hover {
  background-color: #f2f8fd !important;
}

.tabulator-row.tabulator-row-even {
  background-color: #fafafa;
}

.tabulator-row.row-read {
  background-color: #eaf6ea !important;
  opacity: 0.82;
}

.tabulator-row.row-read:hover {
  background-color: #dff0df !important;
  opacity: 0.9;
}

.heatmap-empty-state {
  text-align: center;
  color: var(--heatmap-muted-color);
  font-size: 12px;
  padding: 20px;
}

[data-theme="dark"] .password-overlay {
  background: rgba(2, 6, 23, 0.9);
}

[data-theme="dark"] .password-card {
  background: #111827;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45);
}

[data-theme="dark"] .password-card p,
[data-theme="dark"] .reading-progress-meta,
[data-theme="dark"] .filter-section label,
[data-theme="dark"] .quick-note-help,
[data-theme="dark"] .detail-table th {
  color: #94a3b8;
}

[data-theme="dark"] .password-card h2 {
  color: #f8fafc;
}

[data-theme="dark"] .password-input,
[data-theme="dark"] #search-input,
[data-theme="dark"] .heatmap-dropdown,
[data-theme="dark"] .quick-note-input,
[data-theme="dark"] #date-filter-from,
[data-theme="dark"] #date-filter-to,
[data-theme="dark"] #min-reading-time,
[data-theme="dark"] #min-interaction-days {
  background-color: #0f172a;
  color: #e2e8f0;
  border-color: #334155;
}

[data-theme="dark"] .password-input::placeholder,
[data-theme="dark"] #search-input::placeholder,
[data-theme="dark"] .quick-note-input::placeholder {
  color: #64748b;
}

[data-theme="dark"] #search-input:focus,
[data-theme="dark"] .quick-note-input:focus,
[data-theme="dark"] .heatmap-dropdown:focus,
[data-theme="dark"] #date-filter-from:focus,
[data-theme="dark"] #date-filter-to:focus,
[data-theme="dark"] #min-reading-time:focus,
[data-theme="dark"] #min-interaction-days:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.2);
}

[data-theme="dark"] .header {
  border-bottom: 1px solid #1f2937;
}

[data-theme="dark"] h1,
[data-theme="dark"] .details-header h2,
[data-theme="dark"] .detail-section h3,
[data-theme="dark"] #sidebar h3,
[data-theme="dark"] .filter-section h4,
[data-theme="dark"] .sessions-table th {
  color: #f8fafc;
}

[data-theme="dark"] .header-desc,
[data-theme="dark"] .clear-search-btn,
[data-theme="dark"] .close-button {
  color: #94a3b8;
}

[data-theme="dark"] .clear-search-btn:hover {
  color: #f8fafc;
}

[data-theme="dark"] .filter-button {
  background-color: #1f2937;
  border-color: #334155;
  color: #e2e8f0;
}

[data-theme="dark"] .filter-button:hover {
  background-color: #334155;
}

[data-theme="dark"] .theme-toggle {
  background: linear-gradient(145deg, #111827 0%, #1f2937 100%);
  border-color: #334155;
  color: #e2e8f0;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.5);
}

[data-theme="dark"] .theme-toggle:hover {
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45);
}

[data-theme="dark"] .filter-status-bar {
  background-color: #112338;
  border-bottom-color: #1d3b56;
}

[data-theme="dark"] .filter-status-label {
  color: #93c5fd;
}

[data-theme="dark"] .filter-badge {
  background-color: #2563eb;
}

[data-theme="dark"] .clear-all-filters-btn {
  background-color: #dc2626;
}

[data-theme="dark"] .clear-all-filters-btn:hover {
  background-color: #b91c1c;
}

[data-theme="dark"] .sidebar {
  background-color: #111827;
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
  border-left: 1px solid #1f2937;
}

[data-theme="dark"] .filter-section h4,
[data-theme="dark"] .detail-section h3 {
  border-bottom-color: #334155;
}

[data-theme="dark"] .detail-section {
  background-color: #172335;
  border: 1px solid #2b3b52;
}

[data-theme="dark"] .abstract-box {
  background-color: #0f172a;
  border: 1px solid #334155;
}

[data-theme="dark"] .detail-table td,
[data-theme="dark"] .sessions-table td,
[data-theme="dark"] .quick-note-value {
  color: #e2e8f0;
}

[data-theme="dark"] .tag {
  background-color: #1f3a5b;
  color: #bfdbfe;
}

[data-theme="dark"] .sessions-table th {
  background-color: #1f2937;
}

[data-theme="dark"] .sessions-table td {
  border-bottom-color: #334155;
}

[data-theme="dark"] .quick-note-placeholder {
  color: #64748b;
}

[data-theme="dark"] .delete-paper-btn {
  background-color: #dc2626;
}

[data-theme="dark"] .delete-paper-btn:hover {
  background-color: #b91c1c;
}

[data-theme="dark"] .delete-paper-btn:active {
  background-color: #991b1b;
}

[data-theme="dark"] .table-delete-btn {
  color: #94a3b8;
}

[data-theme="dark"] .table-delete-btn:hover {
  background-color: #3f1f26;
  color: #fca5a5;
}

[data-theme="dark"] .table-delete-btn:active {
  background-color: #571f2a;
  color: #f87171;
}

[data-theme="dark"] .table-read-btn {
  color: #64748b;
}

[data-theme="dark"] .table-read-btn:hover,
[data-theme="dark"] .table-read-btn.read {
  color: #86efac;
}

[data-theme="dark"] .table-read-btn.read:hover {
  color: #4ade80;
}

[data-theme="dark"] .tabulator {
  color: #e2e8f0;
}

[data-theme="dark"] .tabulator .tabulator-header,
[data-theme="dark"] .tabulator .tabulator-header .tabulator-col,
[data-theme="dark"] .tabulator .tabulator-footer {
  background-color: #0f172a !important;
  border-color: #1f2937 !important;
  color: #cbd5e1 !important;
}

[data-theme="dark"] .tabulator .tabulator-header .tabulator-col .tabulator-col-content {
  color: #cbd5e1 !important;
}

[data-theme="dark"] .tabulator .tabulator-tableholder {
  background-color: transparent !important;
}

[data-theme="dark"] .tabulator .tabulator-cell {
  border-right-color: #1f2937 !important;
  color: #e2e8f0;
}

[data-theme="dark"] .tabulator-row {
  background-color: #0b1220 !important;
  border-bottom-color: #1f2937;
}

[data-theme="dark"] .tabulator-row.tabulator-row-even {
  background-color: #101a2f !important;
}

[data-theme="dark"] .tabulator-row:hover {
  background-color: #1e293b !important;
}

[data-theme="dark"] .tabulator-row.row-read {
  background-color: #173226 !important;
  opacity: 1;
}

[data-theme="dark"] .tabulator-row.row-read:hover {
  background-color: #1f4a34 !important;
}

[data-theme="dark"] .tabulator-row.tabulator-selected,
[data-theme="dark"] .tabulator-row.tabulator-selected:hover {
  background-color: #1d3a5c !important;
}

[data-theme="dark"] .tabulator .tabulator-group {
  background-color: #111827 !important;
  color: #e2e8f0 !important;
  border-top: 1px solid #1f2937 !important;
  border-bottom: 1px solid #1f2937 !important;
}

[data-theme="dark"] .heatmap-tooltip {
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid #334155;
  color: #e2e8f0;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
}

[data-theme="dark"] .heatmap-cell {
  stroke: #0b1220;
}

[data-theme="dark"] .heatmap-cell:hover {
  stroke: #f8fafc;
}

[data-theme="dark"] .legend-cell.level-0 {
  background-color: #1f2937;
}

[data-theme="dark"] .legend-cell.level-1 {
  background-color: #2a5f37;
}

[data-theme="dark"] .legend-cell.level-2 {
  background-color: #3f8e4f;
}

[data-theme="dark"] .legend-cell.level-3 {
  background-color: #58b465;
}

[data-theme="dark"] .legend-cell.level-4 {
  background-color: #8cd59a;
}

[data-theme="dark"] a {
  color: #93c5fd;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
  .heatmap-container {
    display: none;
    /* Hide heatmap on smaller screens */
  }
}

@media (max-width: 768px) {
  .header {
    flex-direction: column;
    align-items: stretch;
    gap: 15px;
  }

  .controls {
    flex-direction: column;
    align-items: stretch;
    max-width: none;
    gap: 10px;
  }

  .controls .filter-button {
    align-self: flex-start;
  }

  .controls .theme-toggle {
    align-self: flex-start;
  }

  .sidebar.active {
    width: 85%;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .filter-status-content {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .filter-badges {
    justify-content: flex-start;
  }
}
