/* File: wwwroot/css/protaxiq.css */

/* Global Dark Theme Backgrounds and Text */
body.dark,
.dark { /* Apply this to the main container that gets the 'dark' class */
    background-color: #1A1A1D; /* Very dark, almost off-black */
    color: #E0E0E0; /* Soft light grey for general text */
}

    /* Assuming you have a navigation bar, adjust its dark theme styling */
    .dark .navbar {
        background-color: #121212; /* Even darker for the top bar to frame the logo */
        color: #E0E0E0;
    }

    /* Assuming you have a sidebar for the folders panel, adjust its dark theme styling */
    .dark .sidebar {
        background-color: #1F1F22; /* Slightly lighter than navbar, but still very dark */
        color: #E0E0E0;
    }

    .dark input {
        color: #E0E0E0; /* Ensure input text is legible */
        background-color: #2D2D30; /* Darker input background */
        border: 1px solid #4F4F55; /* Subtle border */
    }

/* Custom gutter styles for Split.js */
.gutter.gutter-horizontal {
    background-color: #e5e7eb;
    width:5px !important;
    cursor: ew-resize !important;
}

.dark .gutter.gutter-horizontal {
    background-color: #3C3C40; /* A distinct dark grey to separate panels */
    width: 5px !important;
}

#panel1, #panel2, #panel3 {
    min-width: 0;
}

/* Panel 1 (Folders) - Fixed header with scrollable content */
#panel1 {
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
}

#panel1 > div:first-child {
    /* Header section - stays fixed */
    flex-shrink: 0;
}

#panel1 .folder-list {
    /* Scrollable content area */
    flex: 1;
    min-height: 0; /* Important for Firefox */
    overflow-y: auto;
    overflow-x: hidden;
}

#panel1 .theme-toggle-footer {
    /* Footer section - stays fixed */
    flex-shrink: 0;
    margin-top: auto;
}

/* Ensure smooth scrolling */
#panel1 .folder-list::-webkit-scrollbar {
    width: 6px;
}

#panel1 .folder-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
}

#panel1 .folder-list::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 3px;
}

#panel1 .folder-list::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.5);
}

/* Dark mode scrollbar */
.dark #panel1 .folder-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

.dark #panel1 .folder-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
}

.dark #panel1 .folder-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Improved folder spacing and padding */
.folder-header {
    padding: 0.5rem 0.75rem !important;
    margin: 0.125rem 0.25rem !important;
    transition: all 0.15s ease;
}

.folder {
    margin-bottom: 0.25rem !important;
}

.folder-header.active {
    background-color: #e0e0e0;
    border-radius: 0.25rem;
}

.dark .folder-header.active {
    background-color: #2D2D30; /* Use a slightly lighter dark grey for active folder background */
    border-left: 3px solid #00B5FF; /* Accent border on active folder */
    padding-left: calc(1rem - 3px) !important; /* Adjust padding to account for border */
}

.folder-header.active .folder-name {
    font-weight: bold;
    color: #00B5FF; /* Make the active folder name the accent blue */
}

.subfolders {
    margin-left: 1.5rem;
    margin-top: 0.125rem !important;
    padding-left: 0.5rem !important;
    border-left: 1px solid rgba(0, 0, 0, 0.08);
}

.dark .subfolders {
    border-left-color: rgba(255, 255, 255, 0.08);
}

.subfolders .folder-header {
    padding: 0.4rem 0.75rem !important;
    font-size: 0.9rem;
}

.asset-item {
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: background-color 0.1s ease;
    border-left: 3px solid transparent; /* Prevent layout shift on selection */
}

    .asset-item:hover {
        background-color: #f0f0f0;
    }

.dark .asset-item:hover {
    background-color: #2D2D30; /* Subtle hover effect */
}

.asset-item.selected {
    background-color: #dbeafe; /* Tailwind blue-100 */
    font-weight: 500;
}

.dark .asset-item.selected {
    background-color: #1e3a5f; /* Darker blue for selected items */
    color: #e5e7eb; /* Light text for better contrast */
    font-weight: 500;
    border-left: 3px solid #00B5FF; /* Accent border instead of bright background */
    padding-left: calc(0.5rem - 3px); /* Adjust padding for border */
}

