/* Reset and base styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html, body {
  height: 100%;
  overflow: hidden;
  font-family: 'Segoe UI', sans-serif;
  background-color: #f3f4f6;
}

/* Layout grid */
.dashboard {
  display: grid;
  grid-template-columns: 240px 1fr;
  height: 100vh;
}

/* Sidebar */
.sidebar {
  position: relative; /* crucial for absolute children positioning */
  background-color: #1f2937;
  color: white;
  padding: 20px;
  display: flex;
  height: 100vh;
  flex-direction: column;
}
.sidebar h2 {
  margin-bottom: 30px;
}
.sidebar ul {
  display: flex;
  flex-direction: column;
  gap: 15px;
}
.sidebar li {
  display: flex; 
  align-items: center;
  gap: 10px;
  flex-direction: row;
  padding: 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
}
.sidebar li:hover {
  background-color: #374151;
}
/* Bottom sidebar */
.bottom-card {
  padding: 15px;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 0 8px rgba(0,0,0,0.1);
  background-color: #354152;
  position: absolute;
  bottom: 20px;
  left: 20px;
  right: 20px;
}

.explanation-card {
  background-color: #354152;
  box-shadow: 0 0 8px rgba(0,0,0,0.1);
  padding: 10px;
  margin-top: 8px;
  font-size: 0.9em;
  border-radius: 4px;
}

/* Main area */
.main {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

/* Header */
.header {
  background-color: white;
  padding: 20px;
  flex: 0 0 80px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Grid cards */
.card-grid {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 20px;
  padding: 20px;
  height: 90%;
}
.card {
  background-color: white;
  border-radius: 12px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.06);
  display: flex;
  flex-direction: column;
  padding: 15px;
  font-size: 1.1rem;
  font-weight: 500;
  color: #111827;
  height: 100%;
  overflow: hidden;
}

/* Tabs */
.tabs {
  display: flex;
  border-bottom: 2px solid #ccc;
}
.tab-button {
  padding: 10px 20px;
  border: none;
  background: none;
  cursor: pointer;
  font-weight: 600;
  border-bottom: 3px solid transparent;
  transition: border-color 0.3s, color 0.3s;
  color: #555;
}
.tab-button:hover {
  border-bottom-color: #007bff;
  color: #007bff;
}
.tab-button.active {
  border-bottom-color: #007bff;
  color: #007bff;
}
.tab-content {
  flex: 1;
  display: none;
  overflow-y: auto;
  padding-right: 10px;
  font-size: 0.95rem;
  color: #333;
}
.tab-content.active {
  display: block;
}

/* Tab controls row (tabs + dropdowns) */
.tab-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 15px;
  flex-wrap: wrap;
}

/* Dropdown labels */
.tab-controls label {
  display: flex;
  align-items: center;
  font-weight: 600;
  font-size: 0.95rem;
}

/* Style dropdowns to match tab height */
.tab-controls select {
  padding: 8px 12px;
  font-size: 0.95rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  height: 40px; /* Matches tab-button height */
  margin-left: 6px;
  appearance: none;
  background-color: white;
  line-height: 1;
}

/* Use fixed layout for table - for ellipsis */
#taxonomy {
  table-layout: fixed;
  text-overflow: ellipsis;
}
/* Required for ellipsis */
.card table.dataTable tbody td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* DataTables styling */
#taxonomy thead tr.filters th {
  padding: 4px 6px !important;
  border-bottom: none !important;
  background: transparent !important;
}
#taxonomy thead tr:nth-child(2) th {
  padding: 6px 8px !important;
  border-bottom: 1px solid #ddd;
  background: #fafafa;
}
table.dataTable thead select {
  width: 100%;
  box-sizing: border-box;
  font-size: 10px;
  padding: 2px 4px;
}
tr.selected {
  background-color: #d9edf7 !important;
}
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_info {
  display: none;
}
#taxonomy_wrapper {
  font-size: 9px !important;
  margin-bottom: 10px !important;
  flex: 1 1 auto;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
#taxonomy thead th,
#taxonomy tbody td {
  font-size: 10px !important;
  white-space: nowrap;
  padding: 6px 8px !important;
}
#taxonomy tbody td {
  padding-top: 4px !important;
  padding-bottom: 4px !important;
}
.dataTables_scrollBody {
  overflow-y: auto !important;
  overflow-x: hidden !important;
  max-height: calc(100% - 40px) !important;
}
.dataTables_wrapper .dataTables_paginate {
  padding-top: 6px;
  font-size: 10px;
  text-align: right;
  background: white;
}
