:root {
  --primary-color: #3a86ff;
  --secondary-color: #8338ec;
  --accent-color: #ff006e;
  --background-color: #f8f9fa;
  --card-color: #ffffff;
  --text-color: #212529;
  --border-color: #dee2e6;
  --tier-extra-small: #CFEED9;
  --tier-small: #81C995;
  --tier-medium: #38A169;
  --tier-large: #2B7853;
  --tier-reasoning: #165E39;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 
    'Open Sans', 'Helvetica Neue', sans-serif;
  line-height: 1.6;
  margin: 0;
  padding: 0;
  color: var(--text-color);
  background-color: var(--background-color);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

header {
  text-align: center;
  margin-bottom: 2rem;
}

h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

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

/* Tabs styling */
.tabs {
  display: flex;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border-color);
}

.tab {
  padding: 0.75rem 1.5rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  font-weight: 500;
}

.tab:hover {
  color: var(--primary-color);
}

.tab.active {
  color: var(--primary-color);
  border-bottom: 2px solid var(--primary-color);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.chat-interface {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 2rem;
}

.chat-container {
  background-color: var(--card-color);
  border-radius: 10px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.chat-messages {
  flex-grow: 1;
  min-height: 500px;
  max-height: 500px;
  overflow-y: auto;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.message {
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
}

.message-header {
  display: flex;
  align-items: center;
  margin-bottom: 0.5rem;
}

.message-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  margin-right: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  color: white;
}

.user-avatar {
  background: var(--primary-color);
}

.ai-avatar {
  background: var(--secondary-color);
}

.message-content {
  padding: 1rem;
  border-radius: 0.5rem;
  max-width: 90%;
  position: relative;
}

.message-content.loading::after {
  content: "";
  display: inline-block;
  width: 1rem;
  height: 1rem;
  vertical-align: text-bottom;
  border: 0.15rem solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
  margin-left: 0.5rem;
  opacity: 0.5;
}

.message-meta {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: #6c757d;
  padding-left: 1rem;
}

.meta-item {
  display: inline-block;
  margin-right: 1rem;
}

.meta-label {
  font-weight: 500;
}

.meta-model {
  background-color: rgba(131, 56, 236, 0.1);
  border-radius: 4px;
  padding: 0.1rem 0.3rem;
}

.user-message .message-content {
  background-color: #e9ecef;
  align-self: flex-end;
}

.ai-message .message-content {
  background-color: #f1f3f5;
  align-self: flex-start;
}

.chat-input {
  padding: 1.5rem;
  display: flex;
  align-items: center;
}

textarea {
  flex-grow: 1;
  padding: 1rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  resize: none;
  height: 60px;
  font-family: inherit;
  font-size: 1rem;
}

button {
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  cursor: pointer;
  margin-left: 1rem;
  transition: background-color 0.2s ease;
}

button:hover {
  background-color: #2a75e6;
}

button:disabled {
  background-color: #b8c2cc;
  cursor: not-allowed;
}

.info-panel {
  background-color: var(--card-color);
  border-radius: 10px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  padding: 1.5rem;
}

.info-section {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.info-section:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

h2 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: #495057;
}

.model-info {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.info-item {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
}

.info-label {
  font-weight: 500;
  color: #6c757d;
}

.info-value {
  font-weight: 600;
}

.router-info {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}


.score-meter {
  height: 8px;
  width: 100%;
  background-color: #e9ecef;
  border-radius: 4px;
  margin-top: 0.5rem;
  overflow: hidden;
}

.score-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--tier-extra-small), var(--tier-reasoning));
  width: 0%;
  transition: width 0.5s ease;
}

.tier-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  font-weight: 500;
  color: white;
}

.tier-extra_small {
  background-color: var(--tier-extra-small);
  color: #000;
}

.tier-small {
  background-color: var(--tier-small);
  color: #000;
}

.tier-medium {
  background-color: var(--tier-medium);
  color: white;
}

.tier-large {
  background-color: var(--tier-large);
  color: white;
}

.tier-reasoning {
  background-color: var(--tier-reasoning);
  color: white;
}

.stats-section {
  margin-top: 1rem;
}

