::-webkit-scrollbar {
  display: none;
}

@font-face {
  font-family: "Gontserrat";
  src: url("../assets/fonts/Gontserrat-Regular.ttf");
}

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

:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f7f7f8;
  --text-primary: #0d0d0d;
  --code: #1e1e1e;
  --text-secondary: #565656;
  --border-color: #d1d5db;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

html[data-theme="dark"] {
  --bg-primary: #0d0d0d;
  --bg-secondary: #1a1a1a;
  --text-primary: #ececec;
  --code: #ffffff;
  --text-secondary: #b4b4b4;
  --border-color: #3f3f3f;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

html,
body {
  height: 100%;
  width: 100%;
}

body {
  font-family: "Gontserrat";
  background: var(--bg-primary);
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition:
    background-color 0.3s,
    color 0.3s;
}

.floating-buttons {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  display: flex;
  gap: 0.75rem;
  z-index: 999;
}

.float-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  width: 48px;
  height: 48px;
  border-radius: 12px;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  box-shadow: var(--shadow);
}

.float-btn:hover {
  background: var(--bg-primary);
  color: var(--text-primary);
  border-color: var(--text-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

@media (max-width: 768px) {
  .floating-buttons {
    bottom: 1.5rem;
    right: 1.5rem;
  }

  .float-btn {
    width: 44px;
    height: 44px;
    font-size: 1rem;
  }
}

.container {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

.messages-area {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding: 0;
}

.messages-area::-webkit-scrollbar {
  width: 8px;
}

.messages-area::-webkit-scrollbar-track {
  background: transparent;
}

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

.messages-area::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 2rem;
  text-align: center;
}

.empty-state-icon {
  width: 60px;
  height: 60px;
  background: var(--bg-secondary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
}

.empty-state h1 {
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.empty-state p {
  font-size: 1rem;
  color: var(--text-secondary);
  max-width: 500px;
}

.messages-container {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.messages-container::-webkit-scrollbar {
  width: 8px;
}

.messages-container::-webkit-scrollbar-track {
  background: transparent;
}

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

.message {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-color);
  animation: slideIn 0.3s ease-out;
}

.message:last-child {
  border-bottom: none;
}

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

.message-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  gap: 1rem;
}

.message-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
  color: white;
  font-weight: 600;
}

.message.user .message-avatar {
  background: #10a37f;
}

.message.assistant .message-avatar {
  background: #0d0d0d;
}

html[data-theme="dark"] .message.assistant .message-avatar {
  background: #ececec;
  color: #0d0d0d;
}

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

  word-wrap: break-word;
  overflow-wrap: break-word;
  word-break: break-word;
}

.message-text {
  margin-bottom: 0.5rem;
}

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

.message-content h1,
.message-content h2,
.message-content h3,
.message-content h4,
.message-content h5,
.message-content h6 {
  margin: 1rem 0 0.5rem 0;
  font-weight: 700;
  line-height: 1.4;
}

.message-content h1 {
  font-size: 1.75rem;
}

.message-content h2 {
  font-size: 1.5rem;
}

.message-content h3 {
  font-size: 1.25rem;
}

.message-content h4 {
  font-size: 1.1rem;
}

.message-content h5 {
  font-size: 1rem;
}

.message-content h6 {
  font-size: 0.95rem;
}

.code-block pre {
  white-space: pre-wrap;
  margin: 0;
  padding: 1rem;
  overflow-x: auto;
}

.code-block code {
  font-family: "Monaco", "Menlo", "Ubuntu Mono", monospace;
  line-height: 1.5;
}

.code-block {
  background: #f5f5f5;
  border-radius: 8px;
  overflow: hidden;
  margin: 1rem 0;
  border: 1px solid #d1d5db;
}

.code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #2d2d2d;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #2a2a2a;
}

.code-language {
  font-size: 0.75rem;
  color: #888;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.copy-btn {
  background: transparent;
  border: 1px solid #3a3a3a;
  color: #888;
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.75rem;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 500;
}

.copy-btn:hover {
  background: #2a2a2a;
  color: #ccc;
  border-color: #4a4a4a;
}

.copy-btn.copied {
  color: #10b981;
  border-color: #10b981;
}

.code-content {
  padding: 1rem;
  overflow-x: auto;
  font-size: 0.875rem;
  line-height: 1.5;
}

.code-content code {
  font-family: "Monaco", "Menlo", "Ubuntu Mono", monospace;
  color: var(--code);
}

html[data-theme="dark"] .code-block {
  background: #1e1e1e;
  border: 1px solid #2a2a2a;
}

.message-content ul,
.message-content ol {
  margin-left: 1.5rem;
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

.message-content li {
  margin-bottom: 0.25rem;
}

.message-content strong {
  font-weight: 600;
}

.message-content em {
  font-style: italic;
}

.input-area {
  background: var(--bg-primary);
  border-top: 1px solid var(--border-color);
  padding: 1rem 0;
  flex-shrink: 0;
}

.input-wrapper {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1.5rem;
  width: 100%;
}

.input-form {
  display: flex;
  gap: 0.75rem;
  align-items: flex-end;
}

.textarea-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
}

textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-family: "Gontserrat";
  font-size: 0.95rem;
  resize: none;
  min-height: 44px;
  max-height: 200px;
  transition: all 0.2s;
  color: var(--text-primary);
  background: var(--bg-primary);
}

textarea:focus {
  outline: none;
  border-color: var(--text-primary);
  box-shadow: 0 0 0 2px rgba(13, 13, 13, 0.05);
}

html[data-theme="dark"] textarea:focus {
  box-shadow: 0 0 0 2px rgba(236, 236, 236, 0.1);
}

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

.send-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}

.send-btn:hover:not(:disabled) {
  background: var(--bg-secondary);
}

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

.spinner {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid var(--border-color);
  border-top-color: var(--text-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-secondary);
  padding: 1rem 1.5rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow);
  font-size: 0.9rem;
  animation: slideUp 0.3s ease-out;
  z-index: 1000;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

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

.toast.success {
  border-left: 3px solid #10b981;
}

.toast.error {
  border-left: 3px solid #ef4444;
}

.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: 2000;
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: var(--bg-primary);
  padding: 2rem;
  border-radius: 12px;
  max-width: 500px;
  width: 90%;
  box-shadow: 0 20px 25px rgba(0, 0, 0, 0.15);
  max-height: 80vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.modal-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.2s;
}

.modal-close:hover {
  color: var(--text-primary);
}

.modal-body {
  color: var(--text-secondary);
  line-height: 1.6;
}

.modal-body h3 {
  color: var(--text-primary);
  margin-top: 1rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.modal-body p {
  margin-bottom: 1rem;
}

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

.settings-group label {
  font-family: "Gontserrat";
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  color: var(--text-primary);
  font-weight: 500;
}

.settings-group input[type="radio"] {
  cursor: pointer;
}

.warn {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-top: 0.5rem;
  line-height: 1.4;
  max-width: 100%;
  text-align: center;
  display: block;
}

.logo {
  width: 100%;
  max-width: 600px;
  height: auto;
  display: block;
  margin: 0 auto;
}