@import url("https://fonts.googleapis.com/css2?family=Inter:wght@100;200;300;400;500;600;700;800;900&display=swap");

:root {
  /* Light theme (default) */
  --background: #f8f9fa;
  --foreground: #1a1a1a;
  --muted: #f1f3f5;
  --muted-foreground: #6c757d;
  --card: #ffffff;
  --card-foreground: #1a1a1a;
  --border: rgba(0, 0, 0, 0.1);
  --input: #f1f3f5;
  --primary: #3a86ff;
  --primary-foreground: #ffffff;
  --secondary: #e9ecef;
  --secondary-foreground: #495057;
  --accent: #4361ee;
  --accent-foreground: #ffffff;
  --destructive: #ff4d4f;
  --destructive-foreground: #ffffff;
  --ring: rgba(58, 134, 255, 0.3);

  /* UI Elements */
  --blur-bg: rgba(255, 255, 255, 0.7);
  --blur-border: rgba(0, 0, 0, 0.08);
  --gradient: rgba(58, 134, 255, 0.2);

  /* Sizing and spacing */
  --font-sans: "Inter", sans-serif;
  --section-gap: 24px;
  --border-radius: 12px;
  --header-height: 60px;
  --sidebar-width: 280px;
  --transition-standard: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.dark {
  --background: #121212;
  --foreground: #f8f9fa;
  --muted: #2a2a2a;
  --muted-foreground: #adb5bd;
  --card: #1e1e1e;
  --card-foreground: #f8f9fa;
  --border: rgba(255, 255, 255, 0.1);
  --input: #2a2a2a;
  --primary: #4361ee;
  --primary-foreground: #ffffff;
  --secondary: #2a2a2a;
  --secondary-foreground: #e9ecef;
  --accent: #3a86ff;
  --accent-foreground: #ffffff;
  --destructive: #ff4d4f;
  --destructive-foreground: #ffffff;
  --ring: rgba(67, 97, 238, 0.3);

  /* UI Elements */
  --blur-bg: rgba(30, 30, 30, 0.7);
  --blur-border: rgba(255, 255, 255, 0.08);
  --gradient: rgba(67, 97, 238, 0.15);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  position: relative;
  font-family: var(--font-sans);
}

html,
body {
  scroll-behavior: smooth;
  overflow: hidden;
  height: 100%;
}

body {
  padding: var(--section-gap);
  background-color: var(--background);
  color: var(--foreground);
  min-height: 100vh;
  transition: background-color var(--transition-standard), color var(--transition-standard);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Layout */
.row {
  display: flex;
  gap: var(--section-gap);
  height: calc(100vh - 2 * var(--section-gap));
  max-width: 1920px;
  margin: 0 auto;
}

.box {
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background-color: var(--blur-bg);
  height: 100%;
  width: 100%;
  border-radius: var(--border-radius);
  border: 1px solid var(--blur-border);
  box-shadow: var(--shadow-md);
  transition: background-color var(--transition-standard), border-color var(--transition-standard), box-shadow
    var(--transition-standard);
  overflow: hidden;
}

.dark .box {
  box-shadow: var(--shadow-lg);
}

/* Conversations sidebar */
.conversations {
  max-width: var(--sidebar-width);
  padding: var(--section-gap);
  overflow: auto;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
  z-index: 10;
}

.conversations .top {
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow: auto;
  flex: 1;
  padding-right: 4px;
}

.conversations .top::-webkit-scrollbar {
  width: 4px;
}

.conversations .top::-webkit-scrollbar-track {
  background: transparent;
}

.conversations .top::-webkit-scrollbar-thumb {
  background-color: var(--muted-foreground);
  border-radius: 10px;
  opacity: 0.5;
}

.conversations .title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--foreground);
  letter-spacing: 0.02em;
  padding: 0 4px;
}

