#chat-container {
  width: 90%;
  max-width: 1200px;
  height: calc(90vh - 60px); /* Account for header height */
  display: flex;
  flex-direction: row;
  gap: 16px;
  margin: 20px auto 0px auto;
  flex-grow: 1;
  position: relative;
}

#chat-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  border: none;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 123, 255, 0.08), 0 4px 12px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
  position: relative;
}

#chat-content.sidebar-expanded {
  /* Content adjusts automatically due to flexbox */
}

/* Mobile responsive chat container */
@media (max-width: 768px) {
  #chat-container {
    width: 95%;
    margin: 10px auto;
    height: calc(95vh - 60px);
    gap: 12px;
  }
  
  #chat-content {
    border-radius: 12px;
  }
}

@media (max-width: 480px) {
  #chat-container {
    width: 100%;
    margin: 0;
    height: calc(98vh - 60px);
    box-sizing: border-box;
    gap: 8px;
  }
  
  #chat-content {
    border-radius: 8px;
  }
}

.debug-info {
  font-size: 12px;
  font-style: italic;
  color: #000;
  opacity: 0.7;
  margin-bottom: 10px;
  padding: 5px;
  background-color: #f8f9fa;
  border-radius: 4px;
  border: 1px solid #e9ecef;
  z-index: 999;
  pointer-events: none;
}

.ai-disclaimer {
  font-size: 13px;
  color: #6c757d;
  text-align: center;
  padding: 10px 20px;
  max-width: 100%;
  margin: 0 auto;
}

.ai-disclaimer a {
  color: #007bff;
  text-decoration: none;
}

.ai-disclaimer a:hover {
  text-decoration: underline;
}

#messages {
  flex-grow: 1;
  overflow-y: auto;
  border-radius: 12px;
  border: none;
  position: absolute;
  top: 24px;
  left: 24px;
  right: 24px;
  bottom: 90px; /* Leave space for the input container */
  overflow-x: hidden;
}

#messages .message:first-child {
  margin-top: 0px;
}

/* Mobile responsive messages */
@media (max-width: 768px) {
  #messages {
    padding: 16px;
    top: 16px;
    left: 16px;
    right: 16px;
    bottom: 80px;
  }
}

@media (max-width: 480px) {
  #messages {
    padding: 12px;
    top: 12px;
    left: 12px;
    right: 12px;
    bottom: 75px;
  }
}

.message {
  margin: 10px 0;
  padding: 10px 15px;
  border-radius: 15px;
  max-width: 80%;
  word-wrap: break-word;
  white-space: pre-wrap;
  position: relative;
}

/* Mobile responsive messages */
@media (max-width: 768px) {
  .message {
    max-width: 90%;
    padding: 12px 16px;
    margin: 8px 0;
  }
}

@media (max-width: 480px) {
  .message {
    max-width: 95%;
    padding: 10px 12px;
    margin: 6px 0;
    font-size: 0.875rem;
  }
}

.message-content {
  width: 100%;
}

.message-actions {
  display: flex;
  align-items: flex-start;
  margin-top: 8px;
  margin-left: 8px;
}

.user-message {
  background: linear-gradient(135deg, #2e0066 0%, #0056b3 100%);
  color: white;
  margin-left: auto;
  justify-content: flex-end;
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.2);
}

.user-message .message-actions {
  display: none;
}

.bot-message {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  color: #212529;
  margin-right: auto;
  justify-content: flex-start;
  border: 1px solid rgba(0, 123, 255, 0.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

code {
  font-family: Menlo, Monaco, Consolas, 'Courier New', monospace;
  color: #ff7777;
}

.bot-message pre {
  background: #2d2d2d;
  color: #f8f8f2;
  padding: 16px;
  border-radius: 8px;
  overflow-x: auto;
  font-family: "Fira Code", monospace;
  font-size: 14px;
}

.bot-message pre code {
  display: block;
  white-space: pre;
}

.bot-message ol,
.bot-message ul {
  white-space: normal;
  padding-left: 1.5em;
  list-style-position: outside;
}

.bot-message li p {
  margin: 0;
  display: inline;
}

.bot-message sup.citation {
  font-size: 0.75em;
  vertical-align: super;
  line-height: 1;
}

.bot-message sup.citation a {
  color: #007bff;
  text-decoration: none;
}

.bot-message sup.citation a:hover {
  text-decoration: underline;
}

.bot-message sup.citation a[title] {
  cursor: pointer;
}

#message-input-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 3.375rem;
  gap: 10px;
  position: absolute;
  bottom: 20px;
  left: 20px;
  right: 20px;
  transition: all 0.2s ease-in-out;
}


#send-button {
  height: calc(3.375rem + 4px);
  width: calc(3.375rem + 4px);
}

/* Mobile responsive input container */
@media (max-width: 768px) {
  #message-input-container {
    gap: 8px;
    bottom: 16px;
    left: 16px;
    right: 16px;
    height: 3rem;
  }
  #send-button {
    height: calc(3rem + 4px);
    width: calc(3rem + 4px);
  }
}

@media (max-width: 480px) {
  #message-input-container {
    gap: 6px;
    bottom: 12px;
    left: 12px;
    right: 12px;
    height: 2.5rem;
    flex-direction: row;
    align-items: flex-end;
  }
}

#message-input {
  flex-grow: 1;
  padding: 1rem 1.25rem;
  border: 2px solid #e9ecef;
  border-radius: 0.75rem;
  font-size: 1rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  resize: none;
  height: 100%;
  width: auto;
  max-height: 7.5rem;
  line-height: 1.5;
  transition: all 0.3s ease;
  overflow-y: hidden;
  box-sizing: border-box;
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
}

/* Mobile responsive input */
@media (max-width: 768px) {
  #message-input {
    padding: 0.875rem 1rem;
    font-size: 1rem; /* Prevent zoom on iOS */
  }
}

@media (max-width: 480px) {
  #message-input {
    padding: 0.75rem 0.875rem;
    border-radius: 0.5rem;
    font-size: 1rem;
  }
}

#message-input.expanded {
  min-height: 80px;
}

#message-input:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 4px rgba(0, 123, 255, 0.15), 0 4px 12px rgba(0, 123, 255, 0.1);
  background: #ffffff;
}

#message-input:disabled {
  background-color: #f5f5f5;
  color: #999;
  border-color: #ccc;
  cursor: not-allowed;
  opacity: 0.6;
}

#message-input::placeholder {
  color: #999;
}

#message-input:disabled::placeholder {
  color: #bbb;
}

#send-button {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #2e0066 0%, #0056b3 100%);
  color: white;
  border: none;
  border-radius: 0.75rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.2);
}

#send-button:hover:not(:disabled) {
  background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 123, 255, 0.3);
}

#send-button:disabled {
  background-color: #ccc;
  color: #999;
  cursor: not-allowed;
  opacity: 0.6;
}

.bot-message a {
  color: #007bff;
  text-decoration: none;
}

.bot-message a:hover {
  text-decoration: underline;
}

.bot-message-thinking {
  font-style: italic;
}

.message-debug-info {
  font-size: 12px;
  font-style: italic;
  margin-top: 6px;
  opacity: 0.7;
}

.message-debug-info.user-debug {
  color: #fff;
}

.message-debug-info.bot-debug {
  color: #000;
}

pre code.hljs {
  display: block;
  overflow-x: auto;
  padding: 1em
}
code.hljs {
  padding: 3px 5px
}
/*

Atom One Dark by Daniel Gamage
Original One Dark Syntax theme from https://github.com/atom/one-dark-syntax

base:    #282c34
mono-1:  #abb2bf
mono-2:  #818896
mono-3:  #5c6370
hue-1:   #56b6c2
hue-2:   #61aeee
hue-3:   #c678dd
hue-4:   #98c379
hue-5:   #e06c75
hue-5-2: #be5046
hue-6:   #d19a66
hue-6-2: #e6c07b

*/
.hljs {
  color: #abb2bf;
  background: #282c34
}
.hljs-comment,
.hljs-quote {
  color: #5c6370;
  font-style: italic
}
.hljs-doctag,
.hljs-keyword,
.hljs-formula {
  color: #c678dd
}
.hljs-section,
.hljs-name,
.hljs-selector-tag,
.hljs-deletion,
.hljs-subst {
  color: #e06c75
}
.hljs-literal {
  color: #56b6c2
}
.hljs-string,
.hljs-regexp,
.hljs-addition,
.hljs-attribute,
.hljs-meta .hljs-string {
  color: #98c379
}
.hljs-attr,
.hljs-variable,
.hljs-template-variable,
.hljs-type,
.hljs-selector-class,
.hljs-selector-attr,
.hljs-selector-pseudo,
.hljs-number {
  color: #d19a66
}
.hljs-symbol,
.hljs-bullet,
.hljs-link,
.hljs-meta,
.hljs-selector-id,
.hljs-title {
  color: #61aeee
}
.hljs-built_in,
.hljs-title.class_,
.hljs-class .hljs-title {
  color: #e6c07b
}
.hljs-emphasis {
  font-style: italic
}
.hljs-strong {
  font-weight: bold
}
.hljs-link {
  text-decoration: underline
}
.code-wrapper {
    position: relative;
    margin: 1em 0;
    background: #282c34;
    border-radius: 5px;
    /*overflow: hidden;*/
}

