:root {
  /* Royal Purple Palette */
  --primary: #6C5CE7;
  --primary-hover: #5A4BDE;
  --secondary: #A29BFE;
  --accent: #FD79A8;
  --bg-dark: #1A0D2E;
  --bg-panel: rgba(255, 255, 255, 0.03);
  --bg-input: rgba(0, 0, 0, 0.2);
  --border: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(162, 155, 254, 0.5);
  
  --text-main: #FFFFFF;
  --text-muted: rgba(255, 255, 255, 0.6);
  
  --radius: 12px;
  --radius-sm: 8px;
  --transition: 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  background-image: 
    radial-gradient(circle at 15% 50%, rgba(108, 92, 231, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 85% 30%, rgba(253, 121, 168, 0.1) 0%, transparent 50%);
  background-attachment: fixed;
}

.app-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
header {
  margin-bottom: 2rem;
  text-align: center;
}

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
  color: var(--secondary);
}

h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--text-main), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

header p {
  color: var(--text-muted);
  font-size: 1.1rem;
}

/* Layout */
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  flex: 1;
}

/* Panels (Glassmorphism) */
.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
}

h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: var(--text-main);
}

.subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

/* Form Elements */
.form-group {
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--secondary);
}

input, textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  padding: 0.75rem 1rem;
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}

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

textarea {
  min-height: 300px;
  resize: vertical;
  flex: 1;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

input::placeholder, textarea::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

/* Buttons */
.actions {
  display: flex;
  gap: 1rem;
  margin-top: auto;
  padding-top: 1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all var(--transition);
  border: none;
}

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

.btn.primary {
  background: var(--primary);
  color: white;
  flex: 2;
}

.btn.primary:hover:not(:disabled) {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(108, 92, 231, 0.3);
}

.btn.primary:active:not(:disabled) {
  transform: translateY(0);
}

.btn.secondary {
  background: transparent;
  color: var(--text-main);
  border: 1px solid var(--border);
  flex: 1;
}

.btn.secondary:hover {
  background: rgba(255, 255, 255, 0.05);
}

.btn.icon-btn {
  padding: 0.5rem;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.btn.icon-btn:hover:not(:disabled) {
  color: var(--text-main);
  border-color: var(--secondary);
  background: rgba(162, 155, 254, 0.1);
}

.btn.small {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
}

/* Output Panel specific */
.output-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.output-actions {
  display: flex;
  gap: 0.5rem;
}

.output-wrapper {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: auto;
  position: relative;
}

#output-preview {
  padding: 1rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.85rem;
  color: var(--text-main);
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
  min-height: 300px;
}

#output-preview.empty {
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  height: 100%;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--secondary);
  color: var(--bg-dark);
  padding: 0.75rem 1.5rem;
  border-radius: 99px;
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 1000;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

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