.conversations .convo {
  padding: 12px 16px;
  display: flex;
  gap: 18px;
  align-items: center;
  user-select: none;
  justify-content: space-between;
  border-radius: var(--border-radius);
  transition: all 0.15s ease;
  cursor: pointer;
}

.conversations .convo:hover {
  background-color: var(--secondary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.conversations .convo:active {
  transform: translateY(0);
}

.conversations .convo.active {
  background-color: var(--secondary);
  border-left: 3px solid var(--primary);
}

.conversations .convo .left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: auto;
  min-width: 0;
}

.conversations i {
  color: var(--muted-foreground);
  cursor: pointer;
  transition: color 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.conversations i:hover {
  color: var(--foreground);
}

.convo-title {
  color: var(--foreground);
  font-size: 14px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Main conversation area */
.conversation {
  width: 100%;
  height: 100%;
  overflow-y: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}

.conversation #messages {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 var(--section-gap);
  scroll-behavior: smooth;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.conversation #messages::-webkit-scrollbar {
  width: 6px;
}

.conversation #messages::-webkit-scrollbar-track {
  background: transparent;
}

.conversation #messages::-webkit-scrollbar-thumb {
  background-color: var(--muted-foreground);
  border-radius: 10px;
  opacity: 0.5;
}

.conversation .user-input {
  padding: var(--section-gap);
  border-top: 1px solid var(--border);
  background-color: var(--blur-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 5;
  position: relative;
}

.conversation .user-input input,
.conversation .user-input textarea {
  width: 100%;
  padding: 16px;
  background-color: var(--input);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  color: var(--foreground);
  font-size: 15px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.conversation .user-input input:focus,
.conversation .user-input textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--ring);
}

.conversation .user-input input::placeholder,
.conversation .user-input textarea::placeholder {
  color: var(--muted-foreground);
}

.conversation .user-input textarea {
  resize: vertical;
  min-height: 80px;
  max-height: 150px;
}

/* Input actions */
.input-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
}