.code-wrapper pre {
    margin: 0;
    padding: 1em;
    overflow-x: auto;
    background: inherit;
}

.code-wrapper pre code {
    display: block;
    /*white-space: pre-wrap;        !* wrap lines *!*/
    /*word-break: break-word;       !* break long words *!*/
    /*overflow-wrap: anywhere;      !* wrap anywhere if needed *!*/
    /*text-indent: -1em;            !* outdent first line *!*/
    /*padding-left: 1em;            !* re-indent entire block *!*/
}

.code-wrapper .hljs {
    white-space: inherit;         /* inherit from code block */
}

.copy-button {
    position: absolute;
    top: 0.5em;
    right: 0.5em;
    background: #444;
    color: #fff;
    border: none;
    padding: 0.3em 0.5em;
    cursor: pointer;
    font-size: 0.8em;
    border-radius: 3px;
    opacity: 0.7;
    z-index: 999;
}

.copy-button:hover {
    opacity: 1;
}

.markdown-content {
    line-height: 1.5;
}

.markdown-content blockquote {
    margin-block-start: 0;
    margin-block-end: 0;
}

.markdown-content p {
    /*margin: 0.75em 0;*/
    line-height: 1.5;
    margin-block-start: 0;
    margin-block-end: 0;
}

.markdown-content hr {
    display: none;
    margin-block-start: 0;
    margin-block-end: 0;
}

.markdown-content h1,
.markdown-content h2,
.markdown-content h3,
.markdown-content h4,
.markdown-content h5,
.markdown-content h6 {
    /*margin: 1.5em 0 0.75em 0;*/
    line-height: 1.3;
    margin-block-start: 0;
    margin-block-end: 0;
}

.markdown-content h1:first-child,
.markdown-content h2:first-child,
.markdown-content h3:first-child,
.markdown-content h4:first-child,
.markdown-content h5:first-child,
.markdown-content h6:first-child {
    margin-top: 0;
}

.markdown-content div {
    margin: 1em 0;
}

.markdown-content ul,
.markdown-content ol {
    margin: 0.75em 0;
    padding-left: 1.5em;
    line-height: 1.5;
    margin-block-start: 0;
    margin-block-end: 0;
}

.markdown-content li {
    margin: 0.25em 0;
}

.markdown-content ul ul,
.markdown-content ol ol,
.markdown-content ul ol,
.markdown-content ol ul {
    margin: 0.25em 0;
    margin-block-start: 0;
    margin-block-end: 0;
}

.thinking-animation {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  background-color: #f0f0f0;
  border-radius: 18px;
  margin: 4px 0;
}

.thinking-dots {
  display: flex;
  gap: 4px;
}

.thinking-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  animation: thinking-bounce 1.4s infinite ease-in-out;
}

.thinking-dot:nth-child(1) {
  background-color: #7BCAAB;
  animation-delay: -0.32s;
}

.thinking-dot:nth-child(2) {
  background-color: #7BCAAB;
  animation-delay: -0.16s;
}

.thinking-dot:nth-child(3) {
  background-color: #7BCAAB;
  animation-delay: 0s;
}

@keyframes thinking-bounce {
  0%, 80%, 100% {
    transform: scale(0.8);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

.sources-section {
  margin: 16px 0;
  padding: 16px;
  background-color: #e9e9e9;
  border: 1px solid #d0d0d0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sources-section:hover {
  background-color: #e0e0e0;
}

.sources-section.expanded {
  cursor: default;
}

.sources-section.expanded:hover {
  background-color: #e9e9e9;
}

/* Desktop - always expanded, no expand icon */
@media (min-width: 769px) {
  .sources-section {
    cursor: default;
  }
  
  .sources-section:hover {
    background-color: #e9e9e9;
  }
  
  .expand-icon {
    display: none;
  }
  
  .sources-content {
    max-height: none !important;
  }
}

/* Mobile responsive sources */
@media (max-width: 768px) {
  .sources-section {
    margin: 12px 0;
    padding: 12px;
    border-radius: 6px;
  }
  
  .sources-content.collapsed {
    max-height: 48px;
  }
}

@media (max-width: 480px) {
  .sources-section {
    margin: 8px 0;
    padding: 10px;
    border-radius: 4px;
  }
  
  .sources-content.collapsed {
    max-height: 48px;
  }
}

.sources-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.sources-section h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #333;
}

.expand-icon {
  font-size: 16px;
  color: #666;
  transition: transform 0.2s ease;
  margin-left: 8px;
}

.expand-icon.rotated {
  transform: rotate(180deg);
}

.sources-content {
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.sources-content.collapsed {
  max-height: 48px;
}

.sources-content.expanded {
  max-height: 1000px;
}

.sources-section ol {
  margin: 0;
  padding-left: 20px;
}

.sources-section li {
  margin-bottom: 8px;
  line-height: 1.2;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
}

/* Mobile responsive source items */
@media (max-width: 768px) {
  .sources-section li {
    font-size: 0.875rem;
    gap: 6px;
    margin-bottom: 6px;
  }
  
  .content-type {
    min-width: 60px;
    font-size: 0.75rem;
  }
}

@media (max-width: 480px) {
  .sources-section li {
    font-size: 0.8125rem;
    gap: 4px;
    margin-bottom: 4px;
    flex-wrap: wrap;
  }
  
  .content-type {
    min-width: 60px;
    font-size: 0.7rem;
  }
}

.platform-icon {
  font-size: 18px;
  min-width: 20px;
  flex-shrink: 0;
  color: #777;
}

.content-type {
  min-width: 60px;
  font-size: 0.875rem;
  color: #666;
  font-weight: 500;
  text-transform: capitalize;
  flex-shrink: 0;
}

.sources-section a {
  color: #007bff;
  text-decoration: none;
  font-weight: 500;
}

.sources-section a:hover {
  text-decoration: underline;
}

.sources-section li:last-child {
  margin-bottom: 0;
}

.user-intent-section {
  margin: 16px 0;
  padding: 16px;
  background-color: #fff3cd;
  border: 1px solid #ffeaa7;
  border-radius: 8px;
  font-family: 'Courier New', monospace;
}

/* Mobile responsive user intent */
@media (max-width: 768px) {
  .user-intent-section {
    margin: 12px 0;
    padding: 12px;
    border-radius: 6px;
  }
}

@media (max-width: 480px) {
  .user-intent-section {
    margin: 8px 0;
    padding: 10px;
    border-radius: 4px;
  }
}

.user-intent-section h3 {
  margin: 0 0 12px 0;
  font-size: 16px;
  font-weight: 600;
  color: #856404;
}

.user-intent-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.intent-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.intent-label {
  font-weight: 600;
  color: #856404;
  min-width: 120px;
}

.intent-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.intent-tag {
  background-color: #ffeaa7;
  border: 1px solid #fdcb6e;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 12px;
  color: #856404;
  font-weight: 500;
}

/* Mobile responsive tags */
@media (max-width: 480px) {
  .intent-group {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  
  .intent-label {
    min-width: auto;
  }
  
  .intent-tag {
    font-size: 11px;
    padding: 1px 6px;
  }
}

.agent-status-message {
  margin: 8px 0;
  padding: 12px 16px;
  background: linear-gradient(135deg, #e3f2fd 0%, #f0f8ff 100%);
  border: 1px solid #bbdefb;
  border-radius: 8px;
  font-size: 14px;
  color: #1565c0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  position: relative;
  overflow: hidden;
}

.agent-status-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  opacity: 0.8;
}

.agent-status-type {
  flex: 1;
}

.agent-status-time {
  font-size: 11px;
  font-weight: 500;
  opacity: 0.7;
}

.agent-status-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.agent-status-text {
  animation: statusPulse 2s ease-in-out infinite;
  font-weight: 500;
  line-height: 1.4;
}

@keyframes statusPulse {
  0%, 100% {
    color: #1565c0;
    opacity: 1;
  }
  50% {
    color: #42a5f5;
    opacity: 0.8;
  }
}

/* Add a subtle shimmer effect */
.agent-status-message::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.4),
    transparent
  );
  animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}


