/* ===== Global Styles ===== */
* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent !important;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #0a0a0f 0%, #1a0a1f 100%);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;
  padding: 10px;
  margin: 0;
  color: #e0e0e0;
}

body.sidebar-open {
  overflow: hidden;
}

body {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

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

.app-container {
  display: flex;
  width: 100%;
  max-width: 1600px;
  height: 100vh;
  background: #0d0d12;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(0, 100, 255, 0.3);
  border: 1px solid rgba(0, 100, 255, 0.4);
  overflow: hidden;
}

/* ===== Sidebar ===== */
.sidebar {
  width: 250px;
  background: #0a0a0f;
  border-right: 1px solid rgba(0, 100, 255, 0.4);
  display: flex;
  flex-direction: column;
  padding: 15px;
  gap: 15px;
  min-height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.sidebar-header {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar h2 {
  color: #0066ff;
  margin: 0;
  font-size: 18px;
  text-align: center;
  text-shadow: 0 0 17px rgba(0, 100, 255, 1);
}

.new-chat-btn {
  width: 100%;
  padding: 10px;
  background: linear-gradient(135deg, #1a0a1f 40%, #0050cc 77%);
  border: 1px solid rgba(0, 100, 255, 0.5);
  border-radius: 8px;
  color: white;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(0, 50, 150, 0.4);
  font-family: inherit;
}

.new-chat-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(0, 100, 255, 0.6);
  border-color: rgba(0, 150, 255, 0.8);
}

.chat-history-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overscroll-behavior: contain;
}

.chat-history-list::-webkit-scrollbar {
  display: none;
}

.chat-item {
  padding: 12px;
  background: #0d0d12;
  border: 1px solid rgba(0, 100, 255, 0.3);
  border-radius: 8px;
  color: #e0e0e0;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
  text-align: left;
  margin: 3px;
  overflow: clip;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-item:hover {
  border-color: rgba(0, 150, 255, 0.8);
  transform: translateY(-2px);
  background: #12121a;
}

.chat-item.active {
  border-color: #0066ff;
  box-shadow: 0 0 10px rgba(0, 100, 255, 0.5);
  background: #15151f;
}

.no-chats-message {
  color: #5a5a7a;
  text-align: center;
  font-style: italic;
  padding: 20px;
}

/* ===== Toggle Sidebar Button ===== */
.toggle-sidebar-btn {
  padding: 1px;
  padding-bottom: 5px;
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 1000;
  background: transparent;
  border: 1px solid rgba(0, 100, 255, 0.5);
  border-radius: 8px;
  width: 30px;
  height: 30px;
  color: white;
  font-size: 17px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 10px rgba(0, 50, 150, 0.4);
  display: none;
}

.toggle-sidebar-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 15px rgba(0, 100, 255, 0.6);
  border-color: rgba(0, 150, 255, 0.8);
}

.toggle-sidebar-btn:active {
  transform: scale(1) translateY(2px);
  box-shadow: 0 2px 5px rgba(0, 100, 255, 0.5);
  transition: all 0.1s ease;
}

/* ===== Visually Hidden for Accessibility ===== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ===== Chat Container ===== */
.chat-container {
  display: flex;
  flex-direction: column;
  flex: 1;
  background: #0d0d12;
  padding: 20px;
  gap: 20px;
  min-height: 0;
  overflow: hidden;
}

/* ===== Header ===== */
.chat-header {
  text-align: center;
  padding-bottom: 10px;
  flex-shrink: 0;
}

.chat-header h1 {
  color: #4d9fff;
  margin: 0;
  font-size: 24px;
  text-shadow: 0 0 10px rgb(81 133 213);
}

.chat-header .subtitle {
  color: #8080a0;
  margin: 8px 0 0 0;
  font-size: 14px;
  text-align: center;
}

/* ===== Output Section ===== */
.output-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.chat-output {
  flex: 1;
  margin-top: 0;
  padding: 20px;
  background: #0a0a0f;
  border: 2px solid rgba(0, 100, 255, 0.4);
  border-radius: 12px;
  color: #e0e0e0;
  line-height: 1.6;
  font-size: 15px;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.5);
  scroll-behavior: smooth;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
}

.chat-output:empty::before {
  content: "The response will appear here...";
  color: #5a5a7a;
  font-style: italic;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  width: 100%;
}

/* ===== Input Section ===== */
.input-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-shrink: 0;
}

