html {
    font-size: 16px;
    /* Base font size */
}

body {
    background-color: #121212;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    color: #e0e0e0;
    margin: 0;
    padding: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 100%;
    padding: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Add this to your existing style.css */
.chat-container.drag-over {
    border: 2px dashed #007bff;
    background-color: rgba(0, 123, 255, 0.1);
}

.chat-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 1px solid #444;
    border-radius: 8px;
    overflow: hidden;
    background-color: #2c2c2c;
    /* Dark background for the chat container */
    color: #f1f1f1;
    /* Light text color */
}

.chat-header {
    background-color: #2d2b55;
    color: white;
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.header-row {
    display: flex;
    justify-content: space-between;
    width: 100%;
    align-items: center;
}

.app-title {
    display: flex;
    align-items: center;
}

.app-title h3 {
    font-size: 1rem;
    margin: 0;
    margin-right: 0.625rem;
}

.version-badge {
    background-color: #6c63ff;
    color: white;
    padding: 0.125rem 0.5rem;
    border-radius: 0.625rem;
    font-size: 0.8em;
    font-weight: 500;
    cursor: pointer;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    background-color: #1e1e1e;
}

.message {
    max-width: min(72ch, 80%);
    padding: 0.625rem 1rem;
    margin-bottom: 0.625rem;
    border-radius: 1rem;
    position: relative;
}

.user-message {
    background-color: #2d2b55;
    color: #e0e0e0;
    align-self: flex-end;
    border-bottom-right-radius: 0.3125rem;
}

.ai-message {
    background-color: #333333;
    color: #e0e0e0;
    align-self: flex-start;
    border-bottom-left-radius: 0.3125rem;
}

.sender-name {
    font-weight: bold;
    margin-bottom: 5px;
    color: #a8a4ff;
}

.message.sent {
    align-self: flex-end;
    background-color: #2d2b55;
    color: #e0e0e0;
    border-bottom-right-radius: 0.3125rem;
}

.message.received {
    align-self: flex-start;
    background-color: #333333;
    color: #e0e0e0;
    border-bottom-left-radius: 0.3125rem;
}

.message-time {
    font-size: 0.7em;
    color: #aaaaaa;
    margin-top: 0.3125rem;
    text-align: right;
}

.chat-input {
    display: flex;
    flex-direction: column;
    padding: 1rem;
    border-top: 1px solid #333333;
    background-color: #252525;
}

.chat-input input {
    flex-grow: 1;
    padding: 0.625rem 1rem;
    border: 1px solid #444444;
    border-radius: 1.25rem;
    margin-right: 0.625rem;
    background-color: #333333;
    color: #e0e0e0;
}

.chat-input button {
    background-color: #6c63ff;
    color: white;
    border: none;
    border-radius: 0.875rem;
    padding: 0.375rem 1.125rem;
    height: 2.25rem;
    min-width: 3.75rem;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-input button:hover {
    background-color: #5a52d5;
}

.input-row {
    display: flex;
    align-items: center;
}

.input-area {
    position: relative;
    flex-grow: 1;
    display: flex;
    align-items: center;
}

.chat-input textarea {
    flex-grow: 1;
    width: 100%;
    padding: 0.375rem 2.75rem 0.375rem 0.75rem;
    /* right padding for icon */
    border: 1px solid #444444;
    border-radius: 0.875rem;
    background-color: #333333;
    color: #e0e0e0;
    resize: vertical;
    font-family: inherit;
    font-size: inherit;
    line-height: 1.4;
    min-height: 2rem;
    max-height: 3.75rem;
    box-sizing: border-box;
    /* allow scrolling, but hide scrollbar visually */
}

.chat-input textarea::-webkit-scrollbar {
    display: none;
    /* Hide scrollbar for WebKit browsers */
}

.chat-input textarea {
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE and Edge */
}

.send-arrow-btn {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: #6c63ff;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
    transition: background 0.2s;
    z-index: 2;
}

.send-arrow-btn:disabled {
    background: #444;
    color: #aaa;
    cursor: not-allowed;
}

.send-arrow-btn:hover:not(:disabled) {
    background: #5a52d5;
}

.auth-container {
    padding: 1rem;
    text-align: center;
    border-bottom: 1px solid #333333;
    background-color: #252525;
}

.input-group .form-control {
    background-color: #333333;
    color: #e0e0e0;
    border-color: #444444;
}

/* Add specific styling for input placeholders to make them more visible */
.input-group .form-control::placeholder {
    color: #b0b0b0;
    opacity: 1;
    /* Firefox */
    font-weight: 500;
}

/* For Internet Explorer */
.input-group .form-control:-ms-input-placeholder {
    color: #b0b0b0;
    font-weight: 500;
}

/* For Microsoft Edge */
.input-group .form-control::-ms-input-placeholder {
    color: #b0b0b0;
    font-weight: 500;
}

.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 3.125rem;
}

.dot {
    width: 0.5rem;
    height: 0.5rem;
    background-color: #6c63ff;
    border-radius: 50%;
    margin: 0 0.3125rem;
    animation: bounce 1.5s infinite ease-in-out;
}

.dot:nth-child(1) {
    animation-delay: 0s;
}

.dot:nth-child(2) {
    animation-delay: 0.2s;
}

.dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-0.625rem);
    }
}