.input-actions button {
  background: none;
  border: none;
  color: var(--muted-foreground);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.input-actions button:hover {
  color: var(--foreground);
  background-color: var(--secondary);
}

.input-actions .send-button {
  background-color: var(--primary);
  color: var(--primary-foreground);
  padding: 8px 16px;
  border-radius: var(--border-radius);
  font-weight: 500;
}

.input-actions .send-button:hover {
  background-color: var(--accent);
  color: var(--accent-foreground);
}

.input-actions .send-button:active {
  transform: translateY(1px);
}

/* Messages */
.message {
  width: 100%;
  display: flex;
  gap: var(--section-gap);
  padding: var(--section-gap) 0;
  animation: fadeIn 0.3s ease;
  position: relative;
}

.message:not(:last-child) {
  border-bottom: 1px solid var(--border);
}

.message:last-child {
  margin-bottom: var(--section-gap);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.message .user {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.dark .message .user {
  box-shadow: var(--shadow-md);
}

.message .user img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.message .content {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.message .content p,
.message .content li {
  font-size: 15px;
  line-height: 1.6;
  color: var(--foreground);
}

.message .content code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 14px;
  padding: 0.2em 0.4em;
  background-color: var(--secondary);
  border-radius: 4px;
}

.message .message-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.message .message-header .name {
  font-weight: 600;
  font-size: 14px;
}

.message .message-header .time {
  font-size: 12px;
  color: var(--muted-foreground);
}

.message .message-actions {
  position: absolute;
  top: var(--section-gap);
  right: 0;
  display: flex;
  gap: 8px;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.message:hover .message-actions {
  opacity: 1;
}

.message .message-actions button {
  background: none;
  border: none;
  color: var(--muted-foreground);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.message .message-actions button:hover {
  color: var(--foreground);
  background-color: var(--secondary);
}

/* Buttons and controls */
.new_convo,
.bottom_buttons button {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
  background-color: var(--secondary);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  color: var(--foreground);
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition-standard);
}

.new_convo:hover,
.bottom_buttons button:hover {
  background-color: var(--muted);
  border-color: var(--primary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.new_convo:active,
.bottom_buttons button:active {
  transform: translateY(0);
}

.new_convo span,
.bottom_buttons button span {
  color: var(--foreground);
  font-size: 14px;
}

.bottom_buttons {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: auto;
}

/* Theme toggle */
.theme-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.theme-toggle label {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
  cursor: pointer;
  text-indent: 0;
  background-color: var(--secondary);
  border-radius: 34px;
  transition: background-color 0.15s ease;
  border: 1px solid var(--border);
}

.theme-toggle label:after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background-color: var(--primary);
  border-radius: 50%;
  transition: transform 0.15s ease, background-color 0.15s ease;
}

.theme-toggle input:checked + label {
  background-color: var(--muted);
}

.theme-toggle input:checked + label:after {
  transform: translateX(24px);
}

.theme-toggle .label-text {
  font-size: 14px;
  font-weight: 500;
  color: var(--foreground);
}

/* Gradient background effect */
.gradient {
  position: fixed;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(circle at center, var(--primary), transparent 70%);
  width: 70vw;
  height: 70vw;
  opacity: 0.15;
  filter: blur(100px);
  animation: pulse 10s infinite alternate;
  pointer-events: none;
}

.gradient:nth-child(1) {
  top: -20%;
  right: -10%;
}

.gradient:nth-child(2) {
  bottom: -30%;
  left: -10%;
  width: 50vw;
  height: 50vw;
  background: radial-gradient(circle at center, var(--accent), transparent 70%);
  animation-delay: 2s;
}

@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 0.1;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.2;
  }
  100% {
    transform: scale(1);
    opacity: 0.1;
  }
}

/* Stop generating button - FIXED: Only show after message is sent */
.stop_generating {
  position: absolute;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: none; /* Hidden by default */
}

/* Only show when message is being generated */
.is-generating .stop_generating {
  display: block;
  animation: fadeIn 0.3s ease;
}

.stop_generating button {
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background-color: var(--blur-bg);
  border-radius: var(--border-radius);
  border: 1px solid var(--blur-border);
  padding: 12px 20px;
  color: var(--foreground);
  font-weight: 500;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: all 0.2s ease;
}

.dark .stop_generating button {
  box-shadow: var(--shadow-lg);
}

.stop_generating button:hover {
  background-color: var(--secondary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.stop_generating button:active {
  transform: translateY(0);
}

.stop_generating-hiding button {
  animation: fadeOut 0.3s ease forwards;
}

@keyframes fadeOut {
  to {
    opacity: 0;
    transform: translateY(10px);
  }
}

/* Typing indicator */
.typing {
  position: absolute;
  top: -25px;
  left: 0;
  font-size: 14px;
  color: var(--muted-foreground);
  animation: fadeIn 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.typing-indicator {
  display: flex;
  align-items: center;
}

.typing-indicator span {
  width: 4px;
  height: 4px;
  margin: 0 1px;
  background-color: var(--muted-foreground);
  border-radius: 50%;
  display: inline-block;
  animation: typing 1.4s infinite ease-in-out both;
}

.typing-indicator span:nth-child(1) {
  animation-delay: 0s;
}

.typing-indicator span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing {
  0%,
  80%,
  100% {
    transform: scale(0.6);
    opacity: 0.6;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

.typing-hiding {
  animation: fadeOut 0.3s ease forwards;
}

/* Code blocks */
pre {
  position: relative;
  background-color: var(--muted);
  border-radius: 8px;
  padding: 16px;
  margin: 16px 0;
  overflow: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 14px;
  line-height: 1.5;
  border: 1px solid var(--border);
}

pre::-webkit-scrollbar {
  height: 6px;
  width: 6px;
}

pre::-webkit-scrollbar-track {
  background: transparent;
}

pre::-webkit-scrollbar-thumb {
  background-color: var(--muted-foreground);
  border-radius: 10px;
  opacity: 0.5;
}

.dark pre {
  background-color: #1a1a1a;
}

.hljs-copy-wrapper {
  position: relative;
}

.hljs-copy-button {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 6px 10px;
  background-color: var(--secondary);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--foreground);
  font-size: 12px;
  cursor: pointer;
  opacity: 0;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.hljs-copy-wrapper:hover .hljs-copy-button {
  opacity: 1;
}

.hljs-copy-button:hover {
  background-color: var(--muted);
  transform: translateY(-1px);
}

.hljs-copy-button:active {
  transform: translateY(0);
}

.hljs-copy-button[data-copied="true"] {
  background-color: var(--primary);
  color: var(--primary-foreground);
}

/* Code syntax highlighting */
.hljs-keyword,
.hljs-selector-tag,
.hljs-title.function_ {
  color: #c678dd;
}

.hljs-variable,
.hljs-template-variable {
  color: #d19a66;
}

.hljs-string,
.hljs-attr {
  color: #98c379;
}

.hljs-number,
.hljs-literal {
  color: #d19a66;
}

.hljs-comment {
  color: #7f848e;
  font-style: italic;
}

.hljs-doctag,
.hljs-meta,
.hljs-meta .hljs-keyword {
  color: #61afef;
}

.dark .hljs-keyword,
.dark .hljs-selector-tag,
.dark .hljs-title.function_ {
  color: #c678dd;
}

.dark .hljs-variable,
.dark .hljs-template-variable {
  color: #e06c75;
}

.dark .hljs-string,
.dark .hljs-attr {
  color: #98c379;
}

.dark .hljs-number,
.dark .hljs-literal {
  color: #d19a66;
}

.dark .hljs-comment {
  color: #7f848e;
}

/* Mobile sidebar - FIXED: Only show on mobile */
.mobile-sidebar {
  display: none; /* Hidden by default on all screens */
  position: fixed;
  z-index: 100000;
  top: 0;
  left: 0;
  margin: 12px;
  font-size: 20px;
  cursor: pointer;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background-color: var(--blur-bg);
  border-radius: 12px;
  border: 1px solid var(--blur-border);
  width: 44px;
  height: 44px;
  justify-content: center;
  align-items: center;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-md);
}

.dark .mobile-sidebar {
  box-shadow: var(--shadow-lg);
}

.mobile-sidebar i {
  transition: transform 0.3s ease;
  color: var(--foreground);
}

.mobile-sidebar.active i {
  transform: rotate(180deg);
}

.mobile-sidebar:hover {
  background-color: var(--secondary);
}

.mobile-sidebar:active {
  transform: scale(0.95);
}

.rotated {
  transform: rotate(360deg);
}

/* Responsive styles */
@media screen and (max-width: 990px) {
  .conversations {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    z-index: 99999;
    background-color: var(--background);
    padding-top: 60px; /* Space for the close button */
  }

  /* FIXED: Only show mobile sidebar on mobile */
  .mobile-sidebar {
    display: flex !important;
  }

  .conversation .user-input {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    padding: 16px;
    z-index: 10;
  }

  .conversation #messages {
    padding-bottom: 100px;
  }

  body {
    padding: 12px;
  }

  .row {
    height: calc(100vh - 24px);
  }

  .message {
    padding: 16px 0;
    gap: 16px;
  }

  .message .user {
    width: 36px;
    height: 36px;
  }
}

@media screen and (max-width: 640px) {
  body {
    padding: 8px;
  }

  .row {
    height: calc(100vh - 16px);
  }

  .conversation #messages {
    padding: 0 16px;
    padding-bottom: 120px;
  }

  .message {
    padding: 12px 0;
    gap: 12px;
  }

  .message .user {
    width: 32px;
    height: 32px;
  }

  .conversation .user-input {
    padding: 12px;
  }

  .conversation .user-input input,
  .conversation .user-input textarea {
    padding: 12px;
    font-size: 14px;
  }

  .stop_generating {
    bottom: 80px;
  }

  .stop_generating button {
    padding: 10px 16px;
    font-size: 14px;
  }
}

.shown {
  display: flex;
}

/* Links */
a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.15s ease, text-decoration 0.15s ease;
}

a:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* Lists */
ol,
ul {
  padding-left: 24px;
  margin: 12px 0;
}

li {
  margin-bottom: 8px;
}

/* Cursor animation */
#cursor {
  display: inline-block;
  width: 2px;
  height: 16px;
  background-color: var(--foreground);
  margin-left: 2px;
  animation: blink 1s infinite;
}

@keyframes blink {
  0%,
  100% {
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
}

/* Loading spinner */
.spinner:before {
  content: "";
  box-sizing: border-box;
  position: absolute;
  top: 50%;
  left: 50%;
  width: 24px;
  height: 24px;
  margin-top: -12px;
  margin-left: -12px;
  border-radius: 50%;
  border: 2px solid var(--muted-foreground);
  border-top-color: var(--primary);
  animation: spinner 0.8s linear infinite;
}

@keyframes spinner {
  to {
    transform: rotate(360deg);
  }
}

/* Utility classes */
.disable-scrollbars::-webkit-scrollbar {
  background: transparent;
  width: 0px;
}

.disable-scrollbars {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

/* Enhanced visually-hidden utility */
.visually-hidden {
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

/* Color picker styles */
.color-picker {
  margin: 16px 0;
}

.color-picker > fieldset {
  border: 0;
  display: flex;
  width: fit-content;
  background: var(--blur-bg);
  margin-inline: auto;
  border-radius: 12px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--blur-border);
  color: var(--foreground);
  position: relative;
  overflow: hidden;
  outline: none;
  padding: 8px 18px;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
}

.color-picker input[type="radio"] {
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  margin: 0 6px;
  cursor: pointer;
  position: relative;
  border: 2px solid transparent;
  transition: all 0.2s ease;
}

.color-picker input[type="radio"]:checked {
  background-color: var(--radio-color);
  transform: scale(1.1);
  border-color: var(--foreground);
  box-shadow: 0 0 0 2px var(--background);
}

.color-picker input[type="radio"]#light {
  --radio-color: #f8f9fa;
  background-color: #f8f9fa;
  border: 2px solid #ddd;
}

.color-picker input[type="radio"]#dark {
  --radio-color: #121212;
  background-color: #121212;
}

.color-picker input[type="radio"]#pink {
  --radio-color: #ff69b4;
  background-color: #ff69b4;
}

.color-picker input[type="radio"]#blue {
  --radio-color: #4169e1;
  background-color: #4169e1;
}

.color-picker input[type="radio"]#green {
  --radio-color: #3cb371;
  background-color: #3cb371;
}