.error-message-container {
  background-color: #ffebee;
  border-radius: 8px;
  padding: 12px;
  margin: 8px 0;
  display: flex;
  align-items: flex-start;
  border-left: 4px solid #f44336;
}

.error-icon {
  margin: 6px 6px 0 0;
  font-size: 18px;
}

.error-text {
  color: #d32f2f;
  font-size: 14px;
  line-height: 1.5;
}

.error-message {
  padding: 0;
}
.message-feedback {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 0;
  margin-top: 4px;
  margin-bottom: 8px;
  opacity: 0;
  transition: opacity 0.2s ease;
  font-size: 13px;
  font-style: italic;
  background: linear-gradient(135deg, rgba(173, 216, 230, 0.35) 0%, rgba(135, 206, 235, 0.1) 100%);
  padding: 8px 15px;
  border-radius: 12px;
  border: 1px solid rgba(173, 216, 230, 0.9);
  max-width: 80%;
}

@media (max-width: 480px) {
  .message-feedback {
    max-width: 95%;
  }
}

.bot-message + .message-feedback {
  opacity: 1;
}

.feedback-buttons {
  display: flex;
  gap: 4px;
}

.feedback-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 2px solid #e9ecef;
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  cursor: pointer;
  color: #6c757d;
  transition: all 0.3s ease;
  padding: 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.feedback-button:hover {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-color: #007bff;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.thumbs-up-button:hover {
  color: #28a745;
  background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
  border-color: #28a745;
}

.thumbs-down-button:hover {
  color: #dc3545;
  background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
  border-color: #dc3545;
}

.thumbs-up-button.selected {
  color: #28a745;
  background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
  border-color: #28a745;
  box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.2);
}

.thumbs-down-button.selected {
  color: #dc3545;
  background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
  border-color: #dc3545;
  box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.2);
}

.copy-button:hover {
  color: #007bff;
  background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
  border-color: #007bff;
}

.feedback-copy-button.copy-success {
  color: #28a745;
  background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
  border-color: #28a745;
  box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.2);
}

.feedback-tooltip {
  position: relative;
}

.feedback-tooltip::after {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background-color: #000;
  color: #fff;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  margin-bottom: 8px;
  z-index: 1000;
}

.feedback-tooltip.show-tooltip::after {
  opacity: 1;
  visibility: visible;
}

.copy-tooltip::after {
  content: "Copied!";
}

.thumbs-up-tooltip::after {
  content: "Thank you for your feedback!";
}

.thumbs-down-tooltip::after {
  content: "Thank you for your feedback!";
}

.feedback-submitted {
  opacity: 1;
}

.feedback-thank-you {
  font-size: 12px;
  color: #6b7280;
  font-style: italic;
  margin-left: 8px;
}

.feedback-help-text {
  font-size: 12px;
  color: #6b7280;
  font-style: italic;
  margin-left: 8px;
  opacity: 0.8;
}

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

.feedback-modal {
  background: white;
  border-radius: 8px;
  padding: 24px;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

/* Mobile responsive feedback modal */
@media (max-width: 768px) {
  .feedback-modal {
    width: 95%;
    padding: 20px;
    border-radius: 6px;
  }
}

@media (max-width: 480px) {
  .feedback-modal {
    width: 98%;
    padding: 16px;
    border-radius: 4px;
    margin: 10px;
  }
}

.feedback-modal-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.feedback-modal-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: #1f2937;
}

.feedback-modal-close {
  background: none;
  border: none;
  color: #6b7280;
  cursor: pointer;
  padding: 4px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background-color 0.2s;
  font-size: 20px;
  font-weight: bold;
}

.feedback-modal-close:hover {
  background-color: rgba(0,0,0,0.1);
}

.feedback-modal-header p {
  margin: 0 0 20px 0;
  font-size: 14px;
  color: #6b7280;
}

.feedback-modal-body label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #374151;
}

.feedback-modal-body textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  min-height: 100px;
  box-sizing: border-box;
}

.feedback-modal-body textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

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

.feedback-modal-button {
  padding: 0.75rem 1.5rem;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 2px solid transparent;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.cancel-button {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  color: #495057;
  border-color: #e9ecef;
}

.cancel-button:hover {
  background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
  border-color: #6c757d;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.send-button {
  background: linear-gradient(135deg, #2e0066 0%, #0056b3 100%);
  color: white;
  border-color: #007bff;
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.2);
}

.send-button:hover {
  background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 123, 255, 0.3);
}

.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(170deg, #12003e 0%, #2e0066 15%, #60008f 50%, #9c3874 75%, #5f88db 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-content {
    text-align: center;
    color: white;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px auto;
}

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

.loading-text {
    font-size: 22px;
    font-weight: 500;
    margin: 0;
    opacity: 0.9;
}

.example-prompts {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-top: 1.25rem;
}

/* Mobile responsive example prompts */
@media (max-width: 768px) {
    .example-prompts {
        grid-template-columns: 1fr;
        gap: 0.625rem;
        margin-top: 1rem;
    }
}

@media (max-width: 480px) {
    .example-prompts {
        grid-template-columns: 1fr;
        gap: 0.5rem;
        margin-top: 0.75rem;
    }
}

.example-prompt-button {
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 2px solid #e9ecef;
    border-radius: 0.75rem;
    cursor: pointer;
    text-align: left;
    transition: all 0.3s ease;
    height: 100%;
    white-space: pre-wrap;
    line-height: 1.5;
    font-size: 0.875rem;
    font-weight: 500;
    color: #495057;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    animation-duration: 0.8s;
    animation-timing-function: ease-in-out;
    animation-fill-mode: both;
}

.example-prompts.animating .example-prompt-button {
    animation-name: fadePrompt;
}

@keyframes fadePrompt {
    0% {
        opacity: 1;
        background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
        color: #495057;
    }
    37.5% {
        opacity: 0;
        background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
        color: #adb5bd;
    }
    62.5% {
        opacity: 0;
        background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
        color: #adb5bd;
    }
    100% {
        opacity: 1;
        background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
        color: #495057;
    }
}

/* Mobile responsive example prompt buttons */
@media (max-width: 768px) {
    .example-prompt-button {
        padding: 0.875rem 1rem;
        font-size: 0.875rem;
        border-radius: 0.625rem;
    }
}

@media (max-width: 480px) {
    .example-prompt-button {
        padding: 0.75rem 0.875rem;
        font-size: 0.875rem;
        border-radius: 0.5rem;
    }
}

.example-prompt-button:hover {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-color: #007bff;
    color: #007bff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.15);
}

/* Hide buttons with index >= 3 on mobile */
@media (max-width: 768px) {
    .example-prompt-button.mobile-hidden {
        display: none;
    }
}

.search-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease-out;
}

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

.search-modal {
  background: white;
  border-radius: 12px;
  width: 90%;
  max-width: 700px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  animation: slideUp 0.3s ease-out;
}

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

.search-modal-header {
  padding: 24px;
  border-bottom: 1px solid #e5e7eb;
}

.search-modal-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.search-modal-title h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: #1f2937;
}

.search-modal-close {
  background: none;
  border: none;
  color: #6b7280;
  cursor: pointer;
  padding: 4px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background-color 0.2s;
  font-size: 24px;
  font-weight: bold;
  line-height: 1;
}

.search-modal-close:hover {
  background-color: rgba(0, 0, 0, 0.1);
}

.search-modal-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-modal-icon {
  position: absolute;
  left: 14px;
  color: #9ca3af;
  pointer-events: none;
  z-index: 1;
  font-size: 16px;
}

.search-modal-input {
  width: 100%;
  padding: 12px 44px 12px 44px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  background-color: white;
  color: #1f2937;
  font-size: 15px;
  transition: all 0.2s ease;
  outline: none;
  box-sizing: border-box;
}