.folder-placeholder {
    background-color: #dbeafe;
    border: 1px dashed #60a5fa;
    height: 36px;
    margin: 4px 0;
    border-radius: 0.25rem;
}

.drop-target-hover {
    background-color: #93c5fd !important;
}

.dark .drop-target-hover {
    background-color: #008CFF !important; /* A slightly darker shade of the accent blue for strong visual cue */
    border: 1px dashed #00B5FF !important;
}

.modal-backdrop.hidden .modal-content {
    opacity: 0;
    transform: scale(0.95);
}

.modal-backdrop .modal-content {
    opacity: 1;
    transform: scale(1);
    transition-property: opacity, transform;
    transition-duration: 150ms;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Modal specific dark styles */
.dark .modal-content {
    background-color: #2D2D30; /* Dark background for modal content */
    color: #E0E0E0;
}

.dark .modal-header {
    border-bottom-color: #3C3C40;
}

.dark .modal-footer {
    border-top-color: #3C3C40;
}


/* Confidence Slider Styles */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-track {
    background: #e5e7eb;
    height: 8px;
    border-radius: 4px;
}

.dark input[type="range"]::-webkit-slider-track {
    background: #374151;
}

input[type="range"]::-moz-range-track {
    background: #e5e7eb;
    height: 8px;
    border-radius: 4px;
}

.dark input[type="range"]::-moz-range-track {
    background: #374151;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    background: #0095D5;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    margin-top: -6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

input[type="range"]::-moz-range-thumb {
    background: #0095D5;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

input[type="range"]:hover::-webkit-slider-thumb {
    transform: scale(1.1);
    box-shadow: 0 3px 6px rgba(0, 149, 213, 0.3);
}

input[type="range"]:hover::-moz-range-thumb {
    transform: scale(1.1);
    box-shadow: 0 3px 6px rgba(0, 149, 213, 0.3);
}

input[type="range"]:focus {
    outline: none;
}

input[type="range"]:focus::-webkit-slider-thumb {
    box-shadow: 0 0 0 3px rgba(0, 149, 213, 0.2);
}

input[type="range"]:focus::-moz-range-thumb {
    box-shadow: 0 0 0 3px rgba(0, 149, 213, 0.2);
}

.context-menu-item {
    display: block;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
    color: #1f2937;
    text-decoration: none;
    display: flex;
    align-items: center;
    cursor: pointer;
}

.dark .context-menu-item {
    color: #E0E0E0; /* Light grey text */
}

.context-menu-item:hover {
    background-color: #f3f4f6;
}

.dark .context-menu-item:hover {
    background-color: #00B5FF; /* Bright blue on hover */
    color: #121212; /* Dark text on bright blue */
}

.context-menu-item.disabled {
    opacity: 0.5;
    color: #9ca3af;
    cursor: not-allowed;
    pointer-events: none;
    background-color: transparent !important;
}

.dark .context-menu-item.disabled {
    color: #777777; /* Slightly darker disabled text */
}

/* Make the right sidebar a flex container */
.right-sidebar {
    display: flex;
    flex-direction: column;
}

/* Allow the Summary section to grow and fill available space */
.summary-section {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.flex-grow .tox-tinymce {
    flex-grow: 1 !important;
}

.flex-grow {
    min-height: 0;
}

#root-drop-zone-bottom {
    display: flex; /* It needs to be a flex container for alignment */
    opacity: 0;
    visibility: hidden;
    transition: opacity 150ms ease-in-out; /* This creates the smooth animation */
}

/* This is the new rule for when the drag is active. */
.is-dragging #root-drop-zone-bottom {
    opacity: 1;
    visibility: visible;
}

#asset-drop-overlay.dragging {
    display: flex; /* Use flex to show it */
}

/* Form input styles - removed in favor of inline Tailwind classes */

/* Button styles - removed in favor of inline Tailwind classes */

/* Button styles - using Tailwind classes inline instead */

/* Topic Toolbar styles - removed in favor of inline Tailwind classes */

/* Metadata card styles */
.metadata-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.625rem 0.75rem;
    background-color: #f3f4f6;
    border-radius: 0.375rem;
    border: 1px solid #e5e7eb;
    transition: all 0.15s ease-in-out;
}

