/* ===========================
   Hovor Chat - Styles
   =========================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&display=swap');

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

:root {
  --primary: #5DADE2;
  --primary-dark: #4A9CC5;
  --primary-light: #7DBDE8;
  --accent: #1e3a5f;
  --bg-dark: #FFFFFF;
  --bg-gradient: linear-gradient(180deg, #F8FAFF 0%, #FFFFFF 100%);
  --bg-card: #F8FAFF;
  --bg-card-hover: #EDF2FA;
  --bg-sidebar: #FFFFFF;
  --text-primary: #1E293B;
  --text-secondary: #475569;
  --text-muted: #94A3B8;
  --border: #E2E8F0;
  --success: #10b981;
  --error: #ef4444;
  --warning: #f59e0b;
  --gradient: linear-gradient(135deg, #5DADE2 0%, #3498DB 50%, #2E86C1 100%);
  --message-user: #5DADE2;
  --message-assistant: var(--bg-card);
  --thinking-bg: #fef3c7;
  --input-border: rgba(93, 173, 226, 0.2);
  --input-shadow: rgba(93, 173, 226, 0.08);
  --input-focus-border: rgba(93, 173, 226, 0.4);
  --input-focus-shadow: rgba(93, 173, 226, 0.15);
}

[data-theme='dark'] {
  --primary: #5DADE2;
  --primary-dark: #4A9CC5;
  --primary-light: #7DBDE8;
  --accent: #7DBDE8;
  --bg-dark: #0f172a;
  --bg-gradient: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
  --bg-card: #1e293b;
  --bg-card-hover: #334155;
  --bg-sidebar: #0f172a;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border: #334155;
  --message-user: #3b82f6;
  --message-assistant: #1e293b;
  --thinking-bg: #422006;
  --input-border: rgba(93, 173, 226, 0.25);
  --input-shadow: rgba(93, 173, 226, 0.1);
  --input-focus-border: rgba(93, 173, 226, 0.5);
  --input-focus-shadow: rgba(93, 173, 226, 0.2);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg-gradient);
  color: var(--text-primary);
  line-height: 1.6;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

/* ==================== Layout ==================== */

.chat-app {
  display: flex;
  height: 100vh;
  height: 100dvh;
}

/* ==================== Sidebar ==================== */

.sidebar {
  width: 320px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease;
}

.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid var(--border);
}

.logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  margin-bottom: 16px;
}

.logo-img {
  height: 42px;
  width: auto;
  object-fit: contain;
}

.btn-new-chat {
  width: 100%;
  justify-content: center;
}

.sidebar-search {
  padding: 12px 20px;
}

.sidebar-search input {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.9rem;
  outline: none;
  transition: all 0.2s ease;
}

.sidebar-search input:focus {
  border-color: var(--primary);
}

.sidebar-search input::placeholder {
  color: var(--text-muted);
}

.chat-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chat-item {
  display: flex;
  align-items: center;
  padding: 12px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s;
}

.chat-item:hover {
  background: var(--bg-card-hover);
}

.chat-item.active {
  background: var(--primary);
  color: white;
}

.chat-item-icon {
  margin-right: 10px;
  font-size: 16px;
}

.chat-item-title {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.chat-item-delete {
  opacity: 0;
  background: none;
  border: none;
  color: var(--error);
  cursor: pointer;
  padding: 4px;
  font-size: 14px;
  transition: opacity 0.2s;
}

.chat-item:hover .chat-item-delete {
  opacity: 1;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}

.user-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.user-credits {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  background: var(--bg-card);
  border-radius: 16px;
  font-size: 13px;
  font-weight: 500;
}

.user-email {
  font-size: 12px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100px;
}

.sidebar-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
}

.btn-logout {
  color: var(--text-secondary);
  font-size: 12px;
}

.btn-logout:hover {
  color: #e74c3c;
  border-color: #e74c3c;
}

.sidebar-toggle {
  display: none;
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 100;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 18px;
  cursor: pointer;
  color: var(--text-primary);
}

/* ==================== Main Area ==================== */

.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--bg-gradient);
}

/* ==================== Welcome Screen ==================== */

.welcome-screen {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 120px 20px 40px;
  overflow-y: auto;
}

