:root {
  --background: #ffffff;
  --foreground: #09090b;
  --card: #ffffff;
  --card-foreground: #09090b;
  --popover: #ffffff;
  --popover-foreground: #09090b;
  --primary: #18181b;
  --primary-foreground: #fafafa;
  --secondary: #f4f4f5;
  --secondary-foreground: #18181b;
  --muted: #f4f4f5;
  --muted-foreground: #71717a;
  --accent: #f4f4f5;
  --accent-foreground: #18181b;
  --destructive: #ef4444;
  --destructive-foreground: #fafafa;
  --border: #e4e4e7;
  --input: #e4e4e7;
  --ring: #18181b;
  --radius: 0.5rem;
}

/* Dark theme */
[data-theme="dark"] {
  --background: #09090b;
  --foreground: #fafafa;
  --card: #09090b;
  --card-foreground: #fafafa;
  --popover: #09090b;
  --popover-foreground: #fafafa;
  --primary: #fafafa;
  --primary-foreground: #18181b;
  --secondary: #27272a;
  --secondary-foreground: #fafafa;
  --muted: #27272a;
  --muted-foreground: #a1a1aa;
  --accent: #27272a;
  --accent-foreground: #fafafa;
  --destructive: #7f1d1d;
  --destructive-foreground: #fafafa;
  --border: #27272a;
  --input: #27272a;
  --ring: #d4d4d8;
}

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

html {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--background);
  color: var(--foreground);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  line-height: 1.5;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  transition: background-color 0.3s ease;
}

.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem;
}

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

.title {
  font-size: 2.25rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  margin-bottom: 0.5rem;
  background: linear-gradient(to right, var(--primary), var(--muted-foreground));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.description {
  color: var(--muted-foreground);
  font-size: 1rem;
}

.card {
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  transition: border-color 0.2s ease;
}

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

.form-group {
  margin-bottom: 1.25rem;
}

.label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--foreground);
}

.input, .textarea {
  width: 100%;
  padding: 0.75rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--foreground);
  background-color: var(--background);
  border: 1px solid var(--input);
  border-radius: var(--radius);
  transition: all 0.2s ease;
}

.input:focus, .textarea:focus {
  outline: none;
  border-color: var(--ring);
  box-shadow: 0 0 0 1px var(--ring);
}

.textarea {
  min-height: 120px;
  resize: vertical;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background-color: var(--primary);
  color: var(--primary-foreground);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.button:hover {
  background-color: var(--primary-foreground);
  color: var(--primary);
}

.button:active {
  transform: translateY(1px);
}

.button-secondary {
  background-color: var(--secondary);
  color: var(--secondary-foreground);
}

.button-secondary:hover {
  background-color: var(--muted);
}

.code-block {
  background-color: var(--muted);
  border-radius: var(--radius);
  padding: 1rem;
  font-family: 'Fira Code', monospace;
  font-size: 0.875rem;
  line-height: 1.7;
  overflow-x: auto;
}

.code-block code {
  color: var(--foreground);
}

.helper-text {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  margin-top: 0.5rem;
}

.user-request-box {
  background-color: var(--muted);
  padding: 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-style: italic;
  color: var(--foreground);
  border-left: 3px solid var(--primary);
}

.error {
  color: var(--destructive);
  font-size: 0.875rem;
  margin-top: 0.5rem;
}

.theme-toggle {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background-color: var(--background);
  color: var(--foreground);
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 100;
}

.theme-toggle:hover {
  border-color: var(--primary);
  transform: scale(1.1);
}

.theme-toggle svg {
  width: 1.25rem;
  height: 1.25rem;
}

/* Table styles */
.table-container {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
  overflow-y: hidden;
  max-width: 100%;
}

table {
  width: 100%;
  min-width: 600px;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.875rem;
}

th {
  font-weight: 500;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  color: var(--muted-foreground);
  background-color: var(--muted);
  padding: 0.75rem 1rem;
}

td {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border);
  color: var(--foreground);
}

tr:hover td {
  background-color: var(--muted);
}

/* Loading spinner */
.loading {
  width: 1rem;
  height: 1rem;
  border: 2px solid var(--muted);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-right: 0.5rem;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Responsive design */
@media (max-width: 640px) {
  .container {
    padding: 1rem;
  }

  .title {
    font-size: 1.875rem;
  }

  .card {
    padding: 1rem;
  }

  .button {
    width: 100%;
    margin-bottom: 0.5rem;
  }

  .theme-toggle {
    bottom: 1rem;
    right: 1rem;
  }

  /* Mobile table styles */
  .table-container {
    margin: 0 -1rem;
  }

  table {
    min-width: 800px;
    font-size: 0.75rem;
  }

  th, td {
    padding: 0.5rem 0.75rem;
  }
}

/* Prompt styles */
.prompt-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.prompt-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted-foreground);
  background-color: var(--secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s ease;
}

.prompt-toggle:hover {
  background-color: var(--muted);
  color: var(--foreground);
}

.prompt-icon {
  transition: transform 0.2s ease;
}

.prompt-toggle:hover .prompt-icon {
  transform: scale(1.1);
}