.dark .metadata-card {
    background-color: #374151;
    border-color: #4b5563;
}

.metadata-card:hover {
    border-color: #0095D5;
    background-color: #e5e7eb;
}

.dark .metadata-card:hover {
    border-color: #0095D5;
    background-color: #4b5563;
}

.metadata-card a {
    color: #0095D5;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.875rem;
    flex: 1;
    margin-right: 0.5rem;
}

.metadata-card a:hover {
    text-decoration: underline;
}

.metadata-card i {
    font-size: 0.875rem;
}

/* Content accordion styles */

.content-preview {
    max-height: 5em; /* Adjust as needed */
    overflow: hidden;
}

.view-more-btn {
    background: none;
    border: none;
    color: #007BFF; /* Adjust to match your theme */
    cursor: pointer;
    text-decoration: underline;
    margin-top: 0.5em;
}

/* Accordion-based content cards */
.Content-accordion {
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
    overflow: hidden;
    background-color: #ffffff;
    transition: all 0.2s ease-in-out;
}

.dark .Content-accordion {
    background-color: #1f2937;
    border-color: #374151;
}

.Content-accordion:hover {
    border-color: #0095D5;
    box-shadow: 0 2px 4px rgba(0, 149, 213, 0.1);
}

.dark .Content-accordion:hover {
    border-color: #0095D5;
    box-shadow: 0 2px 4px rgba(0, 149, 213, 0.2);
}

.Content-accordion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    cursor: pointer;
    background-color: #f8fafc;
    border-bottom: 1px solid transparent;
    transition: all 0.2s ease-in-out;
    user-select: none;
    min-height: 4rem;
}

    .Content-accordion-header > .flex-grow {
        flex: 1 1 0; /* A shorthand for grow, shrink, and basis */
        min-width: 0; /* THIS IS THE CRITICAL FIX */
        overflow: hidden; /* Hide anything that still overflows */
    }

.dark .Content-accordion-header {
    background-color: #111827;
    color: #E0E0E0;
}

.Content-accordion-header:hover {
    background-color: #f1f5f9;
}

.dark .Content-accordion-header:hover {
    background-color: #1e293b;
}

.Content-accordion-header.expanded {
    border-bottom-color: #e5e7eb;
    background-color: #ffffff;
}

.dark .Content-accordion-header.expanded {
    border-bottom-color: #374151;
    background-color: #1f2937;
}

.Content-accordion-title {
    font-weight: 600;
    font-size: 0.875rem;
    color: #1f2937;
    margin-bottom: 0.25rem;
    line-height: 1.3;
}

.dark .Content-accordion-title {
    color: #E0E0E0;
}

.Content-accordion-preview {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block; /* Ensures overflow rules apply correctly */
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

.dark .Content-accordion-preview {
    color: #9ca3af;
}

.Content-accordion-header.expanded .Content-accordion-preview {
    display: none;
}

.Content-accordion-stats {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.375rem;
    font-size: 0.75rem;
    color: #6b7280;
    font-weight: 500;
}

.dark .Content-accordion-stats {
    color: #9ca3af;
}

.Content-accordion-header.expanded .Content-accordion-stats {
    display: none;
}

.Content-accordion-stats span {
    display: flex;
    align-items: center;
    padding: 0.125rem 0.375rem;
    background-color: #f1f5f9;
    border-radius: 0.25rem;
    white-space: nowrap;
}

.dark .Content-accordion-stats span {
    background-color: #334155;
}

.Content-accordion-stats i {
    opacity: 0.8;
    font-size: 0.5rem;
}

.Content-accordion-icon {
    color: #6b7280;
    font-size: 0.75rem;
    transition: transform 0.2s ease-in-out;
    flex-shrink: 0;
    margin-left: 0.5rem;
    margin-top: 0.125rem;

}

.dark .Content-accordion-icon {
    color: #9ca3af;
}

.Content-accordion-header.expanded .Content-accordion-icon {
    transform: rotate(180deg);
}

.Content-accordion-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0; /* This correctly keeps the controls from shrinking */
}


.Content-accordion-content {
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), padding 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background-color: #ffffff !important;
    /* Ensure container styles are preserved */
    isolation: isolate;
}

