/* ==========================================================================
   SECURITY ASSESSMENT COMPONENT
   ========================================================================== */

/* Progress bar heights */
.progress-thin {
    height: 4px;
}

.progress-medium {
    height: 6px;
}

.progress-thick {
    height: 8px;
}

/* Security assessment specific styles */
.security-assessment-progress {
    height: 4px;
}

.security-assessment-progress-medium {
    height: 6px;
}

.security-assessment-progress-thick {
    height: 8px;
}

/* Dynamic progress bar widths - these will be applied via JavaScript */
.progress-width-0 { width: 0%; }
.progress-width-1 { width: 1%; }
.progress-width-2 { width: 2%; }
.progress-width-3 { width: 3%; }
.progress-width-4 { width: 4%; }
.progress-width-5 { width: 5%; }
.progress-width-6 { width: 6%; }
.progress-width-7 { width: 7%; }
.progress-width-8 { width: 8%; }
.progress-width-9 { width: 9%; }
.progress-width-10 { width: 10%; }
.progress-width-11 { width: 11%; }
.progress-width-12 { width: 12%; }
.progress-width-13 { width: 13%; }
.progress-width-14 { width: 14%; }
.progress-width-15 { width: 15%; }
.progress-width-16 { width: 16%; }
.progress-width-17 { width: 17%; }
.progress-width-18 { width: 18%; }
.progress-width-19 { width: 19%; }
.progress-width-20 { width: 20%; }
.progress-width-21 { width: 21%; }
.progress-width-22 { width: 22%; }
.progress-width-23 { width: 23%; }
.progress-width-24 { width: 24%; }
.progress-width-25 { width: 25%; }
.progress-width-26 { width: 26%; }
.progress-width-27 { width: 27%; }
.progress-width-28 { width: 28%; }
.progress-width-29 { width: 29%; }
.progress-width-30 { width: 30%; }
.progress-width-31 { width: 31%; }
.progress-width-32 { width: 32%; }
.progress-width-33 { width: 33%; }
.progress-width-34 { width: 34%; }
.progress-width-35 { width: 35%; }
.progress-width-36 { width: 36%; }
.progress-width-37 { width: 37%; }
.progress-width-38 { width: 38%; }
.progress-width-39 { width: 39%; }
.progress-width-40 { width: 40%; }
.progress-width-41 { width: 41%; }
.progress-width-42 { width: 42%; }
.progress-width-43 { width: 43%; }
.progress-width-44 { width: 44%; }
.progress-width-45 { width: 45%; }
.progress-width-46 { width: 46%; }
.progress-width-47 { width: 47%; }
.progress-width-48 { width: 48%; }
.progress-width-49 { width: 49%; }
.progress-width-50 { width: 50%; }
.progress-width-51 { width: 51%; }
.progress-width-52 { width: 52%; }
.progress-width-53 { width: 53%; }
.progress-width-54 { width: 54%; }
.progress-width-55 { width: 55%; }
.progress-width-56 { width: 56%; }
.progress-width-57 { width: 57%; }
.progress-width-58 { width: 58%; }
.progress-width-59 { width: 59%; }
.progress-width-60 { width: 60%; }
.progress-width-61 { width: 61%; }
.progress-width-62 { width: 62%; }
.progress-width-63 { width: 63%; }
.progress-width-64 { width: 64%; }
.progress-width-65 { width: 65%; }
.progress-width-66 { width: 66%; }
.progress-width-67 { width: 67%; }
.progress-width-68 { width: 68%; }
.progress-width-69 { width: 69%; }
.progress-width-70 { width: 70%; }
.progress-width-71 { width: 71%; }
.progress-width-72 { width: 72%; }
.progress-width-73 { width: 73%; }
.progress-width-74 { width: 74%; }
.progress-width-75 { width: 75%; }
.progress-width-76 { width: 76%; }
.progress-width-77 { width: 77%; }
.progress-width-78 { width: 78%; }
.progress-width-79 { width: 79%; }
.progress-width-80 { width: 80%; }
.progress-width-81 { width: 81%; }
.progress-width-82 { width: 82%; }
.progress-width-83 { width: 83%; }
.progress-width-84 { width: 84%; }
.progress-width-85 { width: 85%; }
.progress-width-86 { width: 86%; }
.progress-width-87 { width: 87%; }
.progress-width-88 { width: 88%; }
.progress-width-89 { width: 89%; }
.progress-width-90 { width: 90%; }
.progress-width-91 { width: 91%; }
.progress-width-92 { width: 92%; }
.progress-width-93 { width: 93%; }
.progress-width-94 { width: 94%; }
.progress-width-95 { width: 95%; }
.progress-width-96 { width: 96%; }
.progress-width-97 { width: 97%; }
.progress-width-98 { width: 98%; }
.progress-width-99 { width: 99%; }
.progress-width-100 { width: 100%; }