/* Theme color variations */
.pink {
  --primary: #ff69b4;
  --accent: #ff1493;
  --gradient: rgba(255, 105, 180, 0.15);
  --ring: rgba(255, 105, 180, 0.3);
  transition: all 0.3s ease;
}

.blue {
  --primary: #4169e1;
  --accent: #1e90ff;
  --gradient: rgba(65, 105, 225, 0.15);
  --ring: rgba(65, 105, 225, 0.3);
  transition: all 0.3s ease;
}

.green {
  --primary: #3cb371;
  --accent: #2e8b57;
  --gradient: rgba(60, 179, 113, 0.15);
  --ring: rgba(60, 179, 113, 0.3);
  transition: all 0.3s ease;
}

/* Info box styles */
.info {
  padding: 12px 16px;
  display: flex;
  gap: 12px;
  align-items: center;
  user-select: none;
  background-color: var(--secondary);
  border-radius: var(--border-radius);
  width: 100%;
  cursor: default;
  border: 1px solid var(--border);
  margin: 12px 0;
  font-size: 14px;
  color: var(--foreground);
}

.info.warning {
  background-color: rgba(255, 193, 7, 0.1);
  border-color: rgba(255, 193, 7, 0.3);
}

.info.error {
  background-color: rgba(220, 53, 69, 0.1);
  border-color: rgba(220, 53, 69, 0.3);
}