/* ===== Input Wrapper (Fixed Container) ===== */
.input-wrapper {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: #0a0a0f;
  border: 2px solid rgba(0, 100, 255, 0.4);
  border-radius: 12px;
  padding: 8px;
  transition: all 0.3s ease;
}

.input-wrapper:focus-within {
  border-color: #0066ff;
  box-shadow: 0 0 15px rgba(0, 100, 255, 0.4);
}

/* ===== Left Controls ===== */
.left-controls {
  display: flex;
  gap: 6px;
  align-items: center;
}

/* ===== Control Buttons ===== */
.control-btn {
  width: 36px;
  height: 36px;
  padding: 8px;
  background: black;
  border: 1px solid rgba(0, 100, 255, 0.5);
  border-radius: 8px;
  color: #4d9fff;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.control-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 100, 255, 0.5);
}

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

.control-btn svg {
  width: 18px;
  height: 18px;
}

/* ===== Custom Model Selector ===== */
.model-selector-wrapper {
  position: relative;
}

.model-btn {
  position: relative;
}

.model-dropdown {
  position: absolute;
  bottom: calc(100% + 22px);
  left: 0;
  margin-right: -94px;
  background: #0a0a0f;
  border: 2px solid rgba(0, 100, 255, 0.4);
  border-radius: 12px;
  min-width: 250px;
  max-height: 400px;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.8);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  z-index: 1000;
}

.model-dropdown.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.model-dropdown-header {
  padding: 12px 15px;
  background: linear-gradient(135deg, #1a0a1f 0%, #0050cc 100%);
  border-bottom: 1px solid rgba(0, 100, 255, 0.4);
  color: #4d9fff;
  font-weight: bold;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  position: sticky;
  top: 0;
  z-index: 1;
}

.model-options {
  padding: 8px;
}

.model-option {
  padding: 12px 15px;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s ease;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
  border: 1px solid transparent;
}

.model-option:hover {
  background: #12121a;
  border-color: rgba(0, 100, 255, 0.3);
  transform: translateX(5px);
}

.model-option.active {
  background: #15151f;
  border-left: 3px solid #0066ff;
  border-color: rgba(0, 100, 255, 0.5);
}

.model-name {
  color: #e0e0e0;
  font-size: 14px;
}

.model-badge {
  padding: 2px 8px;
  background: linear-gradient(135deg, #0050cc 0%, #cc0033 100%);
  border: 1px solid rgba(0, 100, 255, 0.5);
  border-radius: 12px;
  font-size: 10px;
  color: #ffffff;
  text-transform: uppercase;
  font-weight: bold;
  letter-spacing: 0.5px;
}

/* ===== Textarea ===== */
textarea {
  flex: 1;
  min-height: 36px;
  max-height: 200px;
  padding: 8px 12px;
  background: transparent;
  border: none;
  color: #e0e0e0;
  font-size: 15px;
  resize: none;
  font-family: inherit;
  overflow-y: auto;
  line-height: 1.5;
}

textarea::-webkit-scrollbar {
  width: 6px;
}

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

textarea::-webkit-scrollbar-thumb {
  background: rgba(0, 100, 255, 0.4);
  border-radius: 10px;
}

textarea::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 100, 255, 0.6);
}

textarea:focus {
  outline: none;
}

textarea::placeholder {
  color: #5a5a7a;
}

/* ===== Right Controls ===== */
.right-controls {
  display: flex;
  align-items: center;
}

.generate-btn {
  width: 40px;
  height: 40px;
  background:#000000;
  border: 1px solid rgba(0, 100, 255, 0.6);
  box-shadow: 0 4px 15px rgba(0, 50, 150, 0.4);
}

.generate-btn:hover {
  box-shadow: 0 6px 20px rgba(0, 100, 255, 0.6);
  border-color: #0080ff;
}

.generate-btn svg {
  width: 20px;
  height: 20px;
}

/* ===== Help Text ===== */
.help-text {
  text-align: center;
  color: #8080a0;
  font-size: 13px;
}