/* Assessment summary card */
.assessment-summary-card {
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
    border: 1px solid var(--bs-border-color);
}

/* Test score cards */
.test-score-card {
    height: 100%;
}

.test-score-progress {
    height: 4px;
}

/* Multi-site assessment cards */
.multi-site-card {
    height: 100%;
}

.multi-site-progress {
    height: 6px;
}

/* ==========================================================================
   GLOBAL STYLES
   ========================================================================== */

/* Ensure body uses the defined background and text color */
body {
  background-color: var(--bs-body-bg);
  color: var(--bs-body-color);
  padding-top: 100px !important; /* Account for fixed navbar - override style.css */
  overflow-x: hidden; /* Prevent horizontal scrolling */
  max-width: 100vw; /* Prevent page from stretching beyond viewport */
}

/* Ensure html element doesn't stretch */
html {
  overflow-x: hidden; /* Prevent horizontal scrolling */
  max-width: 100vw; /* Prevent page from stretching beyond viewport */
}

/* Theme transition for smooth switching */
* {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Theme toggle button styling */
#themeToggle {
    transition: all 0.3s ease;
}

#themeToggle:hover {
    transform: scale(1.05);
}

/* Email verification icon styling */
.email-verification-icon {
    font-size: 3rem;
    color: var(--bs-success);
}

/* ==========================================================================
   LAYOUT COMPONENTS
   ========================================================================== */

/* Footer theming - automatically adapts to theme */
.footer-theme {
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
    border-top: 1px solid var(--bs-border-color);
}

/* Light theme footer (default) */
.footer-theme {
    background-color: #f8f9fa;
    color: #212529;
    border-top: 1px solid #dee2e6;
}

/* Dark theme footer */
[data-bs-theme="dark"] .footer-theme {
    background-color: #212529;
    color: #f8f9fa;
    border-top: 1px solid #495057;
}

/* Footer logo theming */
.footer-logo {
    content: url('/images/OCINT-Logo-Main.svg');
    height: 30px;
    width: auto;
    max-width: 120px;
}

[data-bs-theme="dark"] .footer-logo {
    content: url('/images/OCINT-Logo-White.svg');
    height: 30px;
    width: auto;
    max-width: 120px;
}

/* ContentWrapper main content area */
.content-wrapper-main {
/*    margin-top: 76px; */
    min-height: calc(100vh - 76px - 200px);
}

.login-container {
    min-height: calc(100vh - 56px - 72px); /* Full height minus navbar and footer */
    display: flex;
    align-items: center;
}

/* Class to add padding for the fixed-bottom footer */
/*This class is no longer needed*/
/*
.content-above-footer {
    padding-bottom: 80px; 
}
*/ 

.chat-container {
    min-height: 600px;
    height: auto;
    display: flex;
    flex-direction: column;
    max-height: 80vh; /* Prevent stretching beyond viewport */
    overflow: hidden; /* Prevent content from overflowing */
}

/* ==========================================================================
   CHAT INTERFACE COMPONENT
   ========================================================================== */

/* Debug styling for chat interface */
chat-interface {
    display: block;
}

/* Chat styling - now theme-aware */
.messages-area {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    background-color: var(--bs-body-bg);
    min-height: 400px;
    max-height: 60vh; /* Reduced from 70vh to leave room for input area */
    height: 60vh; /* Reduced from 70vh to leave room for input area */
}