/* Dark mode button styles */
.btn-outline-secondary {
    color: #b0b0b0;
    border-color: #555555;
}

.btn-outline-secondary:hover {
    background-color: #444444;
    color: #e0e0e0;
}

.btn-outline-danger {
    color: #ff6b6b;
    border-color: #802020;
}

.btn-outline-danger:hover {
    background-color: #802020;
    color: #ffffff;
}

.btn-primary {
    background-color: #6c63ff;
    border-color: #5a52d5;
}

.btn-primary:hover {
    background-color: #5a52d5;
}

/* Improve visibility for outline-primary buttons in dark mode */
.btn-outline-primary {
    color: #a8a4ff;
    border-color: #6c63ff;
    font-weight: 500;
}

.btn-outline-primary:hover {
    background-color: #6c63ff;
    color: white;
}

.btn-outline-success {
    color: #9eff59;
    border-color: #2d4f00;
}

.btn-outline-success:hover {
    background-color: #2d4f00;
    color: white;
}

/* System message style with higher specificity */
.ai-message.message.system-message {
    background-color: #2d4f00 !important;
    color: #9eff59 !important;
    border: 1px solid #9eff59 !important;
    font-weight: 500;
}

/* Override any other styles that might be affecting system messages */
.ai-message.message[style*="background-color"] {
    background-color: inherit !important;
}

/* Auth UI styles */
.auth-tabs {
    margin-bottom: 1rem;
}

.auth-tabs .nav-link {
    color: #b0b0b0;
    border: none;
    padding: 0.5rem 1rem;
}

.auth-tabs .nav-link.active {
    background-color: #2d2b55;
    color: white;
    border-radius: 0.3125rem;
}

.auth-form {
    width: 100%;
    max-width: 25rem;
    margin: 0 auto;
}

.user-profile {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.625rem;
}

.user-avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background-color: #6c63ff;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.chat-controls {
    margin-top: 0.625rem;
    display: flex;
    justify-content: space-between;
    width: 100%;
}

/* Password toggle button styles */
#toggle-password {
    border-top-right-radius: 1.25rem;
    border-bottom-right-radius: 1.25rem;
    background-color: #333333;
    border-color: #444444;
    color: #b0b0b0;
}

#toggle-password:hover {
    background-color: #444444;
    color: #e0e0e0;
}