.info.success {
  background-color: rgba(40, 167, 69, 0.1);
  border-color: rgba(40, 167, 69, 0.3);
}

/* Enhanced select styles */
select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23131313%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
  background-repeat: no-repeat;
  background-position: right 12px top 50%;
  background-size: 10px auto;
  padding: 10px 30px 10px 16px;
  border-radius: var(--border-radius);
  border: 1px solid var(--border);
  background-color: var(--input);
  color: var(--foreground);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.dark select {
  background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23f8f9fa%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
}

select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--ring);
  outline: none;
}

select:hover {
  background-color: var(--secondary);
}

/* Enhanced buttons */
button {
  border: none;
  background: none;
  font-family: var(--font-sans);
  cursor: pointer;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--border-radius);
  font-weight: 500;
  font-size: 14px;
  padding: 10px 16px;
  transition: all 0.15s ease;
}

.btn-primary {
  background-color: var(--primary);
  color: var(--primary-foreground);
}

.btn-primary:hover {
  background-color: var(--accent);
}

.btn-secondary {
  background-color: var(--secondary);
  color: var(--secondary-foreground);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background-color: var(--muted);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.btn-lg {
  padding: 12px 20px;
  font-size: 16px;
}

.btn-icon {
  padding: 8px;
}

/* Tooltip styles */
.tooltip {
  position: relative;
}

.tooltip:before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 8px;
  padding: 6px 10px;
  border-radius: 6px;
  background-color: var(--foreground);
  color: var(--background);
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.15s ease;
  pointer-events: none;
  z-index: 1000;
}