.help-text kbd {
  background: #0a0a0f;
  border: 1px solid rgba(0, 100, 255, 0.4);
  border-radius: 4px;
  padding: 2px 6px;
  font-family: monospace;
  font-size: 12px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* ===== Hide scrollbar ===== */
.chat-history-list {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.sidebar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

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

/* ===== Message Styling ===== */
.message {
  padding: 15px;
  border-radius: 10px;
  line-height: 1.6;
  word-wrap: break-word;
  overflow-wrap: break-word;
  animation: fadeIn 0.3s ease-out;
  max-width: 100%;
}

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

.message.user {
  background: linear-gradient(135deg, rgba(0, 50, 150, 0.2) 0%, rgba(0, 80, 200, 0.1) 100%);
  border-left: 4px solid #0066ff;
  border: 1px solid rgba(0, 100, 255, 0.3);
  align-self: flex-end;
  margin-left: 20%;
}

.message.assistant {
  background: linear-gradient(135deg, rgba(26, 10, 31, 0.5) 0%, rgba(0, 50, 150, 0.2) 100%);
  border-left: 4px solid #0066ff;
  border: 1px solid rgba(0, 100, 255, 0.3);
  align-self: flex-start;
  margin-right: 20%;
}

.message .content {
  margin-top: 10px;
}

.message.streaming .content em {
  color: #4d9fff;
  animation: pulse 1.5s ease-in-out infinite;
}

.message.error {
  background: linear-gradient(135deg, rgba(150, 0, 0, 0.3) 0%, rgba(200, 0, 50, 0.2) 100%) !important;
  border-left-color: #cc0033 !important;
  border-color: rgba(200, 0, 50, 0.5) !important;
}

/* ===== Animations ===== */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ===== Code Block Wrapper ===== */
.code-block-wrapper {
  margin: 15px 0;
  border-radius: 8px;
  overflow: hidden;
  background: #050508;
  border: 1px solid rgba(0, 100, 255, 0.3);
}

.code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 15px;
  background: linear-gradient(135deg, #0a0a0f 0%, #1a0a1f 100%);
  border-bottom: 1px solid rgba(0, 100, 255, 0.3);
}

.code-language {
  color: #4d9fff;
  font-size: 12px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ===== Copy Button ===== */
.copy-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  background: linear-gradient(135deg, #1a0a1f 0%, #0050cc 100%);
  border: 1px solid rgba(0, 100, 255, 0.5);
  border-radius: 5px;
  color: #4d9fff;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  width: auto;
  margin: 0;
  box-shadow: none;
}

.copy-btn:hover {
  background: linear-gradient(135deg, #1a0a1f 0%, #0066ff 100%);
  border-color: #0066ff;
  transform: none;
  box-shadow: none;
}

.copy-btn.copied {
  background: linear-gradient(135deg, #0a1f0a 0%, #00cc33 100%);
  border-color: #00ff44;
  color: #00ff44;
}

.copy-btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.copy-btn span {
  font-size: 12px;
}

/* ===== Code Block ===== */
.code-block {
  margin: 0 !important;
  padding: 15px !important;
  background: #050508 !important;
  border-radius: 0 !important;
  overflow-x: auto;
  max-height: 400px;
  overflow-y: auto;
}

.code-block code {
  font-family: 'Fira Code', 'Consolas', 'Monaco', 'Courier New', monospace !important;
  font-size: 14px !important;
  line-height: 1.5 !important;
  background: transparent !important;
  padding: 0 !important;
  white-space: pre !important;
  word-break: normal !important;
  word-wrap: normal !important;
}

/* ===== Inline Code ===== */
.inline-code {
  background: #0a0a0f !important;
  color: #4d9fff !important;
  padding: 2px 6px !important;
  border-radius: 4px !important;
  font-family: 'Fira Code', 'Consolas', monospace !important;
  font-size: 0.9em !important;
  border: 1px solid rgba(0, 100, 255, 0.3);
  white-space: nowrap;
}

/* ===== Inline Code in Tables ===== */
#output table .inline-code {
  background: rgba(0, 0, 0, 0.5) !important;
  color: #4d9fff !important;
  padding: 1px 4px !important;
  border-radius: 3px !important;
  font-size: 0.85em !important;
  border: 1px solid rgba(0, 100, 255, 0.4) !important;
}

/* ===== Markdown Elements ===== */
#output h1,
#output h2,
#output h3,
#output h4,
#output h5,
#output h6 {
  color: #4d9fff;
  margin: 20px 0 10px 0;
  font-weight: bold;
  line-height: 1.3;
}

#output h1 {
  font-size: 1.8em;
  border-bottom: 2px solid rgba(0, 100, 255, 0.4);
  padding-bottom: 10px;
}

#output h2 {
  font-size: 1.5em;
  border-bottom: 1px solid rgba(0, 100, 255, 0.3);
  padding-bottom: 8px;
}

#output h3 { font-size: 1.3em; }
#output h4 { font-size: 1.1em; }
#output h5 { font-size: 1em; }
#output h6 { font-size: 0.9em; color: #3380cc; }

#output strong {
  color: #ffffff;
  font-weight: 600;
}

