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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f8f9fa;
  padding: 20px;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  padding: 30px;
}

header {
  text-align: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid #eee;
}

h1 {
  font-size: 2.2rem;
  color: #2c3e50;
  margin-bottom: 10px;
}

h2 {
  font-size: 1.8rem;
  color: #3a4a5d;
  margin: 25px 0 15px 0;
}

.subtitle {
  font-size: 1.1rem;
  color: #6c757d;
}

section {
  margin-bottom: 40px;
}

ul {
  list-style-type: none;
  padding-left: 20px;
}

li {
  margin: 10px 0;
}

a {
  color: #0366d6;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.chart-image {
  max-width: 100%;
  height: auto;
  margin: 20px 0;
  border: 1px solid #eee;
  border-radius: 4px;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.05);
}

/* Interactive Chart Styles */
.chart-container {
  position: relative;
  height: 500px;
  margin: 20px 0;
  display: none; /* Hidden by default, shown by JavaScript */
}

.chart-fallback {
  display: none; /* Hidden by default, shown only if chart fails */
}

.chart-fallback p {
  text-align: center;
  color: #6c757d;
  font-style: italic;
  margin-top: 10px;
}

.chart-controls {
  margin: 20px 0;
  padding: 12px;
  background-color: #f8f9fa;
  border-radius: 6px;
  border: 1px solid #dee2e6;
  display: none; /* Hidden by default, shown by JavaScript */
}

.control-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.control-section {
  display: flex;
  align-items: center;
  gap: 10px;
}

.control-label {
  font-size: 11px;
  font-weight: 600;
  color: #6c757d;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.control-group {
  margin-bottom: 10px;
}

.control-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  color: #2c3e50;
}

.toggle-buttons {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.toggle-btn {
  padding: 4px 8px;
  border: 1px solid #dee2e6;
  border-radius: 12px;
  background-color: #ffffff;
  color: #495057;
  cursor: pointer;
  font-size: 11px;
  font-weight: 500;
  transition: all 0.2s ease;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.toggle-btn:hover {
  border-color: #0366d6;
  color: #0366d6;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.toggle-btn.active {
  background-color: #0366d6;
  border-color: #0366d6;
  color: white;
}

.toggle-btn.active:hover {
  background-color: #0256cc;
  border-color: #0256cc;
}

.toggle-icon {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.view-btn {
  padding: 4px 8px;
  border: 1px solid #dee2e6;
  border-radius: 12px;
  background-color: #ffffff;
  color: #495057;
  cursor: pointer;
  font-size: 11px;
  font-weight: 500;
  transition: all 0.2s ease;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.view-btn:hover {
  border-color: #28a745;
  color: #28a745;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.view-btn.active {
  background-color: #28a745;
  border-color: #28a745;
  color: white;
}

.view-btn.active:hover {
  background-color: #218838;
  border-color: #218838;
}

.view-icon {
  font-size: 8px;
  line-height: 1;
}

/* Statistics Table Styles */
.stats-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  background-color: white;
}

.stats-table thead th {
  background-color: #f8f9fa;
  font-weight: 600;
  font-size: 14px;
  color: #333;
  padding: 12px 15px;
  border-bottom: 1px solid #dee2e6;
  text-align: left;
}

.stats-table tbody tr {
  border-bottom: 1px solid #eee;
}

.stats-table tbody tr:hover {
  background-color: #f8f9fa;
}

.agent-cell {
  padding: 15px;
}

.agent-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.agent-icon {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}

.agent-link {
  color: #333;
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
}

.agent-link:hover {
  color: #0366d6;
  text-decoration: underline;
}

.metric-cell {
  padding: 15px;
  text-align: left;
}

.metric-link {
  color: #0366d6;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
}

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

.rate-cell {
  padding: 15px;
  text-align: left;
  font-weight: 600;
  font-size: 14px;
  color: #333;
}

/* Legacy table styles for backwards compatibility */
table:not(.stats-table) {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
}

table:not(.stats-table) th,
table:not(.stats-table) td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid #eee;
}

table:not(.stats-table) th {
  background-color: #f8f9fa;
  font-weight: 600;
}

table:not(.stats-table) tr:hover {
  background-color: #f8f9fa;
}

footer {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid #eee;
  text-align: center;
  color: #6c757d;
  font-size: 0.9rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  body {
    padding: 10px;
  }

  .container {
    padding: 15px;
  }

  h1 {
    font-size: 1.8rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  .stats-table thead th {
    padding: 8px 6px;
    font-size: 12px;
  }

  .agent-cell {
    padding: 10px 8px;
  }

  .agent-info {
    gap: 6px;
  }

  .agent-link {
    font-size: 12px;
  }

  .metric-cell {
    padding: 10px 6px;
  }

  .metric-link {
    font-size: 12px;
  }

  .rate-cell {
    padding: 10px 6px;
    font-size: 12px;
  }

  table:not(.stats-table) th,
  table:not(.stats-table) td {
    padding: 8px 10px;
  }

  .chart-container {
    height: 375px;
  }

  .control-row {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .control-section {
    justify-content: center;
  }

  .toggle-buttons {
    justify-content: center;
  }

  .toggle-btn,
  .view-btn {
    padding: 6px 10px;
    font-size: 10px;
  }
}