.search-modal-input::placeholder {
  color: #9ca3af;
}

.search-modal-input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.search-modal-clear-button {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  padding: 6px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.search-modal-clear-button:hover {
  background-color: rgba(0, 0, 0, 0.05);
  color: #1f2937;
}

.search-modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}

.search-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: #6b7280;
}

.search-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #e5e7eb;
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 16px;
}

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

.search-error {
  padding: 40px;
  text-align: center;
  color: #dc2626;
}

.search-no-results {
  padding: 40px;
  text-align: center;
  color: #6b7280;
}

.search-no-results p:first-child {
  margin: 0 0 8px 0;
  font-size: 16px;
  font-weight: 500;
}

.search-no-results-hint {
  margin: 0;
  font-size: 14px;
  color: #9ca3af;
}

.search-results-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.search-result-item {
  padding: 16px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: white;
}

.search-result-item:hover {
  border-color: #3b82f6;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
  transform: translateY(-1px);
}

.search-result-item:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

.search-result-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}

.search-result-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #1f2937;
  flex: 1;
  word-break: break-word;
}

.search-result-title .search-highlight {
  background-color: #dbeafe;
  color: #1e40af;
  padding: 0 2px;
  border-radius: 2px;
}

.search-result-date {
  font-size: 12px;
  color: #6b7280;
  white-space: nowrap;
}

.search-result-excerpt {
  margin: 0 0 8px 0;
  font-size: 14px;
  color: #4b5563;
  line-height: 1.5;
  word-break: break-word;
}

.search-result-excerpt .search-highlight {
  background-color: #fef3c7;
  color: #92400e;
  padding: 0 2px;
  border-radius: 2px;
  font-weight: 500;
}

.search-result-url {
  font-size: 12px;
  color: #9ca3af;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .search-modal {
    width: 95%;
    max-height: 85vh;
    border-radius: 8px;
  }

  .search-modal-header {
    padding: 20px;
  }

  .search-modal-title {
    margin-bottom: 14px;
  }

  .search-modal-title h3 {
    font-size: 18px;
  }

  .search-modal-input {
    padding: 10px 40px 10px 40px;
    font-size: 14px;
  }

  .search-modal-body {
    padding: 16px 20px;
  }

  .search-result-item {
    padding: 14px;
  }

  .search-result-title {
    font-size: 15px;
  }

  .search-result-excerpt {
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  .search-modal {
    width: 100%;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
    margin: 0;
  }

  .search-modal-header {
    padding: 16px;
  }

  .search-modal-title {
    margin-bottom: 12px;
  }

  .search-modal-title h3 {
    font-size: 16px;
  }

  .search-modal-input {
    padding: 10px 38px 10px 38px;
    font-size: 13px;
  }

  .search-modal-icon {
    left: 12px;
    font-size: 14px;
  }

  .search-modal-clear-button {
    right: 8px;
    width: 26px;
    height: 26px;
  }

  .search-modal-body {
    padding: 12px 16px;
  }

  .search-result-item {
    padding: 12px;
  }

  .search-result-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .search-result-date {
    font-size: 11px;
  }
}

/* Custom scrollbar for search results */
.search-modal-body::-webkit-scrollbar {
  width: 8px;
}

.search-modal-body::-webkit-scrollbar-track {
  background: #f3f4f6;
  border-radius: 4px;
}

.search-modal-body::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 4px;
}

.search-modal-body::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

/* Chat Sidebar Container */
.chat-sidebar {
  position: relative;
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  border-radius: 16px;
  border: 1px solid rgba(0, 123, 255, 0.1);
  display: flex;
  flex-direction: column;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 10px 40px rgba(0, 123, 255, 0.08), 0 4px 12px rgba(0, 0, 0, 0.05);
  z-index: 10;
}

.chat-sidebar.disabled {
  opacity: 0.6;
  pointer-events: none;
}

.chat-sidebar.collapsed {
  width: 60px;
  min-width: 60px;
}

.chat-sidebar.expanded {
  width: 280px;
  min-width: 280px;
}

/* Hamburger Toggle Button */
.sidebar-toggle {
  width: 44px;
  height: 44px;
  margin: 16px auto 8px auto;
  background: rgba(0, 123, 255, 0.1);
  color: #007bff;
  border: 1px solid rgba(0, 123, 255, 0.2);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 16px;
}

.sidebar-toggle:hover:not(:disabled) {
  background: rgba(0, 123, 255, 0.15);
  border-color: rgba(0, 123, 255, 0.3);
  transform: scale(1.05);
}

.sidebar-toggle:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* New Chat Button */
.new-chat-button {
  margin: 8px 12px;
  padding: 12px;
  background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
  color: white;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 2px 8px rgba(0, 123, 255, 0.2);
}

.new-chat-button.collapsed {
  width: 44px;
  height: 44px;
  padding: 0;
  margin: 8px auto;
}

.new-chat-button.collapsed span {
  display: none;
}

.new-chat-button:hover:not(:disabled) {
  background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.new-chat-button:active:not(:disabled) {
  transform: translateY(0);
}

.new-chat-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Sidebar Divider */
.sidebar-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 123, 255, 0.1), transparent);
  margin: 8px 16px;
}

/* Chat List Header */
.chat-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px 8px 16px;
  font-size: 13px;
  font-weight: 600;
  color: #6c757d;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.close-button {
  background: none;
  border: none;
  color: #6c757d;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.close-button:hover:not(:disabled) {
  background: rgba(0, 123, 255, 0.1);
  color: #007bff;
}

.close-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Chat List */
.chat-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 8px 16px 8px;
}

.chat-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  padding: 12px;
  margin-bottom: 4px;
  background: transparent;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
  position: relative;
}

.chat-item:hover:not(:disabled) {
  background: rgba(0, 123, 255, 0.05);
}

.chat-item:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.chat-item.active {
  background: rgba(0, 123, 255, 0.1);
  border: 1px solid rgba(0, 123, 255, 0.2);
}

.chat-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  background: #007bff;
  border-radius: 0 2px 2px 0;
}

.chat-item-icon {
  color: #9ca3af;
  font-size: 14px;
  margin-top: 2px;
  flex-shrink: 0;
}

.chat-item.active .chat-item-icon {
  color: #007bff;
}

.chat-item-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.chat-title {
  font-weight: 500;
  color: #495057;
  font-size: 14px;
  line-height: 1.4;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.chat-item.active .chat-title {
  font-weight: 600;
  color: #007bff;
}

.chat-timestamp {
  font-size: 12px;
  color: #9ca3af;
  font-weight: 400;
}

.no-chats {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: #9ca3af;
  padding: 32px 16px;
  text-align: center;
}

.no-chats span {
  font-size: 14px;
}


/* Scrollbar styling */
.chat-list::-webkit-scrollbar {
  width: 4px;
}

.chat-list::-webkit-scrollbar-track {
  background: transparent;
}

.chat-list::-webkit-scrollbar-thumb {
  background: rgba(0, 123, 255, 0.2);
  border-radius: 2px;
}

.chat-list::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 123, 255, 0.3);
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .chat-sidebar.expanded {
    position: absolute;
    top: 0;
    left: 0;
    width: 280px;
    height: 100%;
    z-index: 20;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  }
  
  .chat-sidebar.collapsed {
    width: 50px;
    min-width: 50px;
    border-radius: 12px;
  }
  
  .sidebar-toggle {
    width: 36px;
    height: 36px;
    margin: 12px auto 6px auto;
  }
  
  .new-chat-button.collapsed {
    width: 36px;
    height: 36px;
    margin: 6px auto;
  }
  
  /* Ensure chat items are clickable on mobile */
  .chat-sidebar.expanded .chat-item {
    position: relative;
    z-index: 21;
    pointer-events: auto;
  }
}

@media (max-width: 480px) {
  .chat-sidebar.expanded {
    border-radius: 8px;
  }
  
  .chat-sidebar.collapsed {
    border-radius: 8px;
  }
}

@media (max-width: 480px) {
  .chat-list-header {
    padding: 10px 12px 6px 12px;
    font-size: 12px;
  }
  
  .chat-item {
    padding: 10px;
    gap: 10px;
  }
  
  .chat-title {
    font-size: 13px;
  }
  
  .chat-timestamp {
    font-size: 11px;
  }
}