/* Ensure chat interface expands properly */
chat-interface {
    display: block;
    height: 100%;
}

/* Agent page specific layout */
.agent-page .chat-container {
    height: 100%;
    min-height: 600px;
    max-height: 80vh; /* Prevent stretching beyond viewport */
}

.agent-page .messages-area {
    flex: 1;
    min-height: 400px;
    max-height: 55vh; /* Reduced from 60vh to leave more room for input area */
    height: 55vh; /* Reduced from 60vh to leave more room for input area */
}

/* Ensure main content containers don't stretch */
.agent-page .container,
.agent-page .row,
.agent-page .col-md-12 {
    max-height: 100vh;
    overflow: hidden;
}

.agent-page .flex-grow-1 {
    max-height: 80vh;
    overflow: hidden;
}

/* Ensure proper flexbox behavior for chat components */
.chat-container,
.messages-area,
.watson-sidepane,
.watson-messages {
    box-sizing: border-box;
}

/* Prevent text from overflowing message bubbles */
.message,
.watson-message {
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

/* Ensure input areas don't stretch */
.chat-container .card-footer,
.watson-sidepane-footer {
    flex-shrink: 0;
}

/* Ensure input areas are always visible */
.chat-container .card-footer {
    position: relative;
    z-index: 10;
    background-color: var(--bs-body-bg);
    border-top: 1px solid var(--bs-border-color);
}

.watson-sidepane-footer {
    position: relative;
    z-index: 10;
    background-color: var(--bs-body-bg);
    border-top: 1px solid var(--bs-border-color);
}

/* Ensure proper spacing around input areas */
.chat-container .card-body {
    padding-bottom: 0; /* Remove bottom padding to prevent extra space */
}

.watson-sidepane-body {
    padding-bottom: 0; /* Remove bottom padding to prevent extra space */
}

.message {
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    max-width: 85%;
    word-wrap: break-word;
}

.message.user {
    background-color: var(--bs-primary);
    color: white;
    margin-left: auto;
    border-bottom-right-radius: 0.25rem;
}

.message.assistant {
    background-color: var(--bs-gray-100);
    color: var(--bs-body-color);
    margin-right: auto;
    border-bottom-left-radius: 0.25rem;
}

.loading-indicator {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
}

.loading-indicator .spinner-border {
    width: 1rem;
    height: 1rem;
    margin-right: 0.5rem;
}

/* Light theme specific adjustments */
[data-bs-theme="light"] .message.assistant {
    background-color: var(--bs-gray-200);
    color: var(--bs-dark);
}

/* Dark theme specific adjustments */
[data-bs-theme="dark"] .message.assistant {
    background-color: var(--bs-gray-700);
    color: var(--bs-light);
}

/* Code block styling */
.message pre {
    background-color: var(--bs-gray-100);
    border: 1px solid var(--bs-gray-300);
    border-radius: 0.25rem;
    padding: 1rem;
    margin: 0.5rem 0;
    overflow-x: auto;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
    line-height: 1.4;
}

[data-bs-theme="dark"] .message pre {
    background-color: var(--bs-gray-800);
    border-color: var(--bs-gray-600);
    color: var(--bs-light);
}

.message code {
    background-color: var(--bs-gray-100);
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
}

[data-bs-theme="dark"] .message code {
    background-color: var(--bs-gray-800);
    color: var(--bs-light);
}

/* Input area styling */
.card-footer {
    background-color: var(--bs-body-bg);
    border-top: 1px solid var(--bs-gray-300);
    padding: 1rem;
}

[data-bs-theme="dark"] .card-footer {
    background-color: var(--bs-gray-800);
    border-top-color: var(--bs-gray-600);
}

#messageInput {
    resize: none;
    border-radius: 0.375rem 0 0 0.375rem;
    border-right: none;
}

#sendBtn {
    border-radius: 0 0.375rem 0.375rem 0;
    border-left: none;
}