.eye-icon {
    font-size: 1.2em;
    line-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- Report Button & Message Structure Enhancements --- */

.message {
    position: relative;
    /* Needed for absolute positioning of actions if desired */
    display: flex;
    flex-direction: column;
    /* Stack content and meta */
    margin-bottom: 1rem;
    /* Increased margin slightly */
    padding: 0.75rem 1.125rem;
    /* Adjusted padding */
}

.message-content {
    margin-bottom: 0.3125rem;
    /* Space between content and meta */
    word-wrap: break-word;
    /* Ensure long words break */
    overflow-wrap: anywhere;
    /* Aggressively break long tokens/URLs if needed */
    white-space: normal;
    /* Ensure we allow wrapping even for long inline spans */
}

.message-meta {
    display: flex;
    justify-content: space-between;
    /* Pushes time and actions apart */
    align-items: center;
    /* Vertically align items in meta */
    font-size: 0.75em;
    color: #aaa;
    /* Light grey for meta */
    margin-top: auto;
    /* Push meta to the bottom if content is short */
}

.user-message .message-meta {
    color: #c0c0c0;
    /* Slightly lighter grey for user message meta */
}

.message-actions {
    opacity: 0;
    /* Hide actions by default */
    transition: opacity 0.2s ease-in-out;
}

.message:hover .message-actions {
    opacity: 1;
    /* Show actions on message hover */
}

.report-button {
    background: none;
    border: none;
    color: #ff6b6b;
    /* Reddish color for report */
    cursor: pointer;
    font-size: 1em;
    /* Adjust size as needed */
    padding: 0.125rem 0.3125rem;
    margin-left: 0.3125rem;
    /* Space from timestamp */
    line-height: 1;
    /* Prevent extra spacing */
    transition: transform 0.1s ease;
}

.report-button:hover {
    transform: scale(1.1);
    color: #ff4747;
    /* Brighter red on hover */
}

.report-button:disabled {
    color: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* Reported Message Style */
.message.reported-message {
    background-color: #5e1e1e !important;
    /* Dark red background */
    border-color: #ff6b6b !important;
    /* Reddish border */
}

.message.reported-message .message-meta {
    color: #ffc1c1;
    /* Lighter color for meta text on dark background */
}

/* Ensure system messages don't get hover effects for actions */
.system-message:hover .message-actions {
    opacity: 0;
}

.system-message .message-actions {
    display: none;
    /* Completely remove actions for system messages */
}

/* --- Custom Modal Styling to Match Chat UI --- */
#suggestionModal .modal-content {
    background-color: #252525;
    color: #e0e0e0;
    border-radius: 1rem;
    border: 1px solid #333333;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}

#suggestionModal .modal-header {
    background-color: #2d2b55;
    color: #fff;
    border-bottom: 1px solid #333333;
    border-top-left-radius: 1rem;
    border-top-right-radius: 1rem;
}

#suggestionModal .modal-title {
    color: #fff;
    font-weight: 600;
}

#suggestionModal .modal-body textarea {
    background-color: #333333;
    color: #e0e0e0;
    border: 1px solid #444444;
    border-radius: 0.625rem;
    font-size: 1rem;
    min-height: 5rem;
    resize: vertical;
}

#suggestionModal .modal-footer {
    background: #252525;
    border-top: 1px solid #333333;
    border-bottom-left-radius: 1rem;
    border-bottom-right-radius: 1rem;
}

#suggestionModal .btn-primary {
    background-color: #6c63ff;
    border-color: #5a52d5;
}

#suggestionModal .btn-primary:hover {
    background-color: #5a52d5;
}

#suggestionModal .btn-secondary {
    background-color: #333333;
    color: #e0e0e0;
    border: 1px solid #444444;
}

#suggestionModal .btn-secondary:hover {
    background-color: #444444;
    color: #fff;
}

#suggestionModal .btn-close {
    filter: invert(1) grayscale(1);
}

/* Make the suggestion modal textarea placeholder white and more visible */
#suggestionModal .modal-body textarea::placeholder {
    color: #fff !important;
    opacity: 1 !important;
}

.participant-list {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
    background-color: #252525;
    border-bottom: 1px solid #333333;
}

.participant-list .participants-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.participant-list #copy-link-button {
    margin-left: auto;
    white-space: nowrap;
}

.participant {
    background-color: #6c63ff;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    margin-right: 0.5rem;
    font-size: 0.9em;
}

.participant {
    display: flex;
    align-items: center;
}

.remove-participant-btn {
    margin-left: 8px;
    cursor: pointer;
    font-weight: bold;
    color: #e0e0e0;
    display: none;
    /* Hidden by default */
}

.participant:hover .remove-participant-btn {
    display: inline-block;
    /* Show on hover */
}

/* --- Responsive Design --- */

/* For tablets and larger phones */
@media (max-width: 768px) {
    html {
        font-size: 14px;
        /* Decrease base font size */
    }

    .chat-container {
        border-radius: 0;
    }
}

/* For smaller mobile phones */
@media (max-width: 480px) {
    html {
        font-size: 13px;
        /* Further decrease base font size */
    }

    .chat-header {
        padding: 0.75rem 1rem;
    }

    .chat-messages {
        padding: 1rem;
    }

    .message {
        max-width: 90%;
    }

    .chat-input {
        padding: 0.75rem;
    }

    .chat-controls {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    #conversation-id {
        display: none;
    }

    #new-conversation {
        font-size: 0;
        /* Hide text content */
    }

    #new-conversation::before {
        content: "New";
        /* Show shorter text */
        font-size: 1rem;
        /* Set font size back to normal */
    }
}