#output em {
  color: #b0b0b0;
  font-style: italic;
}

#output del {
  color: #888;
  text-decoration: line-through;
}

/* ===== Blockquote ===== */
#output blockquote {
  border-left: 4px solid #0066ff;
  margin: 15px 0;
  padding: 10px 15px;
  background: rgba(0, 50, 150, 0.1);
  border-radius: 0 8px 8px 0;
  color: #aaa;
  font-style: italic;
}

/* ===== Lists ===== */
#output ul,
#output ol {
  margin: 10px 0;
  padding-left: 25px;
}

#output li {
  margin: 8px 0;
  line-height: 1.6;
}

#output ul li {
  list-style-type: disc;
}

#output ol li {
  list-style-type: decimal;
}

#output li ul,
#output li ol {
  margin: 5px 0;
}

/* ===== Horizontal Rule ===== */
#output hr {
  border: none;
  border-top: 2px solid rgba(0, 100, 255, 0.4);
  margin: 25px 0;
}

/* ===== Links ===== */
#output a {
  color: #3399ff;
  text-decoration: none;
  border-bottom: 1px dotted #3399ff;
  transition: all 0.2s ease;
}

#output a:hover {
  color: #4d9fff;
  border-bottom-style: solid;
}

/* ===== Images ===== */
#output img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 15px 0;
  border: 1px solid rgba(0, 100, 255, 0.3);
  display: block;
}

/* ===== Tables ===== */
#output table {
  width: 100%;
  border-collapse: collapse;
  margin: 15px 0;
  background: #0a0a0f;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(0, 100, 255, 0.3);
}

#output th,
#output td {
  padding: 10px 15px;
  border: 1px solid rgba(0, 100, 255, 0.3);
  text-align: left;
}

#output th {
  background: linear-gradient(135deg, #1a0a1f 0%, #0050cc 100%);
  color: #4d9fff;
  font-weight: bold;
}

#output tr:hover {
  background: rgba(0, 50, 150, 0.1);
}

#output tbody tr:nth-child(even) {
  background: rgba(0, 30, 100, 0.05);
}

/* ===== Scrollbar Styling ===== */
#output::-webkit-scrollbar,
.code-block::-webkit-scrollbar,
.model-dropdown::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

#output::-webkit-scrollbar-track,
.code-block::-webkit-scrollbar-track,
.model-dropdown::-webkit-scrollbar-track {
  background: #0a0a0f;
  border-radius: 10px;
}

#output::-webkit-scrollbar-thumb,
.code-block::-webkit-scrollbar-thumb,
.model-dropdown::-webkit-scrollbar-thumb {
  background: rgba(0, 100, 255, 0.5);
  border-radius: 10px;
}

#output::-webkit-scrollbar-thumb:hover,
.code-block::-webkit-scrollbar-thumb:hover,
.model-dropdown::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 100, 255, 0.7);
}

/* ===== Scrollbar Corner ===== */
#output::-webkit-scrollbar-corner,
.code-block::-webkit-scrollbar-corner {
  background: #0a0a0f;
}

/* ===== Prism.js Theme Overrides ===== */
pre[class*="language-"] {
  background: #050508 !important;
  margin: 0 !important;
}

code[class*="language-"] {
  text-shadow: none !important;
}

.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
  color: #6a9955 !important;
  font-style: italic;
}

.token.punctuation {
  color: #d4d4d4 !important;
}

.token.namespace {
  opacity: 0.7;
}

.token.property,
.token.tag,
.token.boolean,
.token.number,
.token.constant,
.token.symbol,
.token.deleted {
  color: #b5cea8 !important;
}

.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
  color: #ce9178 !important;
}

.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string {
  color: #d4d4d4 !important;
}

.token.atrule,
.token.attr-value,
.token.keyword {
  color: #569cd6 !important;
}

.token.function,
.token.class-name {
  color: #dcdcaa !important;
}

.token.regex,
.token.important,
.token.variable {
  color: #d16969 !important;
}

