/* Primary background color for alerts and highlights */
.theme-green-bg {
    background-color: #28a745;
    color: #fff;
    font-family: 'Nunito', sans-serif;
}

/* Attachment indicator in user messages */
.attachment-indicator {
    display: inline-block;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 0.25rem;
    cursor: pointer;
    transition: background-color 0.2s;
    white-space: pre-line;
}

.attachment-indicator:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

/* Dark mode support for attachment indicator */
body.dark-mode .attachment-indicator {
    background-color: rgba(255, 255, 255, 0.15);
}

body.dark-mode .attachment-indicator:hover {
    background-color: rgba(255, 255, 255, 0.25);
}
/* Legacy class name maintained for compatibility */
.burnt-orange-bg {
    background-color: #28a745;
    color: #fff;
    font-family: 'Nunito', sans-serif;
}
/* Left panel for previous sessions */
.chatbot-sessions-panel {
    background: #f8f9fa;
    border-right: 1px solid #e9ecef;
    min-width: 220px;
    max-width: 500px;
    height: 100%;
    min-height: 0;
    font-family: 'Open Sans', sans-serif;
    margin-left: 1px; /* small consistent gap from nav */
}
.chatbot-sessions-card {
    height: 100%;
    min-height: 0;
    border-radius: 0;
    border-right: none;
}
.chatbot-sessions-list {
    min-height: 0;
    height: 100%;
    overflow-y: auto;
}
.chatbot-session-item {
    cursor: pointer;
    border: none;
    border-radius: 0;
    text-align: left;
    background: none;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    width: 98%;
    max-width: 100%;
    font-size: 0.80rem;
    font-weight: normal;
    color: #343a40;
    font-family: 'Roboto', sans-serif;
}
.chatbot-session-item.active, .chatbot-session-item:active, .chatbot-session-item:focus {
    background: #6b7680; /* Darker background for improved contrast */
    color: #fff; /* Ensure text is readable */
    font-weight: normal;
}
/* Main container styles */
.chatbot-container {
    height: calc(100vh - 3.5rem);
}

.chatbot-row {
    height: 100%;
    min-height: 0;
    justify-content: flex-start; /* ensure left docking */
}

.chatbot-col {
    height: 100%;
    min-height: 0;
}

.chatbot-card {
    height: 100%;
    min-height: 0;
}

.chatbot-alert {
    border-radius: 0;
}

.chatbot-card-body {
    min-height: 0;
    overflow: hidden;
}

.chat-container {
    scroll-behavior: smooth;
    overflow-y: auto;
    border: 1px solid #e9ecef;
    border-radius: 0.375rem;
    padding: 1rem;
    background-color: #f8f9fa;
    min-height: 0;
    height: 100%;
    padding-bottom: 80px;
    font-family: 'Open Sans', sans-serif;
}

.message {
    animation: fadeIn 0.3s ease-in;
}

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

.typing-indicator {
    display: inline-block;
}

