:root {
  --bg-color: #0b0f19;
  --bg-gradient: linear-gradient(135deg, #0f172a, #1e1b4b, #0f172a);
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.1);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --accent-1: #8b5cf6;
  --accent-2: #3b82f6;
  --accent-gradient: linear-gradient(90deg, var(--accent-1), var(--accent-2));
  --danger: #ef4444;
}

body {
  margin: 0;
  font-family: 'Outfit', sans-serif;
  background: var(--bg-color);
  background-image: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

nav {
  padding: 1.5rem 3rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  font-size: 1.8rem;
  font-weight: 600;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-decoration: none;
  letter-spacing: -0.5px;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  margin-left: 1.5rem;
  font-weight: 600;
  font-size: 1.15rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  transition: all 0.3s ease;
}

.nav-links a:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.1);
}

main {
  flex: 1;
  padding: 3rem 2rem;
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 2.5rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.input-group {
  margin-bottom: 1.5rem;
}

.input-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 500;
}

input[type="text"], input[type="password"], textarea {
  width: 100%;
  padding: 0.85rem 1.2rem;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  color: var(--text-primary);
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  box-sizing: border-box;
  transition: all 0.3s ease;
}

input:focus, textarea:focus {
  outline: none;
  border-color: var(--accent-1);
  background: rgba(0, 0, 0, 0.6);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

textarea {
  min-height: 350px;
  resize: vertical;
  line-height: 1.5;
}

button {
  background: var(--accent-gradient);
  color: white;
  border: none;
  padding: 0.85rem 1.8rem;
  border-radius: 12px;
  font-weight: 600;
  font-size: 1rem;
  font-family: 'Outfit', sans-serif;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(139, 92, 246, 0.4);
}

button:active {
  transform: translateY(0);
}

button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  text-decoration: none;
  padding: 0.85rem 1.8rem;
  border-radius: 12px;
  font-weight: 600;
  display: inline-block;
  transition: all 0.2s ease;
  border: 1px solid var(--glass-border);
  text-align: center;
}

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

.btn-danger {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.3);
  box-shadow: none;
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.3);
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.2);
}

.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  padding: 1rem 1.5rem;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  display: none;
  z-index: 3000;
  font-weight: 500;
  animation: slideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(50px); }
  to { opacity: 1; transform: translateX(0); }
}

.modal {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 1rem;
}

.modal-content {
  background: #0f172a;
  max-width: 450px;
  width: 100%;
}

/* Markdown Styles */
.markdown-body {
  color: var(--text-primary);
  line-height: 1.7;
  font-size: 1.35rem;
}

.markdown-body h1, .markdown-body h2 {
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 0.5rem;
  margin-top: 2rem;
}

.markdown-body pre {
  background: rgba(0, 0, 0, 0.5);
  padding: 1.2rem;
  border-radius: 12px;
  overflow-x: auto;
  border: 1px solid var(--glass-border);
}

.markdown-body code {
  font-family: 'Consolas', monospace;
  background: rgba(0, 0, 0, 0.4);
  padding: 0.2em 0.4em;
  border-radius: 6px;
  font-size: 0.9em;
  color: #a78bfa;
}

.markdown-body pre code {
  background: none;
  padding: 0;
  color: var(--text-primary);
}

.code-block-wrapper {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  overflow: hidden;
  margin: 1.5rem 0;
}

.think-block {
  max-height: 300px;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--glass-border);
  border-left: 4px solid var(--text-secondary);
  padding: 1rem;
  margin: 1.5rem 0;
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 0.95em;
  white-space: pre-wrap;
  font-family: 'Outfit', sans-serif;
}

.think-block::-webkit-scrollbar {
  width: 8px;
}

.think-block::-webkit-scrollbar-track {
  background: transparent;
}

.think-block::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.code-block-header {
  background: rgba(255, 255, 255, 0.05);
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--glass-border);
  font-family: 'Outfit', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.copy-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  padding: 0.3rem 0.8rem;
  font-size: 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Outfit', sans-serif;
  text-transform: none;
  letter-spacing: normal;
  box-shadow: none;
}

.copy-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: none;
  box-shadow: none;
}

.code-block-body {
  display: flex;
  max-height: 500px;
}

.code-block-scroller {
  overflow-y: scroll;
  overflow-x: hidden;
  width: 14px;
  background: rgba(0, 0, 0, 0.2);
}

.code-block-scroller::-webkit-scrollbar {
  width: 14px;
}

.code-block-scroller::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 7px;
  border: 3px solid transparent;
  background-clip: padding-box;
}

.code-block-scroller::-webkit-scrollbar-track {
  background: transparent;
}

.markdown-body .code-block-wrapper pre {
  margin: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  flex: 1;
  overflow: hidden;
}

.markdown-body pre code.hljs {
  background: transparent;
  padding: 0;
}

.markdown-body a {
  color: var(--accent-1);
  text-decoration: none;
}

.markdown-body a:hover {
  text-decoration: underline;
}

.markdown-body blockquote {
  border-left: 4px solid var(--accent-1);
  margin: 0;
  padding-left: 1rem;
  color: var(--text-secondary);
  background: rgba(139, 92, 246, 0.05);
  padding: 1rem;
  border-radius: 0 8px 8px 0;
}