.welcome-content {
  text-align: center;
  max-width: 800px;
  width: 100%;
}

.welcome-icon {
  display: none;
}

.welcome-title {
  font-size: 2.5rem;
  font-weight: 700;
  font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--accent);
  letter-spacing: -0.02em;
  margin-bottom: 16px;
  background: none;
  -webkit-background-clip: unset;
  -webkit-text-fill-color: unset;
  background-clip: unset;
}

.welcome-subtitle {
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--text-secondary);
  margin-bottom: 40px;
  line-height: 1.5;
}

.welcome-features {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.feature {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 14px;
  color: var(--text-secondary);
}

.feature-icon {
  font-size: 18px;
}

/* Welcome input area */
.welcome-input-container {
  background: var(--bg-dark);
  border: 1px solid var(--input-border);
  border-radius: 24px;
  padding: 20px 24px;
  box-shadow: 0 4px 20px var(--input-shadow);
  transition: all 0.3s ease;
  position: relative;
  text-align: left;
  margin-bottom: 24px;
}

.welcome-input-container:focus-within {
  border-color: var(--input-focus-border);
  box-shadow: 0 8px 30px var(--input-focus-shadow);
}

.welcome-input-field {
  width: 100%;
  border: none;
  outline: none;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 1rem;
  color: var(--text-primary);
  background: transparent;
  resize: none;
  min-height: 120px;
  line-height: 1.5;
  padding-bottom: 48px;
}

.welcome-input-field::placeholder {
  color: var(--text-muted);
}

.welcome-input-actions {
  position: absolute;
  bottom: 16px;
  left: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.welcome-input-right {
  position: absolute;
  bottom: 16px;
  right: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.action-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  background: var(--bg-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

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

.action-btn svg {
  width: 20px;
  height: 20px;
  stroke: var(--accent);
}

.web-search-option {
  display: flex;
  align-items: center;
  gap: 8px;
}

.checkbox-wrapper {
  width: 20px;
  height: 20px;
  border: 2px solid var(--accent);
  border-radius: 4px;
  background: var(--bg-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.checkbox-wrapper:hover {
  background: var(--bg-card);
}

.checkbox-wrapper svg {
  width: 12px;
  height: 12px;
  stroke: var(--text-primary);
  stroke-width: 2.5;
  display: none;
}

.checkbox-wrapper.checked {
  background: var(--primary);
  border-color: var(--primary);
}

.checkbox-wrapper.checked svg {
  display: block;
  stroke: #FFFFFF;
}

.web-search-label {
  font-size: 0.9rem;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}

/* Welcome buttons */
.welcome-buttons {
  display: flex;
  justify-content: center;
}

#welcome-new-chat {
  display: none;
}

.btn-welcome-submit {
  padding: 14px 32px;
  background: var(--primary);
  border: none;
  border-radius: 12px;
  color: #FFFFFF;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 16px rgba(93, 173, 226, 0.3);
}

.btn-welcome-submit:hover {
  background: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(93, 173, 226, 0.4);
}

.btn-welcome-submit:active {
  transform: translateY(0);
}

/* Chat Welcome State (empty chat) */
.chat-welcome-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: calc(100vh - 140px);
  padding: 40px 0;
}

.chat-welcome-state .welcome-title {
  margin-bottom: 16px;
}

.chat-welcome-state .welcome-subtitle {
  margin-bottom: 32px;
}

.chat-welcome-state .welcome-input-container {
  width: 100%;
  max-width: 700px;
}

.chat-welcome-state .welcome-buttons {
  margin-top: 24px;
}

/* Auth Required Screen */
.auth-required {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.auth-content {
  text-align: center;
}

.auth-icon {
  font-size: 64px;
  margin-bottom: 20px;
}

.auth-content h2 {
  font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 28px;
  margin-bottom: 10px;
  color: var(--accent);
}

.auth-content p {
  color: var(--text-secondary);
  margin-bottom: 30px;
}

/* ==================== Chat View ==================== */

.chat-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-dark);
  gap: 15px;
  flex-wrap: wrap;
}

/* Chat Stats */
.chat-stats {
  display: flex;
  gap: 15px;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--bg-card);
  border-radius: 20px;
  font-size: 13px;
  border: 1px solid var(--border);
}

.stat-icon {
  font-size: 14px;
}

/* Coin icon */
.icon-coin {
  width: 24px;
  height: 24px;
  vertical-align: -5px;
  display: inline-block;
}

.stat-value {
  font-weight: 600;
  color: var(--primary);
}

.stat-label {
  color: var(--text-muted);
  font-size: 11px;
}

.chat-title-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-title {
  font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--accent);
}

.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.btn-icon:hover {
  opacity: 1;
}

/* ==================== Messages Container ==================== */

.messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

.messages {
  max-width: 800px;
  margin: 0 auto;
}

.message {
  display: flex;
  margin-bottom: 20px;
  animation: fadeIn 0.3s ease;
}

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

.message-user {
  justify-content: flex-end;
}

.message-assistant {
  justify-content: flex-start;
}

.message-bubble {
  max-width: 80%;
  padding: 14px 18px;
  border-radius: 18px;
  font-size: 15px;
  line-height: 1.6;
}

.message-user .message-bubble {
  background: var(--message-user);
  color: white;
  border-bottom-right-radius: 4px;
}

.message-assistant .message-bubble {
  background: var(--message-assistant);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

/* Message content styling */
.message-content {
  word-break: break-word;
}

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

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

.message-content pre {
  background: rgba(0, 0, 0, 0.08);
  padding: 12px;
  border-radius: 10px;
  overflow-x: auto;
  margin: 10px 0;
}

.message-content code {
  font-family: 'Fira Code', 'Consolas', monospace;
  font-size: 13px;
}

.message-content ul,
.message-content ol {
  margin-left: 20px;
  margin-bottom: 10px;
}

.message-content a {
  color: var(--primary);
}

/* Thinking block */
.thinking-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--warning);
  cursor: pointer;
  margin-bottom: 10px;
  padding: 6px 10px;
  background: var(--thinking-bg);
  border-radius: 6px;
  border: none;
  width: fit-content;
}