/* Search Button Styles */
.chat-search-button {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  width: calc(100% - 32px);
  margin: 12px 16px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: white;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chat-search-button:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.chat-search-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.chat-search-button svg {
  color: #9ca3af;
}

.chat-search-button span {
  color: #9ca3af;
}

/* Mobile responsive search button */
@media (max-width: 768px) {
  .chat-search-button {
    width: calc(100% - 24px);
    margin: 10px 12px;
    padding: 8px 12px;
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  .chat-search-button {
    width: calc(100% - 24px);
    margin: 8px 12px;
    padding: 8px 12px;
    font-size: 12px;
  }
}

/* Chat Item Wrapper with Menu */
.chat-item-wrapper {
  position: relative;
  margin-bottom: 4px;
}

.chat-item-wrapper.deleting {
  opacity: 0.5;
  pointer-events: none;
}

/* Update chat-item to make room for menu button */
.chat-item {
  padding-right: 40px; /* Make room for menu button */
}

/* Three Dots Menu Button */
.chat-menu-button {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: #9ca3af;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  opacity: 0;
  z-index: 2;
}

.chat-item:hover .chat-menu-button,
.chat-item-wrapper:hover .chat-menu-button {
  opacity: 1;
}

.chat-menu-button:hover:not(:disabled) {
  background: rgba(0, 123, 255, 0.1);
  color: #007bff;
}

.chat-menu-button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* Dropdown Menu */
.chat-menu {
  position: absolute;
  right: 8px;
  top: 100%;
  margin-top: 4px;
  background: white;
  border: 1px solid rgba(0, 123, 255, 0.2);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 100;
  min-width: 140px;
  overflow: hidden;
  animation: menuFadeIn 0.15s ease;
}

@keyframes menuFadeIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chat-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  background: transparent;
  border: none;
  text-align: left;
  font-size: 14px;
  color: #495057;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chat-menu-item:hover:not(:disabled) {
  background: rgba(0, 123, 255, 0.05);
}

.chat-menu-item.delete {
  color: #dc3545;
}

.chat-menu-item.delete:hover:not(:disabled) {
  background: rgba(220, 53, 69, 0.05);
  color: #dc3545;
}

.chat-menu-item:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.chat-menu-item svg {
  font-size: 14px;
  width: 14px;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .chat-menu-button {
    opacity: 1; /* Always show on mobile */
  }

  .chat-menu {
    min-width: 120px;
  }

  .chat-menu-item {
    padding: 12px 14px;
    font-size: 13px;
  }
}

/* ChatGrid specific styles */
.chat-grid-container {
    display: flex;
    flex-direction: column;
    height: calc(100% - 40px);
    width: 100%;
}

.chat-grid-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.chat-grid-filters .MuiTextField-root {
    min-width: 150px;
}

.chat-grid-filters .MuiButton-root {
    margin-top: 0.5rem;
    align-self: flex-start;
}

.chat-grid-data {
    flex: 1;
    min-height: 0;
}

.chat-grid-data .MuiDataGrid-root {
    font-size: 0.8rem;
}

.chat-grid-data .MuiDataGrid-columnHeaders {
    font-size: 0.8rem;
}

.chat-grid-data .MuiDataGrid-cell {
    font-size: 0.8rem;
    min-height: 44px !important;
    max-height: 44px !important;
}

.chat-grid-data .MuiDataGrid-row {
    min-height: 44px !important;
    max-height: 44px !important;
}

.chat-grid-data .MuiDataGrid-footerContainer {
    min-height: 44px !important;
}

.chat-grid-error {
    color: #721c24;
    padding: 1rem;
    border: 2px solid #dc3545;
    border-radius: 12px;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    font-weight: 500;
}

/* Context menu styles */
.chat-context-menu {
    position: fixed;
    background: white;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    min-width: 180px;
    padding: 0.5rem 0;
}

.chat-context-menu-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-size: 0.875rem;
    color: #333;
}

.chat-context-menu-item:hover {
    background-color: #f5f5f5;
}

.chat-context-menu-item:first-child {
    border-bottom: 1px solid #eee;
    margin-bottom: 0.25rem;
    padding-bottom: 1rem;
}

/* Mobile responsive overrides for ChatGrid */
@media (max-width: 768px) {
    .chat-grid-filters {
        gap: 0.75rem;
        margin-bottom: 1rem;
        flex-direction: column;
    }
    
    .chat-grid-filters .MuiTextField-root {
        min-width: unset;
        width: 100%;
    }
    
    .chat-grid-filters .MuiButton-root {
        margin-top: 0;
        width: 100%;
    }
    
    .chat-grid-error {
        padding: 0.75rem;
        border-radius: 8px;
        font-size: 0.875rem;
    }
}

@media (max-width: 480px) {
    .chat-grid-container {
        height: calc(100% - 32px);
    }
    
    .chat-grid-filters {
        gap: 0.5rem;
        margin-bottom: 0.75rem;
    }
    
    .chat-grid-error {
        padding: 0.5rem;
        border-radius: 6px;
        font-size: 0.8rem;
    }
    
    .chat-grid-data .MuiDataGrid-root {
        font-size: 0.75rem;
    }
    
    .chat-grid-data .MuiDataGrid-columnHeaders {
        font-size: 0.75rem;
    }
    
    .chat-grid-data .MuiDataGrid-cell {
        font-size: 0.75rem;
        min-height: 36px !important;
    }
    
    .chat-grid-data .MuiDataGrid-row {
        min-height: 36px !important;
    }
    
    .chat-grid-data .MuiDataGrid-footerContainer {
        min-height: 36px !important;
    }
}

.chat-filters {
    display: flex;
    gap: 16px;
    padding: 16px;
    border-radius: 4px;
    margin-bottom: 0;
    align-items: center;
    flex-wrap: wrap;
}

.chat-filters .MuiTextField-root {
    min-width: 150px;
}

.chat-filters .search-field {
    flex: 1;
    min-width: 200px;
}

.chat-filters .MuiButton-root {
    height: 56px;
}

/* Mobile responsive layout */
@media (max-width: 768px) {
    .chat-filters {
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto auto;
        gap: 12px;
        padding: 12px;
        align-items: stretch;
    }
    
    .chat-filters .MuiTextField-root {
        min-width: unset;
    }
    
    .chat-filters .search-field {
        grid-column: 1 / -1;
        min-width: unset;
    }
    
    .chat-filters .MuiButton-root {
        grid-column: 1 / -1;
        height: 48px;
    }
    
    .chat-filters .MuiTextField-root .MuiInputBase-root {
        height: 48px;
        font-size: 0.875rem;
    }
    
    .chat-filters .MuiTextField-root .MuiInputLabel-root {
        font-size: 0.8125rem;
    }
}

@media (max-width: 480px) {
    .chat-filters {
        gap: 8px;
        padding: 8px;
    }
    
    .chat-filters .MuiButton-root {
        height: 44px;
        font-size: 0.875rem;
    }
    
    .chat-filters .MuiTextField-root .MuiInputBase-root {
        height: 44px;
        font-size: 0.8125rem;
    }
    
    .chat-filters .MuiTextField-root .MuiInputLabel-root {
        font-size: 0.75rem;
    }
}

/* Override Dashboard.css for ChatsTab to restore two-column layout */
.chats-tab {
    height: calc(100vh - 170px);
    display: flex;
    flex-direction: column;
}

.chats-tab .dashboard-content {
    display: flex;
    gap: 2rem;
    flex: 1;
    overflow: hidden;
}

.chats-tab .dashboard-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 2rem;
    flex: 1;
    overflow: hidden;
    height: 100%;
}

.chats-tab .dashboard-left {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 123, 255, 0.08), 0 4px 12px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    max-height: 100%;
    border: none;
}

.chats-tab .dashboard-right {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 123, 255, 0.08), 0 4px 12px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    max-height: 100%;
    border: none;
}