/* --- Add User Modal Dark Theme --- */
#addUserModal .modal-content {
    background-color: #252525;
    color: #e0e0e0;
    border-radius: 1rem;
    border: 1px solid #333333;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}

#addUserModal .modal-header {
    background-color: #2d2b55;
    color: #fff;
    border-bottom: 1px solid #333333;
    border-top-left-radius: 1rem;
    border-top-right-radius: 1rem;
}

#addUserModal .modal-title {
    color: #fff;
    font-weight: 600;
}

#addUserModal .modal-body {
    background: #252525;
}

#addUserModal #user-search-input {
    background-color: #333333;
    color: #e0e0e0;
    border: 1px solid #444444;
}

#addUserModal #user-search-results .list-group-item {
    background-color: #333333;
    color: #e0e0e0;
    border-color: #444444;
    cursor: pointer;
}

#addUserModal #user-search-results .list-group-item:hover {
    background-color: #444444;
}

#addUserModal #user-search-results .list-group-item.active {
    background-color: #2d2b55;
    color: white;
}

#addUserModal .modal-footer {
    background: #252525;
    border-top: 1px solid #333333;
    border-bottom-left-radius: 1rem;
    border-bottom-right-radius: 1rem;
}

#addUserModal .btn-primary {
    background-color: #6c63ff;
    border-color: #5a52d5;
}

#addUserModal .btn-primary:hover {
    background-color: #5a52d5;
}

#addUserModal .btn-secondary {
    background-color: #333333;
    color: #e0e0e0;
    border: 1px solid #444444;
}

#addUserModal .btn-secondary:hover {
    background-color: #444444;
    color: #fff;
}

#addUserModal .btn-close {
    filter: invert(1) grayscale(1);
}

#addUserModal #user-search-input::placeholder {
    color: #b0b0b0;
    opacity: 1;
}

.input-group {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    width: 100%;
}

#user-search-loader {
    margin-top: 10px;
}

/* Styling for the image upload button */
#attachment-button {
    margin-left: 10px;
    height: 40px;
    width: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

#attachment-button:hover {
    background: #5a52d5;
}

/* Container for image previews */
.image-preview-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.image-preview-container:not(:empty) {
    margin-bottom: 10px;
}

/* Individual image preview */
.image-preview {
    position: relative;
    width: 80px;
    height: 80px;
}

.preview-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.remove-image-btn {
    position: absolute;
    top: -5px;
    right: -5px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 14px;
    line-height: 20px;
    text-align: center;
    cursor: pointer;
}

.file-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
    color: #ccc;
}

.file-name {
    position: absolute;
    bottom: 5px;
    left: 5px;
    right: 5px;
    text-align: center;
    font-size: 12px;
    color: #ccc;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- Image Thumbnails in Chat --- */
.image-thumbnails {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.chat-thumbnail {
    width: 100px;
    height: 100px;
    border-radius: 8px;
    object-fit: cover;
    cursor: pointer;
    border: 1px solid #444;
}

.file-thumbnail {
    width: 100px;
    height: 100px;
    border-radius: 8px;
    border: 1px solid #444;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #2c2c2c;
}

.file-thumbnail a {
    color: #ccc;
}

/* --- Image Preview Modal --- */
#imagePreviewModal .modal-content {
    background-color: #2c2c2c;
    color: #f1f1f1;
    border: 1px solid #444;
}

#imagePreviewModal .modal-header {
    background-color: #2d2b55;
    color: white;
    border-bottom: 1px solid #444;
}

#imagePreviewModal .btn-close {
    filter: invert(1) grayscale(1);
}

#modalImage {
    max-height: 80vh;
}

.main-chat-area {
    display: flex;
    height: 100vh;
    width: 100%;
    overflow: hidden;
}

.sidebar {
    width: 300px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #444;
    background-color: #252525;
    min-height: 0;
    height: 100%;
}

.sidebar-header {
    padding: 1rem;
    border-bottom: 1px solid #444;
}

.conversation-list {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    min-height: 0;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    background-color: #1e1e1e;
    min-height: 0;
    min-width: 0;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid #444;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.chat-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    min-width: 0;
}

.conversation-item {
    padding: 1rem;
    border: 1px solid #444;
    border-radius: 8px;
    margin-bottom: 1rem;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
}