.dark .Content-accordion-content {
    background-color: #1f2937 !important;
}

.Content-accordion-content.expanded {
    max-height: 400px; /* Set a reasonable max height for scrolling */
    padding: 1rem;
    overflow-y: auto; /* Enable vertical scrolling */
    overflow-x: hidden; /* Hide horizontal scroll */
    scrollbar-width: thin; /* Firefox */
    scrollbar-color: #9ca3af #f3f4f6; /* Firefox */
    position: relative; /* Ensure proper scroll context */
}

/* Custom scrollbar for Webkit browsers */
.Content-accordion-content.expanded::-webkit-scrollbar {
    width: 6px;
}

.Content-accordion-content.expanded::-webkit-scrollbar-track {
    background: #f3f4f6;
    border-radius: 3px;
}

.Content-accordion-content.expanded::-webkit-scrollbar-thumb {
    background: #9ca3af;
    border-radius: 3px;
}

.Content-accordion-content.expanded::-webkit-scrollbar-thumb:hover {
    background: #6b7280;
}

/* Dark mode scrollbar */
.dark .Content-accordion-content.expanded {
    scrollbar-color: #4b5563 #1f2937; /* Firefox dark mode */
}

.dark .Content-accordion-content.expanded::-webkit-scrollbar-track {
    background: #1f2937;
}

.dark .Content-accordion-content.expanded::-webkit-scrollbar-thumb {
    background: #4b5563;
}

.dark .Content-accordion-content.expanded::-webkit-scrollbar-thumb:hover {
    background: #6b7280;
}

.Content-accordion-body {
    font-size: 0.875rem;
    line-height: 1.6;
    color: #374151 !important;
    max-width: none;
    /* Basic styles for accordion body */
    position: relative;
    z-index: 1;
    display: block;
}

.dark .Content-accordion-body {
    color: #d1d5db !important;
    background-color: transparent;
}

/* Scoped styles for content inside accordion body */
.Content-accordion-body > * {
    max-width: 100%;
}

.Content-accordion-body h1,
.Content-accordion-body h2,
.Content-accordion-body h3,
.Content-accordion-body h4,
.Content-accordion-body h5,
.Content-accordion-body h6 {
    color: inherit;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.Content-accordion-body h1 { font-size: 1.5rem; }
.Content-accordion-body h2 { font-size: 1.25rem; }
.Content-accordion-body h3 { font-size: 1.1rem; }
.Content-accordion-body h4 { font-size: 1rem; }
.Content-accordion-body h5 { font-size: 0.875rem; }
.Content-accordion-body h6 { font-size: 0.75rem; }

.Content-accordion-body p {
    margin-bottom: 0.75rem;
    color: inherit;
}

.Content-accordion-body ul,
.Content-accordion-body ol {
    margin-left: 1.5rem;
    margin-bottom: 0.75rem;
    color: inherit;
}

.Content-accordion-body li {
    margin-bottom: 0.25rem;
    color: inherit;
}

.Content-accordion-body strong {
    font-weight: 600;
    color: inherit;
}

.Content-accordion-body em {
    font-style: italic;
}

.Content-accordion-body a {
    color: #0095D5;
    text-decoration: underline;
}

.Content-accordion-body a:hover {
    color: #0077a8;
}

.Content-accordion-body table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

.Content-accordion-body th,
.Content-accordion-body td {
    padding: 0.5rem;
    border: 1px solid #e5e7eb;
    text-align: left;
}

.Content-accordion-body th {
    background-color: #f9fafb;
    font-weight: 600;
}

.dark .Content-accordion-body th {
    background-color: #374151;
    border-color: #4b5563;
}

.dark .Content-accordion-body td {
    border-color: #4b5563;
}

/* Prevent any styles from escaping the accordion container */
.Content-accordion-content {
    contain: layout style paint;
}

/* Styling for cleaned email content */
.email-content-container {
    /* Basic typography */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 0.875rem;
    line-height: 1.6;
    color: inherit;
    display: block;
    width: 100%;
}

/* Style tables in email content */
.email-content-container table {
    border-collapse: collapse;
    margin: 1rem 0;
    width: auto;
    max-width: 100%;
}

.email-content-container td,
.email-content-container th {
    padding: 0.5rem;
    border: 1px solid #e5e7eb;
    text-align: left;
}

.dark .email-content-container td,
.dark .email-content-container th {
    border-color: #4b5563;
}

.email-content-container th {
    background-color: #f9fafb;
    font-weight: 600;
}

.dark .email-content-container th {
    background-color: #374151;
}

/* Status indicators */
.Content-accordion-status {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.625rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.Content-accordion-status.published {
    background-color: #dcfce7;
    color: #166534;
}

.dark .Content-accordion-status.published {
    background-color: #14532d;
    color: #bbf7d0;
}

.Content-accordion-status.draft {
    background-color: #fef3c7;
    color: #92400e;
}

.dark .Content-accordion-status.draft {
    background-color: #451a03;
    color: #fcd34d;
}

/* Content metadata */
.Content-accordion-meta {
    font-size: 0.625rem;
    color: #9ca3af;
    margin-left: 0.5rem;
    padding: 0.125rem 0.375rem;
    background-color: #f3f4f6;
    border-radius: 0.25rem;
}

.dark .Content-accordion-meta {
    color: #6b7280;
    background-color: #374151;
}

/* Legacy card styles for backward compatibility */
.Content-card {
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    margin-bottom: 0.75rem;
    overflow: hidden;
}

.dark .Content-card {
    background-color: #1f2937;
    border-color: #374151;
}

.Content-card-header {
    font-weight: 600;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e5e7eb;
    font-size: 0.875rem;
    background-color: #ffffff;
}

.dark .Content-card-header {
    border-bottom-color: #374151;
    color: #E0E0E0;
    background-color: #111827;
}

.Content-card-content {
    padding: 1rem;
    max-width: none;
    font-size: 0.875rem;
    line-height: 1.5;
}

/* Prose content styling within cards */
#Content-view-container.prose {
    font-size: 0.875rem;
    line-height: 1.6;
}

#Content-view-container.prose p {
    margin-bottom: 0.75rem;
}