/* Mobile responsive overrides for ChatsTab */
@media (max-width: 1024px) {
    .chats-tab .dashboard-content {
        gap: 1.5rem;
        padding: 0 1rem 1rem 1rem;
    }
    
    .chats-tab .dashboard-main {
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .chats-tab .dashboard-content {
        gap: 1rem;
        padding: 0 0.5rem 0.5rem 0.5rem;
        flex-direction: column;
    }
    
    .chats-tab .dashboard-main {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr 1fr;
        gap: 1rem;
    }
    
    .chats-tab .dashboard-left,
    .chats-tab .dashboard-right {
        padding: 1.5rem;
        border-radius: 12px;
    }
}

@media (max-width: 480px) {
    .chats-tab .dashboard-content {
        gap: 0.75rem;
        padding: 0;
    }
    
    .chats-tab .dashboard-main {
        grid-template-rows: 1fr 1fr;
        gap: 0.75rem;
    }
    
    .chats-tab .dashboard-left,
    .chats-tab .dashboard-right {
        padding: 0.5rem;
        border-radius: 8px;
    }
}

/* ChatDetail specific styles */
.chat-detail {
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-detail .dashboard-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex: 1;
    overflow: auto;
    padding: 0;
}

.chat-detail-header {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.08);
    border: 1px solid rgba(0, 123, 255, 0.1);
}

.chat-detail-main {
    display: flex;
    flex: 1;
    overflow: hidden;
    position: relative;
}

.chat-detail-main > div:first-child {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 300px;
}

.chat-detail-resizer {
    width: 8px;
    background: #e0e0e0;
    cursor: col-resize;
    position: relative;
    flex-shrink: 0;
    transition: background-color 0.2s ease;
}

.chat-detail-resizer:hover {
    background: #007bff;
}

.chat-detail-resizer::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 2px;
    height: 40px;
    background: #999;
    border-radius: 1px;
}

.chat-detail-resizer:hover::after {
    background: white;
}

.chat-detail-main .chat-preview {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.chat-detail .dashboard-right {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 123, 255, 0.08), 0 4px 12px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    max-height: 100%;
    border: none;
    min-width: 300px;
}

/* Mobile responsive overrides for ChatDetail */
@media (max-width: 1024px) {
    .chat-detail .dashboard-content {
        gap: 1rem;
        padding: 0 1rem 1rem 1rem;
    }
    
    .chat-detail-resizer {
        width: 6px;
    }
    
    .chat-detail-header {
        padding: 1.25rem;
    }
}

@media (max-width: 768px) {
    .chat-detail .dashboard-content {
        gap: 0.75rem;
        padding: 0 0.5rem 0.5rem 0.5rem;
        overflow-y: auto;
    }
    
    .chat-detail-main {
        flex-direction: column;
        gap: 0.75rem;
        flex: 1;
        overflow: visible;
    }
    
    .chat-detail-resizer {
        display: none;
    }
    
    .chat-detail-header {
        padding: 1rem;
        border-radius: 8px;
        flex-shrink: 0;
    }
    
    .chat-detail .dashboard-right {
        padding: 1.5rem;
        border-radius: 12px;
        flex-shrink: 0;
    }
}

@media (max-width: 480px) {
    .chat-detail .dashboard-content {
        gap: 0.5rem;
        padding: 0;
    }
    
    .chat-detail-main {
        gap: 0.5rem;
    }
    
    .chat-detail-header {
        padding: 0.75rem;
        border-radius: 6px;
    }
    
    .chat-detail .dashboard-right {
        padding: 1rem;
        border-radius: 8px;
    }
}

.elastic-filters {
    display: flex;
    gap: 16px;
    padding: 16px;
    border-radius: 4px;
    margin-bottom: 0;
    align-items: center;
    flex-wrap: wrap;
}

.elastic-filters .search-field {
    flex: 1;
    min-width: 200px;
}

.elastic-filters .platform-field,
.elastic-filters .content-field {
    min-width: 150px;
}

.elastic-filters .search-button {
    height: 56px;
    min-width: 100px;
}

/* Mobile responsive layout */
@media (max-width: 768px) {
    .elastic-filters {
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto;
        gap: 12px;
        padding: 12px;
        align-items: stretch;
    }
    
    .elastic-filters .search-field {
        grid-column: 1 / -1;
        min-width: unset;
    }
    
    .elastic-filters .platform-field,
    .elastic-filters .content-field {
        min-width: unset;
    }
    
    .elastic-filters .MuiTextField-root .MuiInputBase-root {
        height: 48px;
        font-size: 0.875rem;
    }
    
    .elastic-filters .MuiTextField-root .MuiInputLabel-root {
        font-size: 0.8125rem;
    }
    
    .elastic-filters .MuiFormControl-root .MuiInputBase-root {
        height: 48px;
        font-size: 0.875rem;
    }
    
    .elastic-filters .MuiFormControl-root .MuiInputLabel-root {
        font-size: 0.8125rem;
    }
}

@media (max-width: 480px) {
    .elastic-filters {
        gap: 8px;
        padding: 8px;
    }
    
    .elastic-filters .MuiTextField-root .MuiInputBase-root {
        height: 44px;
        font-size: 0.8125rem;
    }
    
    .elastic-filters .MuiTextField-root .MuiInputLabel-root {
        font-size: 0.75rem;
    }
    
    .elastic-filters .MuiFormControl-root .MuiInputBase-root {
        height: 44px;
        font-size: 0.8125rem;
    }
    
    .elastic-filters .MuiFormControl-root .MuiInputLabel-root {
        font-size: 0.75rem;
    }
}