.conversation-item:hover {
    background-color: #333;
    border-color: #6c63ff;
}

.conversation-title {
    font-weight: bold;
    color: #e0e0e0;
    margin-bottom: 0.25rem;
}

.conversation-timestamp {
    font-size: 0.8em;
    color: #888;
    margin-top: 0.5rem;
}

.sidebar-filter {
    padding: 1rem;
    border-bottom: 1px solid #444;
}

.conversation-summary {
    font-size: 0.9em;
    color: #aaa;
}

/* --- Answer Recommendations --- */
.recommendations-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.5rem 1.25rem;
    background-color: #1e1e1e;
}

.recommendation-button {
    background-color: #3a3a3a;
    color: #e0e0e0;
    border: 1px solid #555;
    border-radius: 1rem;
    padding: 0.375rem 0.875rem;
    cursor: pointer;
    font-size: 0.875em;
    transition: background-color 0.2s, border-color 0.2s;
}

.recommendation-button:hover {
    background-color: #4a4a4a;
    border-color: #6c63ff;
}

/* Ephemeral Thinking Bubble */
.thinking-bubble {
    background-color: #263238;
    /* dark slate */
    color: #b2ebf2;
    /* cyan-200 */
    border: 1px dashed #80deea;
    /* cyan-300 dashed */
    /* Fix width to avoid jitter as content streams */
    width: clamp(36ch, 60ch, 80%);
    box-sizing: border-box;
}

.thinking-bubble .thinking-header {
    font-weight: 600;
    margin-bottom: 0;
    color: #80deea;
}

.thinking-bubble .thinking-text {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    white-space: normal;
    word-break: break-word;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

/* Collapsed state: clamp thinking text to 3 lines with ellipsis */
.thinking-bubble.collapsed .thinking-text {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    /* fallback based on current line-height */
    max-height: calc(1.35em * 3);
}

/* Toggle control for showing/hiding thinking content */
.thinking-toggle {
    margin-top: 4px;
}

.thinking-toggle button {
    background: none;
    border: none;
    color: #80deea;
    /* matches cyan palette used in bubble */
    font-weight: 600;
    padding: 0;
    text-decoration: underline;
    cursor: pointer;
}

.thinking-toggle button:hover {
    color: #b2ebf2;
}

.thinking-toggle button:focus {
    outline: none;
    text-decoration: none;
    border-bottom: 1px dotted #b2ebf2;
}

/* --- Message Details Modal Dark Theme --- */
#messageDetailsModal .modal-content {
    background-color: #252525;
    color: #e0e0e0;
    border-radius: 1rem;
    border: 1px solid #333333;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}

#messageDetailsModal .modal-header {
    background-color: #2d2b55;
    color: #fff;
    border-bottom: 1px solid #333333;
    border-top-left-radius: 1rem;
    border-top-right-radius: 1rem;
}

#messageDetailsModal .modal-title {
    color: #fff;
    font-weight: 600;
}

#messageDetailsModal .btn-close {
    filter: invert(1) grayscale(1);
}

#messageDetailsModal .modal-body {
    background: #252525;
}

#messageDetailsModal #message-json-viewer {
    min-height: 300px;
}

/* --- JSONEditor Dark Theme within Modal --- */
#messageDetailsModal .jsoneditor {
    background-color: #1e1e1e;
    color: #e0e0e0;
    border: 1px solid #444;
    border-radius: 8px;
}

#messageDetailsModal .jsoneditor-menu {
    background-color: #2d2b55;
    color: #fff;
    border-bottom: 1px solid #333;
}

#messageDetailsModal .jsoneditor-menu a,
#messageDetailsModal .jsoneditor-menu button {
    color: #fff;
}

#messageDetailsModal .jsoneditor-outer,
#messageDetailsModal .jsoneditor-tree,
#messageDetailsModal .jsoneditor-tree table {
    background-color: #1e1e1e;
}

#messageDetailsModal .jsoneditor-field,
#messageDetailsModal .jsoneditor-value {
    color: #e0e0e0;
}

/* Prevent field names from wrapping - keep them on single line */
#messageDetailsModal .jsoneditor-field {
    white-space: nowrap;
}

/* Allow long values to wrap properly */
#messageDetailsModal .jsoneditor-value {
    word-break: break-word;
    overflow-wrap: break-word;
}

#messageDetailsModal .jsoneditor-field[contenteditable="true"],
#messageDetailsModal .jsoneditor-value[contenteditable="true"] {
    background-color: #2a2a2a;
}

