/* Custom Typography */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Space+Grotesk:wght@400;500;600;700;800&display=swap');

:root {
  --bg-primary: #000000;
  --bg-sidebar: #0a0a0a;
  --bg-card: #121212;
  --bg-card-hover: #1c1c1c;
  --border-color: #262626;
  --text-primary: #ffffff;
  --text-secondary: #8a8a8a;
  --accent-purple: #ffffff;
  --accent-blue: #ffffff;
  --accent-glow: rgba(255, 255, 255, 0.05);
  --font-sans: 'Outfit', sans-serif;
  --font-mono: 'Space Grotesk', monospace;
  --glass-blur: none;
  --transition-smooth: all 0.2s ease-in-out;
}

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

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  display: flex;
}

/* Scrollbar Customization */
::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #333333;
  border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover {
  background: #555555;
}

/* Sidebar Styling */
.sidebar {
  width: 260px;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  height: 100%;
  flex-shrink: 0;
  transition: var(--transition-smooth);
  z-index: 10;
}

.sidebar-header {
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border-color);
}

.logo-icon {
  width: 32px;
  height: 32px;
  background: #ffffff;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 800;
  color: #000000;
  border: 1px solid #ffffff;
}

.logo-text {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: #ffffff;
}

.new-chat-btn {
  margin: 16px 20px;
  padding: 10px;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition-smooth);
}

.new-chat-btn:hover {
  background: var(--bg-card-hover);
  border-color: #ffffff;
}

.chat-history {
  flex: 1;
  overflow-y: auto;
  padding: 0 16px 16px;
}

.history-item {
  padding: 10px;
  border-radius: 6px;
  cursor: pointer;
  margin-bottom: 6px;
  font-size: 14px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: var(--transition-smooth);
  border: 1px solid transparent;
}

.history-item:hover, .history-item.active {
  background: var(--bg-card);
  color: var(--text-primary);
  border-color: var(--border-color);
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
}

.status-dot {
  width: 6px;
  height: 6px;
  background: #ffffff;
  border-radius: 50%;
  border: 1px solid #ffffff;
}

/* Chat Main Layout */
.chat-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
  background-color: var(--bg-primary);
}

.chat-header {
  height: 60px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: var(--bg-primary);
  z-index: 5;
}

.header-title h2 {
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.5px;
}

.header-actions {
  display: flex;
  gap: 8px;
}

.btn-icon {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 16px;
  padding: 6px;
  border-radius: 6px;
  transition: var(--transition-smooth);
}

.btn-icon:hover {
  color: var(--text-primary);
  background: var(--bg-card);
}

/* Chat Output Thread */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 30px 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.message-wrapper {
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  gap: 20px;
}

.message-avatar {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
  border: 1px solid var(--border-color);
}

.message-avatar.user {
  background: transparent;
  color: var(--text-primary);
  border-color: #ffffff;
}

.message-avatar.ai {
  background: #ffffff;
  color: #000000;
}

.message-content {
  flex: 1;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-primary);
}

.message-content strong {
  font-weight: 700;
  color: #ffffff;
}

.message-content p {
  margin-bottom: 12px;
}

.message-content p:last-child {
  margin-bottom: 0;
}

/* Gray Code Box styling inside chat */
.message-content pre {
  background-color: #1e1e1e;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 12px;
  margin: 10px 0;
  overflow-x: auto;
}

.message-content code {
  font-family: var(--font-mono);
  font-size: 13px;
  color: #d4d4d4;
  background-color: transparent;
  padding: 0;
  border-radius: 0;
}

/* Inline code blocks */
.message-content p code {
  background-color: #1a1a1a;
  border: 1px solid var(--border-color);
  color: #ffffff;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
}

/* Minimalist loading circle style */
.agent-step {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  margin: 8px 0 16px 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.agent-step-info {
  font-size: 13px;
  color: var(--text-secondary);
}

.loading-circle {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spinnerRotate 0.8s infinite linear;
}

@keyframes spinnerRotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Chat Input Bar */
.chat-input-area {
  padding: 20px 24px 30px;
  background: var(--bg-primary);
}

.input-box-wrapper {
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 10px 14px;
  display: flex;
  align-items: flex-end;
  gap: 12px;
  transition: var(--transition-smooth);
}

.input-box-wrapper:focus-within {
  border-color: #ffffff;
}

.textarea-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 15px;
  resize: none;
  max-height: 200px;
  min-height: 22px;
  padding-top: 2px;
}

.textarea-input::placeholder {
  color: var(--text-secondary);
}

.btn-send {
  background: #ffffff;
  color: #000000;
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

.btn-send:hover {
  background: #e0e0e0;
}

/* Settings Modal */
.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal-content {
  background: var(--bg-sidebar);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  width: 90%;
  max-width: 440px;
  padding: 24px;
  box-shadow: none;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 600;
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-group input, .form-group select {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 8px 12px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  outline: none;
}

.form-group input:focus, .form-group select:focus {
  border-color: #ffffff;
}

.modal-footer {
  margin-top: 24px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  font-size: 14px;
}

.btn-primary {
  background: #ffffff;
  color: #000000;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
}

/* Minimalist Canvas Layout Panel Selector */
.canvas-panel {
  width: 0;
  background-color: #000000;
  border-left: 0 solid var(--border-color);
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1), border-left-width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.canvas-panel.open {
  width: 50%;
  border-left-width: 1px;
}

.canvas-header {
  height: 60px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  flex-shrink: 0;
}

.canvas-badge {
  font-size: 11px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border-color);
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #ffffff;
}

.canvas-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 24px;
  overflow: hidden;
  background: #050505;
}

.canvas-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 12px;
  color: var(--text-secondary);
}

.canvas-editor {
  flex: 1;
  background: #0a0a0a;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 20px;
  color: #f3f4f6;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.6;
  outline: none;
  resize: none;
}

