/**
 * Test Frontend Styles
 * Clean, modern layout for testing the Limousine Chat Widget
 * Requirements: 9.1, 9.5
 */

/* CSS Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --color-primary: #1a1a2e;
  --color-secondary: #e94560;
  --color-bg: #f5f5f7;
  --color-surface: #ffffff;
  --color-text: #1a1a2e;
  --color-text-muted: #6b7280;
  --color-border: #e5e7eb;
  --color-success: #10b981;
  --color-error: #ef4444;
  --font-family: 'Inter', system-ui, -apple-system, sans-serif;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

body {
  font-family: var(--font-family);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
}

/* Layout */
.container {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 24px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
  min-height: 100vh;
}

/* Main Content */
.main-content {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.header {
  padding: 24px;
  background: linear-gradient(135deg, var(--color-primary) 0%, #16213e 100%);
  border-radius: var(--radius-lg);
  color: white;
}

.header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.header .subtitle {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.95rem;
}

/* Sections */
section {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
}

section h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--color-text);
}

/* Demo Section */
.demo-section p {
  color: var(--color-text-muted);
  margin-bottom: 16px;
}

.controls {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  font-size: 0.9rem;
  font-weight: 500;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: var(--color-secondary);
  color: white;
}

.btn-primary:hover {
  background: #d63d56;
}

.btn-secondary {
  background: var(--color-bg);
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

.btn-secondary:hover {
  background: var(--color-border);
}

.btn-export {
  background: var(--color-primary);
  color: white;
}

.btn-export:hover {
  background: #16213e;
}

.btn-small {
  padding: 6px 12px;
  font-size: 0.85rem;
}

.icon {
  font-size: 1rem;
}

/* Message Log */
.message-log-section {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.message-log {
  flex: 1;
  min-height: 300px;
  max-height: 500px;
  overflow-y: auto;
  padding: 16px;
  background: var(--color-bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
}

.message-log .placeholder {
  color: var(--color-text-muted);
  text-align: center;
  padding: 40px;
}

.message-item {
  padding: 12px 16px;
  margin-bottom: 8px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
}

.message-item.user {
  background: var(--color-secondary);
  color: white;
  margin-left: 20%;
}

.message-item.assistant {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  margin-right: 20%;
}

.message-item.system {
  background: var(--color-primary);
  color: white;
  text-align: center;
  font-size: 0.8rem;
  opacity: 0.8;
}

.message-item .timestamp {
  display: block;
  font-size: 0.75rem;
  opacity: 0.7;
  margin-top: 4px;
}

/* Sidebar */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Data Section */
.data-section {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.data-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.json-display {
  flex: 1;
  min-height: 300px;
  max-height: 500px;
  overflow: auto;
  padding: 16px;
  background: #1e1e1e;
  border-radius: var(--radius-sm);
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 0.85rem;
  line-height: 1.5;
}

.json-display code {
  color: #d4d4d4;
  white-space: pre-wrap;
  word-break: break-word;
}

/* JSON Syntax Highlighting */
.json-key {
  color: #9cdcfe;
}

.json-string {
  color: #ce9178;
}

.json-number {
  color: #b5cea8;
}

.json-boolean {
  color: #569cd6;
}

.json-null {
  color: #569cd6;
}

/* Status Section */
.status-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.status-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--color-bg);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
}

.status-item .label {
  color: var(--color-text-muted);
}

.status-item .value {
  font-weight: 500;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .container {
    grid-template-columns: 1fr;
  }

  .sidebar {
    order: -1;
  }

  .json-display,
  .message-log {
    max-height: 300px;
  }
}

@media (max-width: 640px) {
  .container {
    padding: 16px;
    gap: 16px;
  }

  .header {
    padding: 16px;
  }

  .header h1 {
    font-size: 1.5rem;
  }

  .controls {
    flex-direction: column;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }

  .data-actions {
    flex-direction: column;
  }

  .message-item.user {
    margin-left: 10%;
  }

  .message-item.assistant {
    margin-right: 10%;
  }
}

/* Scrollbar Styling */
.message-log::-webkit-scrollbar,
.json-display::-webkit-scrollbar {
  width: 8px;
}

.message-log::-webkit-scrollbar-track,
.json-display::-webkit-scrollbar-track {
  background: transparent;
}

.message-log::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 4px;
}

.json-display::-webkit-scrollbar-thumb {
  background: #4a4a4a;
  border-radius: 4px;
}

.message-log::-webkit-scrollbar-thumb:hover,
.json-display::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-muted);
}