#messageDetailsModal .jsoneditor-search {
    background: transparent;
}

#messageDetailsModal .jsoneditor-search input {
    background-color: #333333;
    color: #e0e0e0;
    border: 1px solid #444444;
}

#messageDetailsModal .jsoneditor-search button {
    background-color: #3a3a3a;
    color: #e0e0e0;
    border: 1px solid #555;
}

#messageDetailsModal .jsoneditor-search button:hover {
    background-color: #4a4a4a;
    border-color: #6c63ff;
}

/* Selection and hover states */
#messageDetailsModal .jsoneditor-selected {
    background-color: rgba(108, 99, 255, 0.2);
}

#messageDetailsModal .jsoneditor-hover {
    background-color: rgba(255, 255, 255, 0.06);
}

/* Scrollbar styling within editor (WebKit) */
#messageDetailsModal .jsoneditor-outer::-webkit-scrollbar,
#messageDetailsModal .jsoneditor-tree::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

#messageDetailsModal .jsoneditor-outer::-webkit-scrollbar-thumb,
#messageDetailsModal .jsoneditor-tree::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 8px;
}

/* --- Details Modal Loading Progress (dark) --- */
#messageDetailsModal .details-loading-wrap {
    padding: 4px 0 8px 0;
}

#messageDetailsModal .progress.details-progress {
    background-color: #1e1e1e;
    border: 1px solid #444;
    height: 8px;
}

#messageDetailsModal .progress.details-progress .progress-bar.bg-info {
    background-color: #6c63ff !important;
    /* match app accent */
}

#messageDetailsModal .loading-text {
    color: #9aa0a6;
    font-size: 0.85rem;
}
/* --- Custom Prompts Modal Dark Theme --- */
#promptsModal .modal-content {
    background-color: #252525;
    color: #e0e0e0;
    border-radius: 1rem;
    border: 1px solid #333333;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}
#promptsModal .modal-header {
    background-color: #2d2b55;
    color: #fff;
    border-bottom: 1px solid #333333;
    border-top-left-radius: 1rem;
    border-top-right-radius: 1rem;
}
#promptsModal .modal-title {
    color: #fff;
    font-weight: 600;
}
#promptsModal .modal-footer {
    background: #252525;
    border-top: 1px solid #333333;
    border-bottom-left-radius: 1rem;
    border-bottom-right-radius: 1rem;
}
#promptsModal .btn-primary {
    background-color: #6c63ff;
    border-color: #5a52d5;
}
#promptsModal .btn-primary:hover {
    background-color: #5a52d5;
}
#promptsModal .btn-secondary {
    background-color: #333333;
    color: #e0e0e0;
    border: 1px solid #444444;
}
#promptsModal .btn-secondary:hover {
    background-color: #444444;
    color: #fff;
}
#promptsModal .btn-close {
    filter: invert(1) grayscale(1);
}
#promptsModal .form-label,
#promptsModal .form-check-label {
    color: #e0e0e0;
}
#promptsModal .form-check-input {
    background-color: #444444;
    border-color: #666666;
}
#promptsModal .form-check-input:checked {
    background-color: #6c63ff;
    border-color: #6c63ff;
}
#promptsModal .form-control {
    background-color: #333333;
    color: #e0e0e0;
    border: 1px solid #444444;
}
#promptsModal .form-control:focus {
    background-color: #333333;
    color: #e0e0e0;
    border-color: #6c63ff;
    box-shadow: 0 0 0 0.2rem rgba(108, 99, 255, 0.15);
}
#promptsModal .form-control::placeholder {
    color: #b0b0b0;
    opacity: 1;
}
#promptsModal small,
#promptsModal .text-muted {
    color: #9aa0a6 !important;
}
/* Ensure Prompts button text is visible (non-hover) */
#prompts-button.btn-info {
    color: #0b132b !important; /* high-contrast dark text */
    background-color: #0dcaf0; /* bootstrap info */
    border-color: #0dcaf0;
    font-weight: 600;
}
#prompts-button.btn-info:hover {
    color: #0b132b !important;
    background-color: #31d2f2;
    border-color: #25cff2;
}
#prompts-button.btn-primary {
    color: #ffffff !important; /* when ON (primary) keep white text */
    font-weight: 600;
}
#prompts-button.btn-primary:hover {
    color: #ffffff !important;
}