* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  max-width: 1600px;
  margin: 0 auto;
  padding: 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
}

.container {
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.1);
  padding: 30px;
  margin-bottom: 20px;
}

h1 {
  color: #333;
  margin-top: 0;
  font-size: 2em;
}

h2 {
  color: #444;
  margin-top: 0;
  border-bottom: 2px solid #667eea;
  padding-bottom: 10px;
}

.status {
  padding: 8px 16px;
  border-radius: 20px;
  display: inline-block;
  font-weight: 600;
  font-size: 14px;
}

.status.connected {
  background: #4caf50;
  color: white;
}

.status.disconnected {
  background: #f44336;
  color: white;
}

.controls {
  margin: 16px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

input[type="text"],
select {
  padding: 10px 14px;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.2s;
}

input[type="text"]:focus,
select:focus {
  outline: none;
  border-color: #667eea;
}

button {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  background: #667eea;
  color: white;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
}

button:hover {
  background: #5568d3;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

button:active {
  transform: translateY(0);
}

button.secondary {
  background: #6c757d;
}

button.secondary:hover {
  background: #5a6268;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
}

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

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

tr:hover {
  background: #f8f9fa;
}

.positive {
  color: #4caf50;
  font-weight: 600;
}

.negative {
  color: #f44336;
  font-weight: 600;
}

.api-section {
  margin-top: 20px;
}

.endpoint-selector {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.endpoint-card {
  flex: 1;
  min-width: 200px;
  padding: 16px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.endpoint-card:hover {
  border-color: #667eea;
  background: #f8f9ff;
}

.endpoint-card.active {
  border-color: #667eea;
  background: #667eea;
  color: white;
}

.endpoint-card h3 {
  margin: 0 0 8px 0;
  font-size: 16px;
}

.endpoint-card p {
  margin: 0;
  font-size: 12px;
  opacity: 0.8;
}

.query-params {
  margin: 20px 0;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 8px;
}

.param-group {
  margin: 12px 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.param-group label {
  min-width: 140px;
  font-weight: 500;
  color: #495057;
}

.param-group input,
.param-group select {
  flex: 1;
  max-width: 400px;
}

.example-btn {
  margin-left: 8px;
  padding: 6px 12px;
  font-size: 12px;
  background: #28a745;
}

.example-btn:hover {
  background: #218838;
}

.response-time {
  margin: 16px 0;
  font-weight: 600;
  color: #666;
  font-size: 14px;
}

.response-time .time {
  color: #667eea;
  font-weight: 700;
}

pre {
  background: #1e1e1e;
  color: #d4d4d4;
  padding: 20px;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.6;
  max-height: 600px;
  overflow-y: auto;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
}

pre.success {
  border-left: 4px solid #4caf50;
}

pre.error {
  border-left: 4px solid #f44336;
}

#ws-logs {
  margin-top: 16px;
  padding: 12px;
  background: #1e1e1e;
  color: #d4d4d4;
  border-radius: 8px;
  max-height: 200px;
  overflow-y: auto;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 12px;
}

.log-entry {
  margin: 4px 0;
  padding: 4px;
}

.log-entry.error {
  color: #f44336;
}

.log-entry.info {
  color: #2196f3;
}

.log-entry.success {
  color: #4caf50;
}

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

.quick-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.quick-action {
  padding: 6px 12px;
  background: #e9ecef;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s;
}

.quick-action:hover {
  background: #667eea;
  color: white;
  border-color: #667eea;
}

a {
  color: #667eea;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

@media (max-width: 768px) {
  body {
    padding: 10px;
  }
  
  .container {
    padding: 20px;
  }
  
  .param-group {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .param-group label {
    min-width: auto;
  }
  
  .param-group input,
  .param-group select {
    width: 100%;
    max-width: none;
  }
  
  h1 {
    font-size: 1.5em;
  }
  
  .container > div:first-child {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .container > div:first-child > div:last-child {
    margin-top: 16px;
    text-align: left;
  }
}

/* Stats Section */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.stat-card {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 16px;
  transition: all 0.2s ease;
}

.stat-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  transform: translateY(-2px);
}

.stat-label {
  font-size: 0.85em;
  color: #666;
  font-weight: 500;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  font-size: 1.5em;
  font-weight: 600;
  color: #333;
  margin-bottom: 4px;
}

.stat-value.success {
  color: #4caf50;
}

.stat-value.error {
  color: #f44336;
}

.stat-detail {
  font-size: 0.85em;
  color: #888;
  margin-top: 4px;
  line-height: 1.4;
  word-break: break-word;
}

@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
}