#Content-view-container.prose h1,
#Content-view-container.prose h2,
#Content-view-container.prose h3,
#Content-view-container.prose h4 {
    margin-top: 1.25rem;
    margin-bottom: 0.75rem;
}

.prose {
    max-width: none;
}

.dark .prose {
    color: #d1d5db;
}

/* Panel 3 (Asset Details) specific styles */
#panel3 {
    height: 100%;
    display: flex;
    flex-direction: column;
    background-color: #f3f4f6;
}

.dark #panel3 {
    background-color: #111827;
}

/* Content editor container */
#Content-editor-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0; /* Important for flex children */
}

/* Ensure TinyMCE fills its container */
#Content-editor-container .tox-tinymce {
    flex: 1;
    height: 100% !important;
    border-radius: 0.5rem;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
}

.dark #Content-editor-container .tox-tinymce {
    border-color: #374151;
}

/* Ensure the editor content area fills available space */
#Content-editor-container .tox-editor-container {
    flex: 1;
    display: flex;
    flex-direction: column;
}

#Content-editor-container .tox-edit-area {
    flex: 1;
    overflow-y: auto !important;
}

/* Ensure the iframe inside TinyMCE is scrollable */
#Content-editor-container .tox-edit-area iframe {
    height: 100% !important;
}

/* Fix for the editor body to be scrollable */
.tox .tox-edit-area__iframe {
    overflow-y: auto !important;
}

/* Asset details panel specific improvements */
#panel3 .tox .tox-toolbar__primary {
    background-color: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.dark #panel3 .tox .tox-toolbar__primary {
    background-color: #1f2937;
    border-bottom: 1px solid #374151;
}

/* Remove default TinyMCE button backgrounds */
#panel3 .tox .tox-tbtn {
    background-color: transparent !important;
}

#panel3 .tox .tox-tbtn:hover {
    background-color: #e5e7eb !important;
}

.dark #panel3 .tox .tox-tbtn:hover {
    background-color: #374151 !important;
}

/* Handle active/pressed state */
#panel3 .tox .tox-tbtn--enabled,
#panel3 .tox .tox-tbtn:active {
    background-color: #d1d5db !important;
}

.dark #panel3 .tox .tox-tbtn--enabled,
.dark #panel3 .tox .tox-tbtn:active {
    background-color: #4b5563 !important;
}