/* Button group styling */
.btn-group .btn {
    border-radius: 0.375rem;
    margin-left: 0.25rem;
}

.btn-group .btn:first-child {
    margin-left: 0;
}

/* Loading state */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Message content styling */
.message-content {
    line-height: 1.5;
}

/* Ensure proper spacing for formatted content */
.message p {
    margin-bottom: 0.5rem;
}

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

.message br {
    display: block;
    margin-bottom: 0.25rem;
}

/* Watson message content formatting */
.watson-message-content p {
    margin-bottom: 0.5rem;
}

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

.watson-message-content br {
    display: block;
    margin-bottom: 0.25rem;
}

/* Scrollbar styling */
.messages-area::-webkit-scrollbar {
    width: 6px;
}

.messages-area::-webkit-scrollbar-track {
    background: var(--bs-gray-200);
}

.messages-area::-webkit-scrollbar-thumb {
    background: var(--bs-gray-400);
    border-radius: 3px;
}

.messages-area::-webkit-scrollbar-thumb:hover {
    background: var(--bs-gray-500);
}

[data-bs-theme="dark"] .messages-area::-webkit-scrollbar-track {
    background: var(--bs-gray-700);
}

[data-bs-theme="dark"] .messages-area::-webkit-scrollbar-thumb {
    background: var(--bs-gray-600);
}

[data-bs-theme="dark"] .messages-area::-webkit-scrollbar-thumb:hover {
    background: var(--bs-gray-500);
}

/* Firefox scrollbar styling for main messages area */
.messages-area {
    scrollbar-width: thin;
    scrollbar-color: var(--bs-gray-400) var(--bs-gray-200);
}

[data-bs-theme="dark"] .messages-area {
    scrollbar-color: var(--bs-gray-600) var(--bs-gray-700);
}

/* ==========================================================================
   EMBEDDED DOCUMENT COMPONENT
   ========================================================================== */

/* Embedded document container */
.embedded-document-container {
    margin: 1rem 0;
    border: 1px solid var(--bs-gray-300);
    border-radius: 0.5rem;
    background-color: var(--bs-gray-50);
    overflow: hidden;
}

[data-bs-theme="dark"] .embedded-document-container {
    border-color: var(--bs-gray-600);
    background-color: var(--bs-gray-800);
}

/* Document header */
.document-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background-color: var(--bs-gray-100);
    border-bottom: 1px solid var(--bs-gray-300);
}

[data-bs-theme="dark"] .document-header {
    background-color: var(--bs-gray-700);
    border-bottom-color: var(--bs-gray-600);
}

.document-title {
    font-weight: 600;
    color: var(--bs-gray-700);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

[data-bs-theme="dark"] .document-title {
    color: var(--bs-gray-300);
}

.document-actions {
    display: flex;
    gap: 0.25rem;
}

.document-actions .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

/* Document content */
.document-content {
    padding: 1rem;
    background-color: white;
}

[data-bs-theme="dark"] .document-content {
    background-color: var(--bs-gray-900);
}

/* Raw content container */
.raw-content-container {
    padding: 1rem;
    background-color: var(--bs-gray-900);
    border-top: 1px solid var(--bs-gray-300);
}

[data-bs-theme="dark"] .raw-content-container {
    background-color: var(--bs-gray-800);
    border-top-color: var(--bs-gray-600);
}

.raw-content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--bs-gray-700);
}

[data-bs-theme="dark"] .raw-content-header {
    color: var(--bs-gray-300);
}

.raw-content {
    background-color: var(--bs-gray-100);
    border: 1px solid var(--bs-gray-300);
    border-radius: 0.25rem;
    padding: 1rem;
    margin: 0;
    overflow-x: auto;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.875rem;
    line-height: 1.4;
    color: var(--bs-gray-800);
}

[data-bs-theme="dark"] .raw-content {
    background-color: var(--bs-gray-800);
    border-color: var(--bs-gray-600);
    color: var(--bs-gray-200);
}

/* ==========================================================================
   CSV UPLOAD COMPONENT
   ========================================================================== */

