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

:root {
  --primary: #f38020;
  --primary-dark: #d16d1a;
  --secondary: #0051c3;
  --success: #2e7d32;
  --warning: #f57c00;
  --danger: #c62828;
  --gray-50: #fafafa;
  --gray-100: #f5f5f5;
  --gray-200: #eeeeee;
  --gray-300: #e0e0e0;
  --gray-600: #757575;
  --gray-800: #424242;
  --gray-900: #212121;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: var(--gray-900);
  line-height: 1.6;
  min-height: 100vh;
  padding: 20px;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  padding: 40px;
}

/* Header */
.header {
  text-align: center;
  margin-bottom: 40px;
  padding-bottom: 20px;
  border-bottom: 2px solid var(--gray-200);
}

.header h1 {
  font-size: 2.5rem;
  color: var(--secondary);
  margin-bottom: 8px;
}

.subtitle {
  color: var(--gray-600);
  font-size: 1.1rem;
}

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

.stat-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 12px;
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  color: white;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.stat-icon {
  font-size: 2.5rem;
}

.stat-content {
  flex: 1;
}

.stat-label {
  font-size: 0.9rem;
  opacity: 0.9;
  margin-bottom: 4px;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
}

/* Charts */
.charts-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 24px;
  margin-bottom: 40px;
}

.chart-card {
  background: var(--gray-50);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.chart-card h3 {
  margin-bottom: 20px;
  color: var(--gray-800);
  font-size: 1.2rem;
}

/* Top Issues */
.top-issues {
  background: var(--gray-50);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 40px;
}

.top-issues h2 {
  margin-bottom: 20px;
  color: var(--gray-800);
}

.issues-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.issue-item {
  background: white;
  border-left: 4px solid var(--danger);
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.issue-item.high {
  border-left-color: var(--warning);
}

.issue-item.medium {
  border-left-color: var(--secondary);
}

.issue-item.low {
  border-left-color: var(--success);
}

.issue-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.issue-title {
  font-weight: 600;
  color: var(--gray-800);
  text-transform: capitalize;
}

.issue-count {
  background: var(--gray-200);
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 600;
}

.issue-examples {
  font-size: 0.9rem;
  color: var(--gray-600);
  line-height: 1.5;
}

/* Chat Section */
.chat-section {
  background: var(--gray-50);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 40px;
}

.chat-section h2 {
  margin-bottom: 20px;
  color: var(--gray-800);
}

.chat-container {
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.chat-messages {
  height: 400px;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.message {
  max-width: 80%;
  display: flex;
  flex-direction: column;
}

.message.user {
  align-self: flex-end;
}

.message.assistant {
  align-self: flex-start;
}

.message-content {
  padding: 12px 16px;
  border-radius: 12px;
  line-height: 1.5;
}

.message.user .message-content {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.message.assistant .message-content {
  background: var(--gray-100);
  color: var(--gray-900);
}

.message-content ul {
  margin: 8px 0 0 20px;
}

.message-content li {
  margin: 4px 0;
}

.chat-input-container {
  display: flex;
  gap: 8px;
  padding: 16px;
  border-top: 1px solid var(--gray-200);
  background: var(--gray-50);
}

.chat-input {
  flex: 1;
  padding: 12px 16px;
  border: 2px solid var(--gray-300);
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
}

.chat-input:focus {
  outline: none;
  border-color: var(--secondary);
}

.send-btn {
  padding: 12px 24px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s;
}

.send-btn:hover {
  transform: translateY(-2px);
}

.send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Daily Summary */
.daily-summary {
  background: var(--gray-50);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 40px;
}

.daily-summary h2 {
  margin-bottom: 20px;
  color: var(--gray-800);
}

.summary-content {
  background: white;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  min-height: 200px;
}

.summary-slack {
  background: #611f69;
  color: white;
  border-radius: 8px;
  padding: 20px;
  font-family: 'Courier New', monospace;
}

.summary-slack h3 {
  margin-bottom: 12px;
}

.summary-fields {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin: 16px 0;
}

.summary-field {
  padding: 12px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.secondary-btn {
  padding: 12px 24px;
  background: var(--gray-200);
  color: var(--gray-800);
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.secondary-btn:hover {
  background: var(--gray-300);
}

/* Loading */
.loading {
  text-align: center;
  padding: 40px;
  color: var(--gray-600);
  font-style: italic;
}

.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 12px 16px;
  background: var(--gray-100);
  border-radius: 12px;
  width: fit-content;
}

.typing-dot {
  width: 8px;
  height: 8px;
  background: var(--gray-600);
  border-radius: 50%;
  animation: typing 1.4s infinite;
}

.typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing {
  0%, 60%, 100% {
    transform: translateY(0);
  }
  30% {
    transform: translateY(-10px);
  }
}

/* Footer */
.footer {
  text-align: center;
  padding-top: 20px;
  margin-top: 20px;
  border-top: 2px solid var(--gray-200);
  color: var(--gray-600);
}

/* Responsive */
@media (max-width: 768px) {
  .container {
    padding: 20px;
  }

  .header h1 {
    font-size: 2rem;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .charts-section {
    grid-template-columns: 1fr;
  }

  .message {
    max-width: 90%;
  }
}