/* Card styling for sections */
#panel3 .bg-white {
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.dark #panel3 .bg-gray-800 {
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.3);
}

/* Dropzone styling improvements */
#dropzone {
    transition: all 0.2s ease-in-out;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#dropzone:hover {
    border-color: #0095D5;
    background-color: rgba(0, 149, 213, 0.05);
}

.dark #dropzone:hover {
    background-color: rgba(0, 149, 213, 0.1);
    border-color: #0095D5;
}

#dropzone.border-pta-blue {
    border-color: #0095D5;
    background-color: rgba(0, 149, 213, 0.1);
}

.dark #dropzone.border-pta-blue {
    background-color: rgba(0, 149, 213, 0.15);
    border-color: #0095D5;
}

/* Metadata cards within the new layout */
#metadata-cards-container {
    min-height: 60px;
}

/* Ensure proper spacing in the contents section */
#Content-view-container {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

/* Style adjustments for edit mode */
#panel3 input[type="text"],
#panel3 input[type="url"],
#panel3 select {
    font-size: 0.875rem;
}

/* Ensure buttons in the panel have consistent sizing */
#panel3 button {
    font-size: 0.875rem;
}

/* TinyMCE AI Assistant button */
.tox .tox-tbtn--select[aria-label="IQ Assistant"] {
    width: auto !important;
}

.tox .tox-tbtn__select-label i {
    font-size: 16px;
    line-height: 1;
}

/* Demo Chat Styles */
.demo-chat-container {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.demo-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.demo-chat-input {
    border-top: 1px solid #e5e7eb;
    padding: 1rem;
    background: #ffffff;
}

.dark .demo-chat-input {
    background: #1f2937;
    border-top-color: #374151;
}

/* Smooth scrolling for chat */
#chatContainer {
    scroll-behavior: smooth;
}

/* Message animations */
.chat-bubble {
    animation: fadeInUp 0.3s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Enhanced demo controls */
.demo-controls {
    background: rgba(0, 0, 0, 0.8);
    border-radius: 0.5rem;
    padding: 0.5rem;
    backdrop-filter: blur(10px);
}

.demo-controls button {
    transition: all 0.2s;
    min-width: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.demo-controls button:hover {
    background-color: #4b5563;
    transform: scale(1.05);
}

.demo-controls button:active {
    transform: scale(0.95);
}

/* Demo state indicator */
.demo-paused {
    position: fixed;
    top: 4rem;
    right: 1rem;
    background: rgba(239, 68, 68, 0.9);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 60;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.9;
    }
    50% {
        opacity: 0.6;
    }
}

/* Demo typing effect */
#chatInput.demo-typing {
    background-color: rgba(0, 149, 213, 0.05);
    border-color: #0095D5;
}

.dark #chatInput.demo-typing {
    background-color: rgba(0, 149, 213, 0.1);
}

/* Typing indicator for enhanced demo */
.typing-indicator {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
}

.typing-indicator span {
    height: 8px;
    width: 8px;
    background-color: #999;
    border-radius: 50%;
    display: inline-block;
    margin: 0 2px;
    animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Notification animation */
@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateX(1rem);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.animate-fade-in {
    animation: fade-in 0.3s ease-out;
}

/* Secondary button styles - removed in favor of inline Tailwind classes */

/* Target the Content dropdown button specifically */
.tox .content-dropdown-button,
.tox-toolbar__primary button.tox-mbtn--select {
    min-width: 200px !important;
    width: 200px !important;
}

/* Ensure text inside button doesn't overflow */
.tox .content-dropdown-button .tox-mbtn__select-label,
.tox-toolbar__primary button.tox-mbtn--select .tox-mbtn__select-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
    text-align: left;
    max-width: 170px;
}

/* Force ALL TinyMCE dropdown menus in toolbar to be wider */
.tox .tox-menu.tox-collection--toolbar,
.tox .tox-collection.tox-collection--toolbar,
.tox-tinymce .tox-menu,
div[role="application"].tox .tox-menu {
    min-width: 300px !important;
    width: auto !important;
}

/* Ensure menu items have enough space */
.tox .tox-collection__item {
    min-width: 280px !important;
}

