*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  color-scheme: dark;
  --bg: #05060a;
  --bg-elevated: #0c0f19;
  --border: #232633;
  --accent: #4f46e5;
  --accent-soft: rgba(79, 70, 229, 0.2);
  --text: #e5e7eb;
  --muted: #9ca3af;
  --danger: #f97373;
  --radius-lg: 16px;
  --radius-md: 10px;
  --shadow-soft: 0 18px 60px rgba(0, 0, 0, 0.45);
}

body {
  margin: 0;
  padding: 0.5rem;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
  background: radial-gradient(circle at top, #111827 0, #020617 55%);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  align-items: stretch;
  justify-content: center;
}

.container {
  max-width: 900px;
  width: 100%;
  padding: 0;
}

.app {
  width: 100%;
  background: linear-gradient(135deg, #020617 0, #020617 55%, #050816 100%);
  border-radius: 20px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  padding: 1.25rem 1rem;
  margin: 0;
}

.header {
  padding-bottom: 0.875rem;
  border-bottom: 1px solid rgba(31, 41, 55, 0.9);
  margin-bottom: 1rem;
}

.header h1 {
  margin: 0 0 0.375rem;
  font-size: clamp(1.25rem, 5vw, 1.625rem);
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.header p {
  color: var(--muted);
  font-size: clamp(0.813rem, 3vw, 0.875rem);
  line-height: 1.3;
}

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.form {
  display: flex;
  flex-direction: column;
}

.form .mb-3 {
  margin-bottom: 0.75rem !important;
}

.label {
  font-size: 0.813rem;
  color: var(--muted);
  margin-bottom: 0.375rem;
}

.textarea {
  resize: vertical;
  min-height: 100px;
  max-height: 220px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: radial-gradient(circle at top left, #020617 0, #020617 55%);
  padding: 0.625rem 0.75rem;
  color: var(--text);
  font-size: 0.875rem;
  line-height: 1.4;
  outline: none;
  transition: border 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(79, 70, 229, 0.6);
  background: radial-gradient(circle at top left, #020617 0, #020617 40%);
}

.select {
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  padding: 0.5rem 0.625rem;
  font-size: 0.813rem;
  outline: none;
  display: none;
}

.button {
  border-radius: 999px;
  border: none;
  padding: 0.75rem 1.125rem;
  background: linear-gradient(135deg, #4f46e5, #6366f1);
  color: white;
  font-size: 0.938rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  box-shadow: 0 10px 30px rgba(79, 70, 229, 0.55);
  transition: transform 0.1s ease, box-shadow 0.1s ease, filter 0.1s ease;
}

.button:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
  background: linear-gradient(135deg, #4f46e5, #6366f1);
}

.button:active {
  transform: translateY(0);
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.35);
}

.status {
  min-height: 16px;
  font-size: 0.75rem;
  color: var(--muted);
}

.response-block {
  border-radius: var(--radius-lg);
  background: radial-gradient(circle at top left, #020617 0, #020617 65%);
  border: 1px solid var(--border);
  padding: 0.75rem 0.875rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 120px;
}

.response-block h2 {
  margin: 0 0 0.5rem;
  font-size: 0.875rem;
  color: #e5e7eb;
  font-weight: 600;
}

.response {
  margin: 0;
  white-space: pre-wrap;
  word-wrap: break-word;
  font-family: ui-monospace, Menlo, Monaco, 'SF Mono', monospace;
  font-size: 0.813rem;
  color: #e5e7eb;
  overflow-y: auto;
  max-height: 280px;
  line-height: 1.5;
}

.meta {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: var(--muted);
}

.meta-label {
  opacity: 0.7;
}

.meta-value {
  color: #e5e7eb;
  margin-left: 0.25rem;
}

.footer {
  margin-top: 0.75rem;
  padding-top: 0.625rem;
  border-top: 1px solid rgba(31, 41, 55, 0.8);
  font-size: 0.688rem;
  color: var(--muted);
  text-align: center;
}

/* Tablet and Desktop */
@media (min-width: 768px) {
  body {
    padding: 1rem;
  }
  
  .app {
    border-radius: 24px;
    padding: 1.5rem;
  }
  
  .select {
    display: block;
    min-width: 220px;
  }
  
  .main {
    gap: 1rem;
  }
  
  .form .mb-3 {
    margin-bottom: 1rem !important;
  }
  
  .textarea {
    min-height: 110px;
    max-height: 260px;
  }
  
  .response-block {
    min-height: 140px;
  }
  
  .response {
    max-height: 320px;
  }
}

/* Small mobile devices */
@media (max-width: 374px) {
  .app {
    padding: 1rem 0.875rem;
  }
  
  .header h1 {
    font-size: 1.125rem;
  }
  
  .textarea {
    min-height: 90px;
    font-size: 0.813rem;
  }
  
  .button {
    padding: 0.688rem 1rem;
    font-size: 0.875rem;
  }
}

/* Fix for mobile alignment */
@media (max-width: 767.98px) {
  .container {
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
}