.search-details {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.search-details-header {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.search-details-title {
    font-weight: bold;
    margin-bottom: 8px;
}

.search-details-metadata {
    color: #666;
    margin-bottom: 8px;
}

.search-details-link {
    text-decoration: none;
    color: #007bff;
}

.search-details-link:hover {
    text-decoration: underline;
}

.chunk-display {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.full-article {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    overflow: hidden;
}

.full-article-content {
    padding: 16px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background-color: #f9f9f9;
    flex: 1;
    overflow-y: auto;
}

.full-article-content pre {
    white-space: pre-wrap;
    word-wrap: break-word;
    margin: 0;
    font-family: inherit;
}

/* Highlighting styles */
.highlighted-chunk-exact {
    background-color: #c8e6c9;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: bold;
}

.highlighted-chunk-partial {
    background-color: #ff9800;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: bold;
}

/* Override Dashboard.css for ElasticTab to restore two-column layout */
.elastic-tab {
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.elastic-tab .dashboard-content {
    display: flex;
    gap: 2rem;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.elastic-tab .dashboard-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 2rem;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.elastic-tab .dashboard-left {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 123, 255, 0.08), 0 4px 12px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: none;
    min-height: 0;
}

.elastic-tab .dashboard-right {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 123, 255, 0.08), 0 4px 12px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: none;
    flex: 1;
    min-height: 0;
}

/* Ensure all child elements have proper flex behaviour */
.elastic-tab .dashboard-right > * {
    flex-shrink: 0;
}

/* Make the last Box (containing FullArticle) flexible */
.elastic-tab .dashboard-right > .MuiBox-root:last-child {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* DataGrid styling for ElasticTab */
.elastic-tab .MuiDataGrid-root {
    font-size: 0.8rem;
}

.elastic-tab .MuiDataGrid-columnHeaders {
    font-size: 0.8rem;
}

.elastic-tab .MuiDataGrid-cell {
    font-size: 0.8rem;
    min-height: 44px !important;
    max-height: 44px !important;
}

.elastic-tab .MuiDataGrid-row {
    min-height: 44px !important;
    max-height: 44px !important;
}

.elastic-tab .MuiDataGrid-footerContainer {
    min-height: 44px !important;
}

/* Mobile responsive overrides for ElasticTab */
@media (max-width: 1024px) {
    .elastic-tab .dashboard-content {
        gap: 1.5rem;
        padding: 0 1rem 1rem 1rem;
    }
    
    .elastic-tab .dashboard-main {
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .elastic-tab .dashboard-content {
        gap: 1rem;
        padding: 0 0.5rem 0.5rem 0.5rem;
        flex-direction: column;
    }
    
    .elastic-tab .dashboard-main {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr 1fr;
        gap: 1rem;
    }
    
    .elastic-tab .dashboard-left,
    .elastic-tab .dashboard-right {
        padding: 1.5rem;
        border-radius: 12px;
    }
}

@media (max-width: 480px) {
    .elastic-tab .dashboard-content {
        gap: 0.75rem;
        padding: 0;
    }
    
    .elastic-tab .dashboard-main {
        grid-template-rows: 1fr 1fr;
        gap: 0.75rem;
    }
    
    .elastic-tab .dashboard-left,
    .elastic-tab .dashboard-right {
        padding: 1rem;
        border-radius: 8px;
    }
    
    .elastic-tab .MuiDataGrid-root {
        font-size: 0.75rem;
    }
    
    .elastic-tab .MuiDataGrid-columnHeaders {
        font-size: 0.75rem;
    }
    
    .elastic-tab .MuiDataGrid-cell {
        font-size: 0.75rem;
        min-height: 36px !important;
    }
    
    .elastic-tab .MuiDataGrid-row {
        min-height: 36px !important;
    }
    
    .elastic-tab .MuiDataGrid-footerContainer {
        min-height: 36px !important;
    }
}

.notifications-tab {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.notifications-tab h2 {
    margin-bottom: 1.5rem;
    color: #212529;
    font-size: 1.5rem;
    font-weight: 600;
}

.notifications-buttons {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.notifications-button {
    min-width: 200px;
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-transform: none;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.notifications-button:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

.notifications-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.notifications-message {
    padding: 1rem;
    margin-top: 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid;
}

.notifications-message.success {
    background-color: #e8f5e8;
    color: #2e7d32;
    border-color: #4caf50;
}

.notifications-message.error {
    background-color: #ffebee;
    color: #c62828;
    border-color: #ef5350;
}

.weekly-digest-result {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.weekly-digest-scroll-container {
    flex: 1;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 16px;
    background-color: #f9f9f9;
}

.weekly-digest-scroll-container::-webkit-scrollbar {
    width: 8px;
}

.weekly-digest-scroll-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.weekly-digest-scroll-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.weekly-digest-scroll-container::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .notifications-tab {
        padding: 1rem;
    }
    
    .notifications-buttons {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .notifications-button {
        min-width: unset;
        width: 100%;
    }

    .weekly-digest-scroll-container {
        padding: 12px;
    }
}

@media (max-width: 480px) {
    .notifications-tab {
        padding: 0.75rem;
    }
    
    .notifications-tab h2 {
        font-size: 1.25rem;
        margin-bottom: 1rem;
    }
    
    .notifications-button {
        padding: 0.625rem 1rem;
        font-size: 0.8rem;
    }

    .weekly-digest-scroll-container {
        padding: 8px;
    }
}

.dashboard {
    padding: 1rem;
    margin: 0 auto;
    height: calc(100vh - 80px); /* Account for header height */
    width: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-sizing: border-box;
}

.dashboard > .MuiBox-root:first-child {
    flex-shrink: 0; /* Tabs should not shrink */
}

.dashboard > div:last-child {
    flex: 1;
    min-height: 0;
    overflow: hidden;
}


/* Mobile responsive dashboard */
@media (max-width: 768px) {
    .dashboard {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .dashboard {
        padding: 0.75rem;
    }
}

.dashboard h1 {
    color: #212529;
    margin-bottom: 2rem;
    font-size: 2rem;
    font-weight: 700;
}

/* Mobile responsive dashboard title */
@media (max-width: 768px) {
    .dashboard h1 {
        font-size: 1.75rem;
        margin-bottom: 1.5rem;
    }
}

@media (max-width: 480px) {
    .dashboard h1 {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }
}

.dashboard-content {
    display: flex;
    gap: 2rem;
    flex: 1;
    overflow: hidden;
    padding: 0 0 2rem 0;
}

.dashboard-main {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    flex: 1;
    overflow: hidden;
}

.dashboard-sidebar {
    width: 400px;
    transition: width 0.3s ease;
    overflow: hidden;
}

.dashboard-sidebar.collapsed {
    width: 0;
}

.dashboard-toggle {
    position: fixed;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    z-index: 1000;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.dashboard-toggle:hover {
    background: #0056b3;
    transform: translateY(-50%) scale(1.1);
}


/* Mobile responsive dashboard content */
@media (max-width: 1024px) {
    .dashboard-content {
        gap: 1.5rem;
        padding: 0 0 1rem 0;
    }
    
    .dashboard-main {
        gap: 1.5rem;
    }
    
    .dashboard-sidebar {
        width: 350px;
    }
    
}

@media (max-width: 768px) {
    .dashboard-content {
        gap: 1rem;
        padding: 0 0 0.5rem 0;
        flex-direction: column;
    }
    
    .dashboard-main {
        gap: 1rem;
    }
    
    .dashboard-sidebar {
        width: 100%;
        position: fixed;
        top: 0;
        right: 0;
        height: 100vh;
        background: rgba(0, 0, 0, 0.1);
        backdrop-filter: blur(5px);
        z-index: 999;
    }
    
    .dashboard-sidebar.collapsed {
        width: 0;
    }
    
    .dashboard-toggle {
        right: 10px;
    }
    
    .dashboard-toggle.sidebar-open {
        right: 10px;
    }
}

@media (max-width: 480px) {
    .dashboard-content {
        gap: 0.75rem;
        padding: 0;
    }
    
    .dashboard-main {
        gap: 0.75rem;
    }
}

.prompt-debug-content {
    flex: 1;
    overflow-y: auto;
    margin-top: 1rem;
}

.dashboard-left {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 123, 255, 0.08), 0 4px 12px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    max-height: 100%;
    border: none;
}

.dashboard-right {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 123, 255, 0.08), 0 4px 12px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    max-height: 100%;
    border: none;
}

/* Mobile responsive dashboard panels */
@media (max-width: 768px) {
    .dashboard-left,
    .dashboard-right {
        padding: 1.5rem;
        border-radius: 12px;
    }
}

@media (max-width: 480px) {
    .dashboard-left,
    .dashboard-right {
        padding: 1rem;
        border-radius: 8px;
    }
}

.chat-preview {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    margin-top: 1rem;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.04);
}

/* Mobile responsive chat preview */
@media (max-width: 768px) {
    .chat-preview {
        padding: 0.75rem;
        border-radius: 8px;
        margin-top: 0.5rem;
    }
}

@media (max-width: 480px) {
    .chat-preview {
        padding: 0.5rem;
        border-radius: 6px;
        margin-top: 0.25rem;
    }
}

.chat-message {
    margin-bottom: 1rem;
    padding: 0.75rem;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.chat-message.user {
    background: linear-gradient(135deg, #2e0066 0%, #0056b3 100%);
    color: white;
    margin-left: 2rem;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.2);
}

.chat-message.assistant {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: #212529;
    margin-right: 2rem;
    border: 1px solid rgba(0, 123, 255, 0.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.chat-message.selected {
    outline: 3px solid #007bff;
    outline-offset: 2px;
}

/* Mobile responsive chat messages */
@media (max-width: 768px) {
    .chat-message {
        padding: 0.625rem;
        border-radius: 8px;
    }
    
    .chat-message.user {
        margin-left: 1rem;
    }
    
    .chat-message.assistant {
        margin-right: 1rem;
    }
}

@media (max-width: 480px) {
    .chat-message {
        padding: 0.5rem;
        border-radius: 6px;
        font-size: 0.875rem;
    }
    
    .chat-message.user {
        margin-left: 0.5rem;
    }
    
    .chat-message.assistant {
        margin-right: 0.5rem;
    }
}

.chat-message.user .chat-timestamp {
    color: #fff;
}
.chat-timestamp {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 0.25rem;
}

.feedback-block {
    margin-top: 0.5rem;
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 0.9rem;
}

.feedback-block.positive {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border: 2px solid #28a745;
    color: #155724;
    border-radius: 8px;
}

.feedback-block.negative {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border: 2px solid #dc3545;
    color: #721c24;
    border-radius: 8px;
}

.filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

/* Mobile responsive filters */
@media (max-width: 768px) {
    .filters {
        gap: 0.75rem;
        margin-bottom: 1.5rem;
    }
}

@media (max-width: 480px) {
    .filters {
        gap: 0.5rem;
        margin-bottom: 1rem;
        flex-direction: column;
    }
}

.filter-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-item label {
    font-weight: 500;
    color: #666;
}

.filter-item input {
    padding: 0.75rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
}

.filter-item input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 4px rgba(0, 123, 255, 0.15);
    background: #ffffff;
}

/* Mobile responsive filter inputs */
@media (max-width: 480px) {
    .filter-item input {
        padding: 0.625rem;
        font-size: 0.875rem;
    }
}

.data-grid {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.data-grid th,
.data-grid td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.data-grid th {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    font-weight: 600;
    color: #495057;
}

.data-grid tr:hover {
    background-color: rgba(0, 123, 255, 0.05);
}

/* Mobile responsive data grid */
@media (max-width: 768px) {
    .data-grid th,
    .data-grid td {
        padding: 0.5rem;
        font-size: 0.875rem;
    }
}

@media (max-width: 480px) {
    .data-grid {
        font-size: 0.8rem;
    }
    
    .data-grid th,
    .data-grid td {
        padding: 0.375rem;
    }
}

.loading {
    text-align: center;
    padding: 2rem;
    color: #666;
}

.error {
    color: #721c24;
    padding: 1rem;
    border: 2px solid #dc3545;
    border-radius: 12px;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    font-weight: 500;
}

/* Mobile responsive error */
@media (max-width: 768px) {
    .error {
        padding: 0.75rem;
        border-radius: 8px;
        font-size: 0.875rem;
    }
}

@media (max-width: 480px) {
    .error {
        padding: 0.5rem;
        border-radius: 6px;
        font-size: 0.8rem;
    }
}

.user-profile {
    position: relative;
    display: flex;
    align-items: center;
    margin-right: 15px;
}

/* Embedded mode specific styles */
.embedded-profile {
    margin-right: 15px;
}

.sign-in-button {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

/* Mobile responsive sign-in button */
@media (max-width: 480px) {
    .sign-in-button {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
}

.sign-in-button:hover {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
}

.user-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    color: #007bff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Mobile responsive avatar */
@media (max-width: 480px) {
    .user-avatar {
        width: 36px;
        height: 36px;
    }
    
    .user-initials {
        font-size: 0.8rem;
    }
}

.user-avatar:hover {
    background: linear-gradient(135deg, #ffffff 0%, #e9ecef 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.user-initials {
    font-weight: 700;
    font-size: 0.95rem;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.75rem;
    background-color: white;
    border: none;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1), 0 4px 12px rgba(0, 0, 0, 0.05);
    min-width: 220px;
    z-index: 1000;
    overflow: hidden;
}

.dropdown-item {
    display: block;
    width: 100%;
    padding: 1rem 1.25rem;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    font-size: 0.9rem;
    color: #495057;
    transition: all 0.2s ease;
    font-weight: 500;
}

.dropdown-item:hover {
    background-color: #f8f9fa;
    color: #007bff;
}

.dropdown-item.user-info-item {
    cursor: default;
    font-weight: 600;
    color: #212529;
}

.dropdown-item.user-info-item:hover {
    background-color: transparent;
    color: #212529;
}

.dropdown-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, #dee2e6, transparent);
    margin: 0.5rem 0;
}

.user-name {
    color: #6c757d;
    font-weight: 400;
}

/* Adjust dropdown position based on mode */
.embedded-profile .dropdown-menu {
    left: 0;
    right: auto;
}

/* Non-embedded mode dropdown should align to the right */
.user-profile:not(.embedded-profile) .dropdown-menu {
    left: 0;
    right: auto;
}

/* Submenu styles */
.submenu-item {
    position: relative;
}

.submenu-trigger {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    cursor: pointer;
}

.submenu-arrow {
    font-size: 0.7rem;
    transition: transform 0.2s ease;
    margin-left: 0.5rem;
}

.submenu-arrow.open {
    transform: rotate(90deg);
}

.submenu {
    background-color: #f8f9fa;
    border-radius: 8px;
    margin-top: 0.5rem;
    padding: 0.5rem 0;
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #e9ecef;
}

.submenu-item-button {
    display: block;
    width: 100%;
    padding: 0.5rem 1rem;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    font-size: 0.85rem;
    color: #6c757d;
    transition: all 0.2s ease;
}

.chat-item-content {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.chat-title {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

.chat-timestamp {
    font-size: 0.75rem;
    color: #adb5bd;
    font-weight: 400;
}

.submenu-item-button:hover {
    background-color: #e9ecef;
    color: #007bff;
}

.submenu-item-disabled {
    display: block;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    color: #adb5bd;
    font-style: italic;
}

/* Scrollbar styling for submenu */
.submenu::-webkit-scrollbar {
    width: 4px;
}

.submenu::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 2px;
}

.submenu::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 2px;
}

.submenu::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.chatbot-controls-container {
    color: white;
    padding: 16px 24px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 600;
    font-size: 16px;
    z-index: 1001;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.15);
}

.chatbot-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.chatbot-popout,
.chatbot-maximise,
.chatbot-close {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 4px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.chatbot-close {
    font-size: 20px;
    font-weight: bold;
}

.chatbot-popout:hover,
.chatbot-maximise:hover,
.chatbot-close:hover {
    background-color: rgba(255,255,255,0.1);
}

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: linear-gradient(170deg, #12003e 0%, #2e0066 15%, #60008f 50%, #9c3874 75%, #5f88db 100%);
    color: white;
    border-bottom: none;
    box-shadow: 0 4px 12px rgba(18, 0, 62, 0.15);
    position: sticky;
    top: 0;
    z-index: 100;
}

.app-header h1 span {
    font-size: 1.0rem;
    vertical-align: text-top;
}

/* Mobile responsive header */
@media (max-width: 768px) {
    .app-header {
        padding: 0.75rem 1rem;
    }
}

@media (max-width: 480px) {
    .app-header {
        padding: 0.5rem 0.75rem;
    }
}

.header-content {
    display: flex;
    width: 100%;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.app-header.embedded-header .header-content {
    justify-content: flex-start;
}

.app-header.embedded-header h1 {
    font-size: 1.5rem;
    margin-left: 10px;
    padding-left: 0;
}

.header-title {
    flex-grow: 1;
    display: flex;
    align-items: center;
    gap: 0rem;
}

.logo-container {
    height: 48px;
    display: flex;
    align-items: center;
}
.embedded-mode .logo-container {
    min-width: 32px;
    height: 48px;
    width: unset;
    display: flex;
    align-items: center;
}
.header-logo {
    height: 2.5rem;
    width: auto;
    flex-shrink: 0;
    display: block;
    object-fit: contain;
}

.header-title h1 {
    padding-left: 6px;
    margin: 0;
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.025em;
}

/* Responsive title sizing */
@media (max-width: 768px) {
    .header-title {
        gap: 0.75rem;
    }
    
    .header-logo {
        height: 2rem;
    }
    
    .header-title h1 {
        padding-left: 0;
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .app-header.embedded-header h1 {
        font-size: 1.0rem;
        padding-left: 0;
        margin-left: 0;
    }

    .app-header.embedded-header h1 span {
        font-size: 0.7rem;
        vertical-align: text-top;
    }

    .header-title {
        gap: 0.25rem;
    }
    
    .logo-container {
        width: auto;
        min-width: 20px;
    }
    .embedded-mode .logo-container {
        width: auto;
        min-width: 32px;
    }
    
    .header-logo {
        height: 1.5rem;
    }
    
    .header-title h1 {
        font-size: 1.25rem;
        padding-left: 0;
        margin: 0;
    }
}

.model-indicator {
    margin-left: 1rem;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.model-tooltip-trigger {
    cursor: help;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.75rem;
    margin-left: 0.25rem;
    white-space: pre-line;
}

.model-tooltip-trigger:hover {
    color: white;
}

/* Mobile responsive model indicator */
@media (max-width: 768px) {
    .model-indicator {
        margin-left: 0.5rem;
        font-size: 0.75rem;
    }
    
    .model-tooltip-trigger {
        font-size: 0.7rem;
    }
}

@media (max-width: 480px) {
    .model-indicator {
        margin-left: 0.25rem;
        font-size: 0.7rem;
    }
    
    .model-tooltip-trigger {
        font-size: 0.65rem;
    }
}

/* Embedded mode specific adjustments */
.embedded-header .header-title {
    text-align: left;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    margin: 0;
    padding: 0;
    height: 100vh; /* Fallback to vh for browsers that dont support it */
    height: 100dvh;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: #212529;
    line-height: 1.6;
    font-size: 16px; /* Set consistent base font size */
    overflow-x: hidden; /* Prevent horizontal scrolling */
}

.App {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    width: 100vw;
    overflow-x: hidden;
}

/* Embedded mode styling */
body.embedded-mode {
    background-color: #ffffff;
    overflow: hidden;
}

body.embedded-mode .App {
    height: 100vh;
}

body.embedded-mode #chat-container {
    margin: 0;
    height: calc(100vh - 60px); /* Account for header height */
    max-width: none;
    width: 100%;
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: 10px;
    box-sizing: border-box;
}