/* CSV upload styling */
.csv-upload-section {
    background-color: var(--bs-gray-50);
    border: 1px solid var(--bs-gray-200);
    border-radius: 0.25rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

[data-bs-theme="dark"] .csv-upload-section {
    background-color: var(--bs-gray-900);
    border-color: var(--bs-gray-700);
}

/* File upload button styling */
.btn-outline-secondary:hover {
    background-color: var(--bs-secondary);
    border-color: var(--bs-secondary);
}

/* Alert styling for CSV status */
#csvStatus {
    margin-bottom: 0;
}

/* CSV Upload Modal Styling */
#csvUploadModal .modal-body {
    max-height: 70vh;
    overflow-y: auto;
}

#csvTextInput {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */

/* Responsive adjustments for chat interface */
@media (max-width: 768px) {
    .chat-container {
        height: 500px;
        max-height: 70vh; /* Increased from 60vh for mobile to ensure input visibility */
    }
    
    .messages-area {
        max-height: 55vh; /* Increased from 50vh to leave room for input area */
        height: 55vh;
    }
    
    .agent-page .messages-area {
        max-height: 50vh; /* Increased from 45vh to leave room for input area */
        height: 50vh;
    }
    
    .watson-sidepane {
        width: 100vw;
    }
    
    .watson-messages {
        max-height: calc(100vh - 200px); /* Adjusted for mobile */
    }
    
    .message {
        max-width: 95%;
    }
    
    .btn-group .btn {
        padding: 0.375rem 0.5rem;
        font-size: 0.875rem;
    }
}

/* About page logo styling */
.about-page-logo {
    max-width: 300px;
}

/* ==========================================================================
   OFFLINE PAGE STYLES
   ========================================================================== */

.offline-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #2C2F33 0%, #1a1d20 100%);
}

.offline-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
}

.offline-icon {
    font-size: 4rem;
    color: #CF992D;
    margin-bottom: 1rem;
}

.retry-button {
    background: #CF992D;
    border: none;
    color: white;
    padding: 0.75rem 2rem;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.retry-button:hover {
    background: #b8861f;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(207, 153, 45, 0.4);
}

.cached-content {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #eee;
}

.cached-link {
    display: inline-block;
    margin: 0.5rem;
    padding: 0.5rem 1rem;
    background: #f8f9fa;
    border-radius: 20px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
}

.cached-link:hover {
    background: #CF992D;
    color: white;
    text-decoration: none;
}

/* ==========================================================================
   WATSON AGENT SIDEPANE
   ========================================================================== */

.watson-sidepane {
  position: fixed;
  top: 0;
  right: 0;
  width: 600px;
  height: 100vh;
  background: var(--bs-body-bg);
  border-left: 1px solid var(--bs-border-color);
  box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
  z-index: 1050;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s ease-in-out;
  overflow: hidden; /* Prevent content from overflowing the sidepane */
}

.watson-sidepane.open {
  transform: translateX(0);
}

.watson-sidepane-header {
  padding: 1rem;
  border-bottom: 1px solid var(--bs-border-color);
  flex-shrink: 0;
}

.watson-sidepane-body {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0; /* Allow flex child to shrink below content size */
}

.watson-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 0; /* Allow flex child to shrink below content size */
  max-height: calc(100vh - 250px); /* Increased from 200px to leave more room for input area */
}

.watson-message {
  max-width: 85%;
  padding: 0.75rem;
  border-radius: 1rem;
  position: relative;
}

.watson-message.user {
  align-self: flex-end;
  background: var(--bs-primary);
  color: white;
  border-bottom-right-radius: 0.25rem;
}

.watson-message.assistant {
  align-self: flex-start;
  background: var(--bs-light);
  color: var(--bs-body-color);
  border-bottom-left-radius: 0.25rem;
}

[data-bs-theme="dark"] .watson-message.assistant {
  background: var(--bs-dark);
  color: var(--bs-body-color);
}

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

.watson-message-time {
  font-size: 0.75rem;
  opacity: 0.7;
  text-align: right;
}