.tox .tox-collection__item-label {
    max-width: none !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 20px !important;
}

/* Fix TinyMCE scrolling for long content like transcriptions */
#Content-editor-container {
    height: 100%;
    overflow: hidden;
}

#Content-editor-container .tox {
    height: 100%;
    display: flex;
    flex-direction: column;
}

#Content-editor-container .tox-editor-header {
    flex-shrink: 0;
}

#Content-editor-container .tox-editor-container {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#Content-editor-container .tox-edit-area {
    flex: 1;
    overflow: hidden;
}

#Content-editor-container .tox-edit-area__iframe {
    height: 100% !important;
    width: 100% !important;
}

#Content-editor-container .tox-edit-area {
    flex: 1;
    overflow-y: auto !important;
}

    /* Ensure the iframe inside TinyMCE is scrollable */
    #Content-editor-container .tox-edit-area iframe {
        height: 100% !important;
    }

/* Fix for the editor body to be scrollable */
.tox .tox-edit-area__iframe {
    overflow-y: auto !important;
}

.Content-accordion h1 {
    font-size: 2em;
    font-weight: bold;
}

.Content-accordion h2 {
    font-size: 1.5em;
    font-weight: bold;
}

.Content-accordion h3 {
    font-size: 1.17em;
    font-weight: bold;
}

.Content-accordion h4 {
    font-size: 1em;
    font-weight: bold;
}

.Content-accordion h5 {
    font-size: 0.83em;
    font-weight: bold;
}

.Content-accordion h6 {
    font-size: 0.67em;
    font-weight: bold;
}

/* Paper airplane animation for share modal */
@keyframes flyLoop {
    0% {
        transform: translateX(-100px) translateY(0) rotate(-10deg);
    }
    25% {
        transform: translateX(0) translateY(-20px) rotate(0deg);
    }
    50% {
        transform: translateX(100px) translateY(0) rotate(10deg);
    }
    75% {
        transform: translateX(0) translateY(20px) rotate(0deg);
    }
    100% {
        transform: translateX(-100px) translateY(0) rotate(-10deg);
    }
}

.paper-airplane {
    animation: flyLoop 3s ease-in-out infinite;
    transform-origin: center;
}

#paperAirplaneAnimation {
    transition: opacity 0.3s ease-in-out;
}

#paperAirplaneAnimation.hidden {
    opacity: 0;
}

#paperAirplaneAnimation:not(.hidden) {
    opacity: 1;
}

/* Dashboard card styles */
.dashboard-card {
    min-height: 140px;
    display: flex;
    flex-direction: column;
}

.dashboard-card .card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Ensure grid items maintain consistent sizing */
.dashboard-grid > div {
    height: 100%;
}

/* Icon container consistent sizing */
.dashboard-icon-container {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Admin form enhancements */
.admin-form-card {
    transition: box-shadow 0.2s ease;
}

.admin-form-card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.dark .admin-form-card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
}

/* Gradient headers for cards */
.card-header-gradient {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.dark .card-header-gradient {
    background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
}

/* Checkbox and radio button enhancements */
input[type="checkbox"]:checked,
input[type="radio"]:checked {
    background-color: #0095D5;
    border-color: #0095D5;
}

input[type="checkbox"]:focus,
input[type="radio"]:focus {
    box-shadow: 0 0 0 3px rgba(0, 149, 213, 0.1);
}

.dark input[type="checkbox"]:focus,
.dark input[type="radio"]:focus {
    box-shadow: 0 0 0 3px rgba(0, 149, 213, 0.2);
}

/* Search result highlight animation */
@keyframes highlightPulse {
    0% {
        background-color: transparent;
    }
    50% {
        background-color: rgba(0, 149, 213, 0.1);
    }
    100% {
        background-color: transparent;
    }
}

.Content-accordion.highlight {
    animation: highlightPulse 2s ease-in-out;
}

.dark .Content-accordion.highlight {
    animation: highlightPulse 2s ease-in-out;
}

@keyframes highlightPulseDark {
    0% {
        background-color: transparent;
    }
    50% {
        background-color: rgba(0, 149, 213, 0.2);
    }
    100% {
        background-color: transparent;
    }
}

.dark .Content-accordion.highlight {
    animation: highlightPulseDark 2s ease-in-out;
}

/* Premium Loading Indicator */
.premium-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    min-height: 200px;
}