.thinking-toggle:hover {
  opacity: 0.8;
}

/* Message images */
.message-images {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.message-images img {
  max-width: 200px;
  max-height: 200px;
  border-radius: 10px;
  cursor: pointer;
}

/* Message meta */
.message-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 8px;
  display: flex;
  gap: 10px;
}

/* Typing indicator */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 0;
}

.typing-dot {
  width: 8px;
  height: 8px;
  background: var(--primary);
  border-radius: 50%;
  animation: typing 1.4s infinite;
}

.typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing {
  0%,
  100% {
    opacity: 0.3;
    transform: scale(0.8);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Streaming cursor */
.streaming-cursor {
  display: inline-block;
  width: 2px;
  height: 1.1em;
  background: var(--primary);
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: blink 0.8s step-end infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* ==================== Input Area ==================== */

.input-area {
  padding: 16px 24px 20px;
  background: var(--bg-dark);
}

.input-form {
  max-width: 800px;
  margin: 0 auto;
}

.input-wrapper {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--input-border);
  border-radius: 24px;
  padding: 16px 20px 12px;
  transition: border-color 0.3s, box-shadow 0.3s;
  box-shadow: 0 4px 20px var(--input-shadow);
}

.input-wrapper:focus-within {
  border-color: var(--input-focus-border);
  box-shadow: 0 8px 30px var(--input-focus-shadow);
}

.input-wrapper textarea {
  width: 100%;
  border: none;
  background: none;
  color: var(--text-primary);
  font-size: 1rem;
  line-height: 1.5;
  resize: none;
  max-height: 200px;
  min-height: 48px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  padding: 0;
}

.input-wrapper textarea:focus {
  outline: none;
}

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

.input-bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  padding-top: 4px;
}

.input-options {
  display: flex;
  align-items: center;
  gap: 4px;
}

.option-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  cursor: pointer;
  font-size: 18px;
  color: var(--text-muted);
  transition: color 0.2s, background 0.2s;
  border-radius: 50%;
}

.option-btn:hover {
  color: var(--accent);
  background: var(--bg-card-hover);
}

.option-btn-svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
}

.option-checkbox {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 18px;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
}

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

.option-checkbox input {
  margin: 0;
  width: 14px;
  height: 14px;
  accent-color: var(--primary);
}