.token.important,
.token.bold {
  font-weight: bold;
}

.token.italic {
  font-style: italic;
}

.token.entity {
  cursor: help;
}

/* ===== Error Message ===== */
.error-message {
  color: #ff6666;
  background: rgba(150, 0, 0, 0.2);
  padding: 15px;
  border-radius: 8px;
  border-left: 4px solid #cc0033;
  border: 1px solid rgba(200, 0, 50, 0.4);
}

/* ===== Loading State ===== */
.loading {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #4d9fff;
}

.loading::after {
  content: '';
  width: 20px;
  height: 20px;
  border: 2px solid rgba(0, 100, 255, 0.3);
  border-top-color: #0066ff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* ===== Table Styles ===== */
.table-wrapper {
  overflow-x: auto;
  margin: 1rem 0;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  background: #0a0a0f;
  border: 1px solid rgba(0, 100, 255, 0.3);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  background: #0a0a0f;
  color: #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
}

thead {
  background: linear-gradient(135deg, rgba(26, 10, 31, 0.8) 0%, rgba(0, 80, 200, 0.5) 100%);
  color: #4d9fff;
  border-bottom: 2px solid rgba(0, 100, 255, 0.4);
}

th {
  padding: 12px 16px;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.5px;
  border-bottom: 2px solid rgba(0, 100, 255, 0.4);
  color: #4d9fff;
}

td {
  padding: 10px 16px;
  border-bottom: 1px solid rgba(0, 100, 255, 0.2);
}

tbody tr:hover {
  background-color: rgba(0, 50, 150, 0.15);
}

tbody tr:nth-child(even) {
  background-color: rgba(0, 30, 100, 0.08);
}

tbody tr:nth-child(odd) {
  background-color: rgba(0, 0, 0, 0.2);
}

tbody tr:nth-child(even):hover,
tbody tr:nth-child(odd):hover {
  background-color: rgba(0, 50, 150, 0.2);
}

/* ===== Online Status Indicator ===== */
.header-content {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  gap: 20px;
  flex-wrap: wrap;
}

.online-status {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: bold;
  text-align: center;
  min-width: 70px;
}

.online-status.online {
  color: #00cc66;
  background-color: rgba(0, 200, 100, 0.1);
  border: 1px solid rgba(0, 200, 100, 0.3);
}

.online-status.offline {
  color: #ff6666;
  background-color: rgba(255, 100, 100, 0.1);
  border: 1px solid rgba(255, 100, 100, 0.3);
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
  body {
    padding: 0;
  }

  .app-container {
    flex-direction: column;
    height: 100vh;
    border-radius: 0;
  }

  .sidebar {
    width: 100%;
    height: auto;
    max-height: 50vh;
    border-right: none;
    border-bottom: 1px solid rgba(0, 100, 255, 0.4);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 900;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
    overscroll-behavior: contain; 
  }

  .sidebar.active {
    transform: translateY(0);
  }

  .toggle-sidebar-btn {
    display: block;
  }

  .chat-container {
    padding: 15px;
    gap: 15px;
    margin-top: 50px;
    height: calc(100vh - 50px);
  }

  .chat-header h1 {
    font-size: 22px;
  }

  .left-controls {
    flex-wrap: wrap;
  }

  .control-btn {
    width: 32px;
    height: 32px;
  }

  .control-btn svg {
    width: 16px;
    height: 16px;
  }

  .generate-btn {
    width: 36px;
    height: 36px;
  }

  .model-dropdown {
    left: auto;
    right: 0;
  }

  .message.user {
    margin-left: 0;
  }

  .message.assistant {
    margin-right: 0;
  }

  .code-header {
    flex-direction: row;
    justify-content: space-between;
  }

  .header-content {
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }

  .online-status {
    align-self: center;
  }
}

@media (max-width: 480px) {
  .chat-container {
    padding: 10px;
  }

  .chat-header h1 {
    font-size: 20px;
  }

  .input-wrapper {
    padding: 6px;
  }

  .left-controls {
    gap: 4px;
  }

  .control-btn {
    width: 30px;
    height: 30px;
  }

  .generate-btn {
    width: 34px;
    height: 34px;
  }

  .chat-output {
    padding: 15px;
  }

  .message {
    padding: 12px;
  }

  .code-block {
    padding: 10px !important;
  }

  .code-block code {
    font-size: 12px !important;
  }
}