.tooltip:after {
  content: "";
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--foreground);
  opacity: 0;
  visibility: hidden;
  transition: all 0.15s ease;
  pointer-events: none;
}

.tooltip:hover:before,
.tooltip:hover:after {
  opacity: 1;
  visibility: visible;
}

/* Badge styles */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
}

.badge-primary {
  background-color: var(--primary);
  color: var(--primary-foreground);
}

.badge-secondary {
  background-color: var(--secondary);
  color: var(--secondary-foreground);
}

.badge-outline {
  background-color: transparent;
  border: 1px solid var(--border);
  color: var(--foreground);
}

/* Avatar styles */
.avatar {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  overflow: hidden;
}

.avatar-sm {
  width: 32px;
  height: 32px;
}

.avatar-md {
  width: 40px;
  height: 40px;
}

.avatar-lg {
  width: 48px;
  height: 48px;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--secondary);
  color: var(--secondary-foreground);
  font-weight: 500;
  font-size: 14px;
}

/* Card styles */
.card {
  border-radius: var(--border-radius);
  background-color: var(--card);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: all 0.15s ease;
}

.card-header {
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

.card-body {
  padding: 16px;
}

.card-footer {
  padding: 16px;
  border-top: 1px solid var(--border);
}

.card-hover:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Animation utilities */
.animate-fade-in {
  animation: fadeIn 0.3s ease;
}

.animate-fade-out {
  animation: fadeOut 0.3s ease forwards;
}

.animate-slide-in {
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* Improved focus styles for accessibility */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Print styles */
@media print {
  body {
    background-color: white;
    color: black;
  }

  .box,
  .conversations,
  .conversation {
    box-shadow: none;
    border: 1px solid #ddd;
  }

  .gradient,
  .mobile-sidebar,
  .stop_generating,
  .user-input {
    display: none !important;
  }
}