.btn-send {
  width: 40px;
  height: 40px;
  min-width: 40px;
  padding: 0;
  font-size: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.15s, opacity 0.2s;
}

.btn-send:hover:not(:disabled) {
  transform: scale(1.05);
}

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

/* ==================== Attachment Preview ==================== */

.attachment-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.preview-item {
  position: relative;
}

.preview-item img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.preview-item.uploading {
  opacity: 0.6;
}

.preview-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  background: var(--error);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

/* Upload spinner */
.upload-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 24px;
  height: 24px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  z-index: 1;
}

/* File preview card (documents) */
.file-preview-card {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  gap: 8px;
  min-width: 160px;
  max-width: 260px;
}

.file-preview-card .file-info {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  flex: 1;
}

.file-preview-card .file-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.file-preview-card .file-details {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.file-preview-card .file-name {
  font-size: 12px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-primary);
}

.file-preview-card .file-size {
  font-size: 11px;
  color: var(--text-muted);
}

/* File attachments in messages */
.message-files {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}

.file-attachment {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  font-size: 13px;
  transition: background 0.2s;
  max-width: 100%;
}

.file-attachment:hover {
  background: rgba(0, 0, 0, 0.12);
}

.message-user .file-attachment {
  background: rgba(255, 255, 255, 0.15);
  color: white;
}

.message-user .file-attachment:hover {
  background: rgba(255, 255, 255, 0.25);
}

.file-attachment .file-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.file-attachment .file-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ==================== Thinking Modal ==================== */

.thinking-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.thinking-content {
  background: var(--bg-card);
  border-radius: 18px;
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
}

.thinking-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}

.thinking-body {
  padding: 20px;
  overflow-y: auto;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
  white-space: pre-wrap;
}

.btn-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-muted);
  cursor: pointer;
}

/* ==================== Buttons ==================== */

.btn {
  padding: 10px 20px;
  border-radius: 12px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 16px rgba(93, 173, 226, 0.3);
}

.btn-primary:hover {
  background: var(--primary-light);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(93, 173, 226, 0.4);
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border);
}

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

.btn-small {
  padding: 6px 12px;
  font-size: 12px;
}

.btn-large {
  padding: 14px 28px;
  font-size: 16px;
}

.theme-toggle {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.2s;
}

.theme-toggle:hover {
  background: var(--bg-card-hover);
  border-color: var(--primary);
}

/* ==================== Empty State ==================== */

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.empty-state svg {
  width: 48px;
  height: 48px;
  stroke: var(--border);
  margin-bottom: 16px;
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 15px;
}

/* ==================== Loading ==================== */

.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* ==================== Responsive ==================== */

@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 50;
    transform: translateX(-100%);
    width: 280px;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-toggle {
    display: block;
  }

  .welcome-screen {
    padding: 80px 16px 40px;
  }

  .welcome-title {
    font-size: 1.75rem;
    margin-bottom: 12px;
  }

  .welcome-input-container {
    padding: 16px 20px;
  }

  .welcome-input-field {
    font-size: 0.95rem;
    min-height: 80px;
  }

  .message-bubble {
    max-width: 90%;
  }

  .welcome-features {
    flex-direction: column;
    align-items: center;
  }

  .input-area {
    padding: 10px 12px 14px;
    flex-shrink: 0;
  }

  .input-wrapper {
    padding: 12px 14px 10px;
  }

  .input-wrapper textarea {
    font-size: 16px;
    min-height: 40px;
  }

  .option-checkbox span {
    display: none;
  }

  .option-checkbox {
    padding: 6px;
  }
}

@media (max-width: 480px) {
  .welcome-input-container {
    padding-bottom: 56px;
  }

  .welcome-input-actions {
    bottom: 14px;
    left: 16px;
  }

  .welcome-input-right {
    bottom: 14px;
    right: 16px;
  }
}

/* ==================== Scrollbar ==================== */

::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ==================== Error State ==================== */

.error-message {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid var(--error);
  color: var(--error);
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 15px;
  font-size: 14px;
}

/* ==================== Toast Notifications ==================== */

.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1001;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 20px;
  margin-top: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  animation: slideIn 0.3s ease;
  font-size: 14px;
}

.toast.error {
  border-color: var(--error);
}

.toast.success {
  border-color: var(--success);
}

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