.watson-message.user .watson-message-time {
  text-align: right;
}

.watson-message.assistant .watson-message-time {
  text-align: left;
}

.watson-sidepane-footer {
  padding: 1rem;
  border-top: 1px solid var(--bs-border-color);
  flex-shrink: 0;
}

.watson-sidepane-footer .input-group {
  gap: 0.5rem;
}

.watson-sidepane-footer textarea {
  resize: none;
  border-radius: 1.5rem;
  padding: 0.5rem 1rem;
}

.watson-sidepane-footer .btn {
  border-radius: 50%;
  width: 40px;
  height: 40px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Responsive design */
@media (max-width: 768px) {
  .watson-sidepane {
    width: 100vw;
  }
  
  .watson-message {
    max-width: 90%;
  }
}

/* Animation for messages */
.watson-message {
  animation: slideIn 0.3s ease-out;
}

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

/* Loading animation */
.watson-message.assistant .spinner-border {
  width: 1rem;
  height: 1rem;
}

/* Markdown content styling */
.message-content h1,
.message-content h2,
.message-content h3,
.message-content h4,
.message-content h5,
.message-content h6,
.watson-message-content h1,
.watson-message-content h2,
.watson-message-content h3,
.watson-message-content h4,
.watson-message-content h5,
.watson-message-content h6 {
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
    line-height: 1.25;
}

.message-content h1,
.watson-message-content h1 { font-size: 1.5rem; }
.message-content h2,
.watson-message-content h2 { font-size: 1.375rem; }
.message-content h3,
.watson-message-content h3 { font-size: 1.25rem; }
.message-content h4,
.watson-message-content h4 { font-size: 1.125rem; }
.message-content h5,
.watson-message-content h5 { font-size: 1rem; }
.message-content h6,
.watson-message-content h6 { font-size: 0.875rem; }

/* Lists */
.message-content ul,
.message-content ol,
.watson-message-content ul,
.watson-message-content ol {
    margin-bottom: 0.5rem;
    padding-left: 1.5rem;
}

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

/* Code blocks and inline code */
.message-content pre,
.watson-message-content pre {
    background-color: var(--bs-gray-100);
    border: 1px solid var(--bs-gray-300);
    border-radius: 0.25rem;
    padding: 1rem;
    margin: 0.5rem 0;
    overflow-x: auto;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
    line-height: 1.4;
}

[data-bs-theme="dark"] .message-content pre,
[data-bs-theme="dark"] .watson-message-content pre {
    background-color: var(--bs-gray-800);
    border-color: var(--bs-gray-600);
    color: var(--bs-light);
}

.message-content code,
.watson-message-content code {
    background-color: var(--bs-gray-100);
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
}

[data-bs-theme="dark"] .message-content code,
[data-bs-theme="dark"] .watson-message-content code {
    background-color: var(--bs-gray-800);
    color: var(--bs-light);
}

/* Blockquotes */
.message-content blockquote,
.watson-message-content blockquote {
    border-left: 4px solid var(--bs-primary);
    padding-left: 1rem;
    margin: 0.5rem 0;
    font-style: italic;
    color: var(--bs-gray-600);
}

[data-bs-theme="dark"] .message-content blockquote,
[data-bs-theme="dark"] .watson-message-content blockquote {
    color: var(--bs-gray-400);
}

/* Tables */
.message-content table,
.watson-message-content table {
    width: 100%;
    margin: 0.5rem 0;
    border-collapse: collapse;
}

.message-content th,
.message-content td,
.watson-message-content th,
.watson-message-content td {
    padding: 0.5rem;
    border: 1px solid var(--bs-gray-300);
    text-align: left;
}

[data-bs-theme="dark"] .message-content th,
[data-bs-theme="dark"] .message-content td,
[data-bs-theme="dark"] .watson-message-content th,
[data-bs-theme="dark"] .watson-message-content td {
    border-color: var(--bs-gray-600);
}

.message-content th,
.watson-message-content th {
    background-color: var(--bs-gray-100);
    font-weight: 600;
}

[data-bs-theme="dark"] .message-content th,
[data-bs-theme="dark"] .watson-message-content th {
    background-color: var(--bs-gray-700);
}

/* Watson message scrollbar styling */
.watson-messages::-webkit-scrollbar {
    width: 6px;
}

.watson-messages::-webkit-scrollbar-track {
    background: var(--bs-gray-200);
}

.watson-messages::-webkit-scrollbar-thumb {
    background: var(--bs-gray-400);
    border-radius: 3px;
}

.watson-messages::-webkit-scrollbar-thumb:hover {
    background: var(--bs-gray-500);
}

[data-bs-theme="dark"] .watson-messages::-webkit-scrollbar-track {
    background: var(--bs-gray-700);
}

[data-bs-theme="dark"] .watson-messages::-webkit-scrollbar-thumb {
    background: var(--bs-gray-600);
}

[data-bs-theme="dark"] .watson-messages::-webkit-scrollbar-thumb:hover {
    background: var(--bs-gray-500);
}

/* Firefox scrollbar styling */
.watson-messages {
    scrollbar-width: thin;
    scrollbar-color: var(--bs-gray-400) var(--bs-gray-200);
}

[data-bs-theme="dark"] .watson-messages {
    scrollbar-color: var(--bs-gray-600) var(--bs-gray-700);
}

/* Ensure scroll bars are always visible when needed */
.messages-area,
.watson-messages {
    scrollbar-gutter: stable; /* Reserve space for scrollbar */
}

/* Chat Interface Styles */
.chat-container {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.messages-area {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1rem;
    max-height: 400px;
}

.message {
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
}

.message.user-message {
    align-items: flex-end;
}

.message.assistant-message {
    align-items: flex-start;
}

.message.system-message {
    align-items: center;
}

.message-content {
    max-width: 80%;
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    position: relative;
}

.message.user-message .message-content {
    background-color: #007bff;
    color: white;
    border-bottom-right-radius: 0.25rem;
}

.message.assistant-message .message-content {
    background-color: #6c757d;
    color: white;
    border-bottom-left-radius: 0.25rem;
}

.message.system-message .message-content {
    background-color: #17a2b8;
    color: white;
    border-radius: 1rem;
    font-style: italic;
    font-size: 0.9rem;
}

.message-text {
    margin-bottom: 0.25rem;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.message-time {
    font-size: 0.75rem;
    opacity: 0.7;
    text-align: right;
}

.message.system-message .message-time {
    text-align: center;
}

/* Watson Agent Styles */
.watson-sidepane {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: var(--bs-body-bg);
    border-left: 1px solid var(--bs-border-color);
    transition: right 0.3s ease;
    z-index: 1050;
    display: flex;
    flex-direction: column;
}

.watson-sidepane.open {
    right: 0;
}

.watson-sidepane-header {
    padding: 1rem;
    border-bottom: 1px solid var(--bs-border-color);
    flex-shrink: 0;
}

.watson-sidepane-body {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1rem;
}

.watson-sidepane-footer {
    padding: 1rem;
    border-top: 1px solid var(--bs-border-color);
    flex-shrink: 0;
}

.watson-messages {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Session indicator styles */
.text-muted {
    color: #6c757d !important;
}

/* Loading and progress indicators */
.loading-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background-color: rgba(0, 123, 255, 0.1);
    border-radius: 0.5rem;
    border: 1px solid rgba(0, 123, 255, 0.2);
}

.progress {
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 0.25rem;
}

.progress-bar {
    background-color: #007bff;
    transition: width 0.3s ease;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .watson-sidepane {
        width: 100%;
        right: -100%;
    }
    
    .message-content {
        max-width: 90%;
    }
}

/* Dark theme adjustments */
.dark-theme .message.assistant-message .message-content {
    background-color: #495057;
}

.dark-theme .message.system-message .message-content {
    background-color: #0dcaf0;
    color: #000;
}

.dark-theme .watson-sidepane {
    background: var(--bs-dark);
    border-left-color: var(--bs-border-color);
}

/* Transparent navbar */
.navbar {
    background-color: transparent !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}