.premium-loader-spinner {
    position: relative;
    width: 50px;
    height: 50px;
}

.premium-loader-spinner::before,
.premium-loader-spinner::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 3px solid transparent;
    border-top-color: #0095D5;
    animation: premiumSpin 1.2s cubic-bezier(0.68, -0.55, 0.27, 1.55) infinite;
}

.premium-loader-spinner::after {
    border-top-color: transparent;
    border-right-color: #0095D5;
    animation-delay: 0.3s;
}

@keyframes premiumSpin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.dark .premium-loader-spinner::before {
    border-top-color: #60A5FA;
}

.dark .premium-loader-spinner::after {
    border-right-color: #60A5FA;
}

.premium-loader-text {
    margin-top: 1.5rem;
    font-size: 0.875rem;
    color: #6B7280;
    font-weight: 500;
    letter-spacing: 0.025em;
}

.dark .premium-loader-text {
    color: #9CA3AF;
}

/* Loading dots animation */
.loading-dots {
    display: inline-flex;
    gap: 0.25rem;
    margin-left: 0.5rem;
}

.loading-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #0095D5;
    animation: loadingDotPulse 1.4s infinite ease-in-out;
}

.dark .loading-dot {
    background-color: #60A5FA;
}

.loading-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.loading-dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes loadingDotPulse {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* SignalR Real-time Update Animations */
.updated-flash {
    animation: flashUpdate 2s ease-in-out;
}

@keyframes flashUpdate {
    0% {
        background-color: transparent;
    }
    25% {
        background-color: rgba(0, 149, 213, 0.2);
        transform: scale(1.02);
    }
    75% {
        background-color: rgba(0, 149, 213, 0.1);
        transform: scale(1.01);
    }
    100% {
        background-color: transparent;
        transform: scale(1);
    }
}

/* Connection status indicator */
#connection-status {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: all 0.3s ease;
}

#connection-status i {
    font-size: 8px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Toast notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 250px;
    max-width: 400px;
    animation: slideIn 0.3s ease;
}

.toast.success {
    border-left: 4px solid #10b981;
}

.toast.error {
    border-left: 4px solid #ef4444;
}

.toast.warning {
    border-left: 4px solid #f59e0b;
}

.toast.info {
    border-left: 4px solid #3b82f6;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.fade-out {
    animation: slideOut 0.3s ease forwards;
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Real-time update indicators */
.realtime-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    margin-left: 8px;
    animation: pulse 2s infinite;
}

.transcription-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
}

/* CRITICAL OVERFLOW FIXES FOR CONTENT CONTAINER */
#Content-view-container {
    overflow-x: hidden !important;
    overflow-y: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
}

#Content-view-container * {
    max-width: 100% !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
}

/* Fix accordion content that bleeds out */
.Content-accordion,
.content-accordion {
    overflow: hidden !important;
    max-width: 100% !important;
}

.Content-accordion-content:not(.expanded),
.accordion-content:not(.expanded) {
    overflow-x: auto !important;
    overflow-y: hidden !important;
    max-width: 100% !important;
    padding: 0 !important;
}

.Content-accordion-content *,
.accordion-content * {
    max-width: 100% !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
}

/* Ensure tables scroll horizontally */
.Content-accordion-content table,
.accordion-content table,
#Content-view-container table {
    display: block !important;
    overflow-x: auto !important;
    white-space: nowrap !important;
    max-width: 100% !important;
}

/* Fix images to be responsive */
.Content-accordion-content img,
.accordion-content img,
#Content-view-container img {
    max-width: 100% !important;
    height: auto !important;
}

/* Fix for published badges and status indicators */
.Content-accordion-status,
.badge {
    display: inline-flex !important;
    max-width: fit-content !important;
    white-space: nowrap !important;
}

/* Ensure pre and code blocks don't overflow */
.Content-accordion-content pre,
.accordion-content pre,
#Content-view-container pre {
    overflow-x: auto !important;
    max-width: 100% !important;
}

.Content-accordion-content code,
.accordion-content code,
#Content-view-container code {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
}