.loading-indicator {
  display: none;
  text-align: center;
  padding: 1rem;
  color: #6c757d;
}

.loading-indicator.active {
  display: block;
}

.spinner {
  display: inline-block;
  width: 1.5rem;
  height: 1.5rem;
  vertical-align: middle;
  border: 0.2rem solid #f3f3f3;
  border-top: 0.2rem solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-right: 0.5rem;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.error-message {
  background-color: #ffd8d6;
  border: 1px solid #ff8a85;
  color: #e53e3e;
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  display: none;
}

.error-message.active {
  display: block;
}

/* Sample Prompts Table */
.sample-prompts {
  background-color: var(--card-color);
  border-radius: 10px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  padding: 1.5rem;
  overflow: hidden;
}

.samples-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  margin-top: 1rem;
}

.samples-table th, 
.samples-table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.samples-table th {
  background-color: #f8f9fa;
  font-weight: 600;
  color: #495057;
}

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

.samples-table .prompt-cell {
  max-width: 600px;
  min-width: 300px;
  word-wrap: break-word;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: break-word;
  display: block;
  padding: 0.75rem;
  line-height: 1.4;
}

.samples-table .complexity-cell {
  width: 120px;
  text-align: center;
}

.samples-table .model-cell {
  width: 180px;
}

.samples-table .try-button {
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
}

.sample-loading {
  text-align: center;
  padding: 2rem;
  color: #6c757d;
  display: none;
}

.sample-loading.active {
  display: block;
}

/* Arena tab styles */
.arena-interface {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  height: calc(100vh - 260px);
  min-height: 600px;
}

.arena-input-container {
  background-color: var(--card-color);
  border-radius: 10px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  padding: 1.5rem;
  margin-top: auto;
}

.arena-input {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.input-with-button {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
}

.arena-input textarea {
  flex: 1;
  padding: 1rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  resize: none;
  height: 100px;
  font-family: inherit;
  font-size: 1rem;
  box-sizing: border-box;
}

.model-selection {
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.model-selection label {
  font-weight: 500;
  color: #495057;
  white-space: nowrap;
}

.model-dropdown {
  flex: 1;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 1rem;
}

.compare-button {
  padding: 0.75rem 1.5rem;
  height: 60px; /* Match the height of the textarea */
  font-size: 1rem;
  background-color: var(--primary-color);
  transition: background-color 0.2s;
  white-space: nowrap;
  align-self: stretch;
}

.compare-button:hover {
  background-color: #2563eb;
}

.arena-comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.arena-column {
  background-color: var(--card-color);
  border-radius: 10px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0; /* Ensures text doesn't overflow container */
}

.arena-column h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-size: 1.25rem;
  color: #495057;
  display: flex;
  align-items: center;
}

.arena-model-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  font-weight: 500;
  margin-left: 0.5rem;
  background-color: #e9ecef;
  font-size: 0.85rem;
}

.arena-model-container {
  flex-grow: 1;
  height: 350px;
  max-height: calc(100vh - 500px);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1rem;
  position: relative;
  overflow-y: auto;
  margin-bottom: 1rem;
}

.arena-messages {
  white-space: pre-wrap;
  font-size: 0.95rem;
  overflow-wrap: break-word;
}

.arena-loading {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.8);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  display: none;
}

.arena-loading.active {
  display: flex;
}

.arena-metrics {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.arena-metric-item {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
}

.arena-metric-label {
  font-weight: 500;
  color: #6c757d;
}

.arena-metric-value {
  font-weight: 600;
}

/* Responsive design */
@media (max-width: 991px) {
  .chat-interface {
    grid-template-columns: 1fr;
  }
  
  .chat-messages {
    min-height: 400px;
    max-height: 400px;
  }
  
  .arena-comparison {
    grid-template-columns: 1fr;
  }
  
  .samples-table {
    font-size: 0.875rem;
  }
  
  .samples-table th, 
  .samples-table td {
    padding: 0.5rem;
  }
  
  .samples-table .prompt-cell {
    max-width: 100%;
    min-width: auto;
    font-size: 0.875rem;
    line-height: 1.4;
    padding: 0.5rem;
  }
}