.typing-indicator span {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #999;
    margin: 0 1px;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-indicator span:nth-child(2) {
    animation-delay: -0.16s;
}

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

/* Empty state styling */
.empty-chat-state {
    padding: 2rem 0;
}

/* Message styling */
.user-message {
    word-wrap: break-word;
    max-width: 80%;
    font-family: 'Lato', sans-serif;
}

.bot-message {
    word-wrap: break-word;
    font-size: 80%;
    max-width: 80%;
    font-family: 'Source Sans Pro', sans-serif;
}

/* Feedback styling */
.feedback-thumbs-up-active {
    color: #28a745 !important;
}

.feedback-thumbs-down-active {
    color: #dc3545 !important;
}

.feedback-thumbs-inactive {
    color: #6c757d !important;
}

.feedback-suggestion-input {
    max-width: 300px;
}

/* Submitted suggestion styling */
.feedback-suggestion-display {
    background-color: #28a745; /* Primary green color */
    color: white;
    border-radius: 0.25rem;
    padding: 0.5rem 0.75rem;
    margin-top: 0.5rem;
    font-size: 0.9rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'Nunito', sans-serif;
}

.feedback-suggestion-display .suggestion-text {
    flex-grow: 1;
    margin-right: 0.5rem;
}

.feedback-suggestion-display .edit-btn {
    color: white;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.feedback-suggestion-display .edit-btn:hover {
    opacity: 1;
}

/* Chat input form styling */
.chat-input-form {
    background: #fff;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.05);
    padding: 1rem;
    border-top: 1px solid #dee2e6;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10;
}

.chat-input-textarea {
    overflow: hidden;
    resize: none;
    min-height: 48px;
    max-height: 200px;
}

/* Feedback buttons styling */
.feedback-buttons {
    margin-top: 0.5rem;
    margin-left: 0.5rem;
}

.feedback-buttons .btn {
    border: none;
    background: none;
    padding: 0.25rem;
    margin-right: 0.5rem;
    transition: opacity 0.2s ease;
}

.feedback-buttons .btn:hover:not(:disabled) {
    opacity: 0.7;
}

.feedback-buttons .btn:disabled {
    cursor: not-allowed;
}

.feedback-buttons i {
    font-size: 1.1rem;
}

.feedback-suggestion {
    width: 80%;
    max-width: 80%;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.feedback-suggestion input,
.feedback-suggestion .form-control {
    flex: 1 1 0%;
    min-width: 0;
    font-size: 0.9rem;
    width: 100%;
    max-width: none;
}

.theme-green-bg {
    background-color: #28a745 !important;
    color: #fff !important;
    font-family: 'Nunito', sans-serif;
}

/* Legacy class name maintained for compatibility */
.burnt-orange-bg {
    background-color: #28a745 !important;
    color: #fff !important;
    font-family: 'Nunito', sans-serif;
}

/* Responsive: hide Previous Chats panel and expand chat area on small screens */
@media (max-width: 768px) {
  .chatbot-sessions-panel {
    display: none !important;
  }
  .chatbot-col {
    flex: 1 1 100%;
    max-width: 100%;
  }
  .chatbot-row {
    flex-direction: column;
  }
}

body.dark-mode .chatbot-sessions-panel {
    background: #111827;
    border-right: 1px solid #1f2937;
}

body.dark-mode .chatbot-session-item {
    color: #e5e7eb;
}

body.dark-mode .chatbot-session-item.active,
body.dark-mode .chatbot-session-item:active,
body.dark-mode .chatbot-session-item:focus {
    background: #2563eb;
    color: #ffffff;
}

body.dark-mode .chat-container {
    background-color: #111827;
    border-color: #1f2937;
}

body.dark-mode .chat-input-form {
    background: #0f172a;
    border-top: 1px solid #1f2937;
    box-shadow: 0 -2px 12px rgba(15, 23, 42, 0.6);
}

body.dark-mode .user-message {
    background-color: #2563eb;
}

body.dark-mode .bot-message {
    background-color: #1f2937 !important;
    border-color: #374151 !important;
    color: #e5e7eb !important;
}

/* Override Bootstrap's bg-light in dark mode for bot messages */
body.dark-mode .bot-message.bg-light {
    background-color: #1f2937 !important;
}

/* Style tables in bot messages for dark mode */
body.dark-mode .bot-message table {
    color: #e5e7eb;
    border-color: #374151;
}

body.dark-mode .bot-message table th,
body.dark-mode .bot-message table td {
    border-color: #374151;
}

body.dark-mode .bot-message table thead th {
    background-color: #374151;
    color: #f3f4f6;
}

/* Style code blocks in bot messages for dark mode */
body.dark-mode .bot-message code {
    background-color: #111827;
    color: #10b981;
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
}

body.dark-mode .bot-message pre {
    background-color: #111827;
    border: 1px solid #374151;
    color: #e5e7eb;
    padding: 0.75rem;
    border-radius: 0.375rem;
}

body.dark-mode .bot-message pre code {
    background-color: transparent;
    padding: 0;
}

/* Style links in bot messages for dark mode */
body.dark-mode .bot-message a {
    color: #60a5fa;
}

body.dark-mode .bot-message a:hover {
    color: #93c5fd;
}

body.dark-mode .feedback-suggestion-display {
    background-color: #2563eb;
}

/* Dark mode typing indicator */
body.dark-mode .typing-indicator span {
    background-color: #9ca3af;
}

/* Dark mode streaming response */
body.dark-mode .streaming-response {
    color: #e5e7eb;
}

/* Card and alert styles moved to common-shared.css */

/* Prevent Previous Chats from stacking above chat area between 768px and 995px */
@media (max-width: 995px) and (min-width: 769px) {
  .chatbot-row {
    flex-direction: row !important;
  }
  .chatbot-sessions-panel {
    flex: 0 0 120px;
    max-width: 120px;
    min-width: 80px;
  }
  .chatbot-col {
    flex: 1 1 0;
    max-width: calc(100% - 120px);
  }
}

/* Prompt Suggestions Dropdown */
.prompt-suggestions-dropdown {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #dee2e6;
    border-bottom: none;
    border-radius: 0.375rem 0.375rem 0 0;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
    max-height: 400px;
    overflow: hidden;
    z-index: 1050;
    margin-bottom: 0;
    font-family: 'Open Sans', sans-serif;
}

/* Read-only prompt indicator */

.prompt-readonly {
    border-left: 4px solid #ffc107; /* Gold accent for visibility */
    opacity: 0.95;
}

body.dark-mode .prompt-readonly {
    border-left: 4px solid #ffd700;
    opacity: 0.95;
}

.prompt-suggestions-header {
    padding: 0.5rem 1rem;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.prompt-suggestions-list {
    max-height: 360px;
    overflow-y: auto;
}

.prompt-suggestion-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid #e9ecef;
    transition: background-color 0.15s ease;
}

.prompt-suggestion-item:hover,
.prompt-suggestion-item.selected {
    background-color: #e7f5ff;
}

.prompt-suggestion-item:last-child {
    border-bottom: none;
}

.prompt-title {
    display: flex;
    align-items: center;
    font-size: 0.95rem;
    color: #212529;
    margin-bottom: 0.25rem;
}

.prompt-title i {
    color: #6c757d;
}

.prompt-preview {
    font-size: 0.85rem;
    color: #6c757d;
    margin-left: 1.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Dark mode for prompt suggestions */
body.dark-mode .prompt-suggestions-dropdown {
    background: #1e293b;
    border-color: #334155;
}

body.dark-mode .prompt-suggestions-header {
    background: #0f172a;
    border-color: #334155;
}

body.dark-mode .prompt-suggestion-item {
    border-color: #334155;
}

body.dark-mode .prompt-suggestion-item:hover,
body.dark-mode .prompt-suggestion-item.selected {
    background-color: #1e3a5f;
}

body.dark-mode .prompt-title {
    color: #e5e7eb;
}

body.dark-mode .prompt-preview {
    color: #9ca3af;
}

body.dark-mode .prompt-title i {
    color: #9ca3af;
}

/* Override Bootstrap's bg-light in dark mode for general use */
body.dark-mode .bg-light {
    background-color: #1f2937 !important;
    color: #e5e7eb !important;
    border-color: #374151 !important;
}

body.dark-mode .bg-light h1,
body.dark-mode .bg-light h2,
body.dark-mode .bg-light h3,
body.dark-mode .bg-light h4,
body.dark-mode .bg-light h5,
body.dark-mode .bg-light h6 {
    color: #f3f4f6;
}

body.dark-mode .bg-light p,
body.dark-mode .bg-light li,
body.dark-mode .bg-light span {
    color: #e5e7eb;
}

body.dark-mode .bg-light code {
    background-color: #111827;
    color: #10b981;
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
}

body.dark-mode .bg-light pre {
    background-color: #111827;
    border: 1px solid #374151;
    color: #e5e7eb;
    padding: 0.75rem;
    border-radius: 0.375rem;
}

body.dark-mode .bg-light pre code {
    background-color: transparent;
    padding: 0;
}

body.dark-mode .bg-light a {
    color: #60a5fa;
}

body.dark-mode .bg-light a:hover {
    color: #93c5fd;
}

body.dark-mode .bg-light blockquote {
    border-left-color: #374151;
    color: #9ca3af;
}

body.dark-mode .bg-light table {
    color: #e5e7eb;
    border-color: #374151;
}

body.dark-mode .bg-light table th,
body.dark-mode .bg-light table td {
    border-color: #374151;
}

body.dark-mode .bg-light table thead th {
    background-color: #374151;
    color: #f3f4f6;
}

body.dark-mode .bg-light hr {
    border-color: #374151;
    opacity: 0.5;
}

/* File Attachment Styles */
.attachments-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: 0.375rem;
}

.attachment-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    max-width: 300px;
}

.attachment-thumbnail {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 0.25rem;
    flex-shrink: 0;
}

.attachment-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.attachment-name {
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.attachment-size {
    font-size: 0.75rem;
    color: #6c757d;
}

.attachment-remove {
    padding: 0.25rem 0.5rem;
    color: #dc3545;
    flex-shrink: 0;
}

.attachment-remove:hover {
    color: #bd2130;
}

/* Drop Zone Overlay */
.drop-zone-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(40, 167, 69, 0.1);
    border: 3px dashed #28a745;
    border-radius: 0.375rem;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    pointer-events: none;
}

.drop-zone-content {
    text-align: center;
    color: #28a745;
}

.drop-zone-content p {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

/* Dark Mode Attachment Styles */
body.dark-mode .attachments-preview {
    background: #374151;
}

body.dark-mode .attachment-item {
    background: #1f2937;
    border-color: #4b5563;
}

body.dark-mode .attachment-size {
    color: #9ca3af;
}

body.dark-mode .drop-zone-overlay {
    background: rgba(40, 167, 69, 0.15);
}

body.dark-mode .drop-zone-content {
    color: #34d399;
}

body.dark-mode .attachment-name {
    color: #e5e7eb;
}

body.dark-mode .attachment-remove {
    color: #f87171;
}

body.dark-mode .attachment-remove:hover {
    color: #ef4444;
}

