/* Custom CSS for Engineering Drawing Insights */

/* Loading spinner animation */
.htmx-indicator {
    display: none;
}

.htmx-request .htmx-indicator {
    display: inline-block;
}

.htmx-request.htmx-indicator {
    display: inline-block;
}

/* Drag and drop zone styles */
.drag-over {
    border-color: #FD6401 !important;  /* Primary orange */
    background-color: #FFF5F0 !important;
}

/* Custom scrollbar for desktop */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #F3F8F9;  /* Light blue background */
}

::-webkit-scrollbar-thumb {
    background: #ADBACA;  /* Secondary grey */
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #698295;  /* Slate gray on hover */
}

/* Table hover effects */
.table tr.hover:hover {
    cursor: pointer;
    background-color: #F3F8F9;  /* Light blue background */
}

/* Chat message styles */
.chat-message {
    animation: slideIn 0.3s ease-out;
}

/* Comparison Table Styles */
.comparison-table {
    border-collapse: separate;
    border-spacing: 0;
}

.comparison-table thead th {
    position: sticky;
    top: 0;
    background: #F9FAFB;
    z-index: 5;
    border-bottom: 2px solid #E5E7EB;
}

.comparison-table tbody td.sticky {
    position: sticky;
    left: 0;
    border-right: 1px solid #E5E7EB;
}

.comparison-table tbody tr:hover {
    background-color: rgba(253, 100, 1, 0.02) !important;
}

.comparison-table tbody tr:hover td {
    background-color: inherit !important;
}

/* Comparison Results Container */
.comparison-results {
    max-width: 100%;
    overflow: hidden;
}

.comparison-results .card {
    border: 1px solid #E5E7EB;
    transition: all 0.2s ease;
}

.comparison-results .card:hover {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

/* Difference Highlighting */
.difference-unique {
    background-color: rgba(253, 100, 1, 0.1) !important;
    font-weight: 600;
}

.difference-partial {
    background-color: rgba(4, 73, 89, 0.05) !important;
    font-weight: 500;
}

.difference-missing {
    color: #9CA3AF;
    font-style: italic;
}

/* Category Badges */
.badge-blue {
    background-color: rgba(59, 130, 246, 0.1);
    color: #3B82F6;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.badge-green {
    background-color: rgba(34, 197, 94, 0.1);
    color: #22C55E;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.badge-purple {
    background-color: rgba(168, 85, 247, 0.1);
    color: #A855F7;
    border: 1px solid rgba(168, 85, 247, 0.2);
}

.badge-yellow {
    background-color: rgba(250, 204, 21, 0.1);
    color: #F59E0B;
    border: 1px solid rgba(250, 204, 21, 0.2);
}

.badge-red {
    background-color: rgba(239, 68, 68, 0.1);
    color: #EF4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Responsive Design for Comparison */
@media (max-width: 768px) {
    .comparison-table {
        font-size: 0.75rem;
    }
    
    .comparison-table th,
    .comparison-table td {
        padding: 0.5rem 0.25rem;
    }
    
    .comparison-results .stat {
        padding: 0.5rem;
    }
}

/* Print Styles for Comparison */
@media print {
    .comparison-results .card {
        page-break-inside: avoid;
        box-shadow: none !important;
        border: 1px solid #000;
    }
    
    .comparison-table {
        font-size: 10pt;
    }
    
    .badge {
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }
}

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

/* Formatted chat content styles */
.chat-formatted strong {
    font-weight: 600;
    color: #02365D;  /* Primary blue for emphasis */
}

.chat-formatted ol, 
.chat-formatted ul {
    margin-left: 0.5rem;
}

.chat-formatted li {
    margin-bottom: 0.25rem;
    line-height: 1.6;
}

.chat-formatted p {
    line-height: 1.6;
}

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

/* Drawing preview container */
.drawing-preview {
    max-height: 600px;
    overflow: auto;
}

/* Thumbnail styling in tables */
.avatar img {
    object-fit: contain;
    background-color: #F3F8F9;  /* Light blue background */
}

/* Text truncation for table cells */
.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.max-w-xs {
    max-width: 20rem; /* 320px */
}

/* Modal styling */
.modal-box {
    max-height: 90vh;
    overflow-y: auto;
}

/* Dropzone image preview styling */
#dropzone.drag-over {
    border-color: #FD6401;
    background-color: rgba(253, 100, 1, 0.05);
}

/* Removed conflicting imagePreview rules - now handled by Tailwind classes */

/* Table in modal */
.modal-box .table td:first-child {
    width: 40%;
    font-weight: 500;
    color: #44546A; /* Secondary blue */
}

/* Status badges */
.badge-processing {
    background-color: #FD6401;  /* Primary orange */
    color: white;
}

.badge-completed {
    background-color: #02365D;  /* Primary blue for success */
    color: white;
}

.badge-error {
    background-color: #44546A;  /* Secondary blue for errors */
    color: white;
}

/* Override DaisyUI progress bar colors */
.progress-primary::-webkit-progress-value {
    background-color: #FD6401;  /* Primary orange */
}

.progress-primary::-moz-progress-bar {
    background-color: #FD6401;  /* Primary orange */
}

.progress-primary {
    background-color: #ADBACA;  /* Secondary grey for track */
}

/* Override DaisyUI alert colors */
.alert-success {
    background-color: #02365D !important;  /* Primary blue */
    color: white !important;
    border: none !important;
}

.alert-success svg {
    stroke: white !important;
}

.alert-success span {
    color: white !important;
}

.alert-info {
    background-color: #F3F8F9;  /* Light blue background */
    color: #44546A;  /* Secondary blue text */
    border: 1px solid #ADBACA;  /* Secondary grey border */
}

.alert-info svg {
    stroke: #44546A;  /* Secondary blue */
}

/* Override DaisyUI alert colors for errors */
.alert-error {
    background-color: #44546A !important;  /* Secondary blue for errors */
    color: white !important;
    border: none !important;
}

.alert-error svg {
    stroke: white !important;
}

.alert-error span {
    color: white !important;
}

.alert-warning {
    background-color: #FF9514 !important;  /* Accent orange for warnings */
    color: white !important;
    border: none !important;
}

.alert-warning svg {
    stroke: white !important;
}

/* Override DaisyUI button colors */
.btn-primary {
    background-color: #FD6401 !important;  /* Primary orange */
    border-color: #FD6401 !important;
    color: white !important;
}

.btn-primary:hover {
    background-color: #FF9514 !important;  /* Accent orange on hover */
    border-color: #FF9514 !important;
}

.btn-secondary {
    background-color: #02365D !important;  /* Primary blue */
    border-color: #02365D !important;
    color: white !important;
}

.btn-secondary:hover {
    background-color: #44546A !important;  /* Secondary blue on hover */
    border-color: #44546A !important;
}

.btn-ghost {
    color: #44546A !important;  /* Secondary blue text */
}

.btn-ghost:hover {
    background-color: #F3F8F9 !important;  /* Light blue background on hover */
    color: #02365D !important;  /* Primary blue text on hover */
}

.btn-outline {
    border-color: #ADBACA !important;  /* Secondary grey border */
    color: #44546A !important;  /* Secondary blue text */
}

.btn-outline:hover {
    background-color: #02365D !important;  /* Primary blue background on hover */
    border-color: #02365D !important;
    color: white !important;
}

/* Override DaisyUI loading spinner colors */
.loading-spinner.text-primary {
    color: #FD6401;  /* Primary orange */
}

/* Toast container specific error styling */
#toast-container .alert-error {
    background-color: #44546A !important;  /* Secondary blue for errors */
    color: white !important;
    border: none !important;
}

#toast-container .alert-error svg {
    stroke: white !important;
}

/* File upload progress */
.upload-progress {
    transition: width 0.3s ease;
}

/* Toast animations and styling */
.toast {
    animation: toastSlideIn 0.3s ease-out;
}

#toast-container .alert-success {
    background-color: #02365D !important;  /* Primary blue */
    color: white !important;
    border: none !important;
}

#toast-container .alert-success svg {
    stroke: white !important;
}

@keyframes toastSlideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Form input styling */
.input:focus,
.select:focus,
.textarea:focus {
    border-color: #FD6401 !important;  /* Primary orange on focus */
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(253, 100, 1, 0.1) !important;
}

.input-bordered {
    border-color: #ADBACA !important;  /* Secondary grey border */
}

/* Checkbox and radio button styling */
.checkbox:checked,
.radio:checked {
    background-color: #FD6401 !important;  /* Primary orange when checked */
    border-color: #FD6401 !important;
}

/* Link styling */
a {
    color: #FD6401;  /* Primary orange for links */
}

a:hover {
    color: #FF9514;  /* Accent orange on hover */
}

/* Animated loading dots */
.loading-dots::after{
    content:'...';
    display:inline-block;
    width:0;
    overflow:hidden;
    animation:ellipsis 1.2s steps(4,end) infinite;
}
  
@keyframes ellipsis{
    to{width:1.5em;}
}

/* Compact Match Column Styles */
.match-content {
    padding: 0.25rem;
}

.match-content .radial-progress {
    --size: 2rem !important;
    font-size: 0.625rem;
}

.block-scores-compact {
    background: #F3F8F9;
    padding: 0.5rem;
    border-radius: 4px;
    border: 1px solid #E2E8F0;
    margin-top: 0.5rem;
}

.block-scores-compact .btn-xs {
    padding: 0.125rem 0.5rem;
    height: 1.5rem;
    min-height: 1.5rem;
}

/* Floating Block Score Details Panel */
.block-scores-detail {
    position: absolute;
    z-index: 50;
    background: white;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #ADBACA;
    max-width: 400px;
    width: 350px;
    right: 0;
    margin-top: 0.5rem;
}

.block-scores-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #E2E8F0;
}

.block-scores-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.block-score-row {
    padding: 0.5rem;
    background: #F8FAFC;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.block-score-row.best-match {
    background-color: #FFF5F0;
    border: 1px solid #FD6401;
}

.block-header {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.block-icon {
    font-size: 1.25rem;
    margin-right: 8px;
}

.block-name {
    font-weight: 500;
    color: #02365D;  /* Primary blue */
    text-transform: capitalize;
}

.score-bar-container {
    position: relative;
    height: 20px;
    background-color: #F3F8F9;  /* Light blue background */
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 6px;
}

.score-bar {
    height: 100%;
    background: linear-gradient(to right, #44546A, #02365D);  /* Blue gradient */
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 8px;
}

.score-text {
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
}

/* Additional styles for block icons and matched text */
.block-icon {
    font-size: 1rem;
    display: inline-block;
    width: 1.5rem;
}

.matched-text-preview {
    font-size: 0.75rem;
    color: #64748B;
    line-height: 1.2;
    margin-top: 0.25rem;
}

/* Make the match column responsive */
@media (max-width: 1280px) {
    .match-content {
        font-size: 0.875rem;
    }
    
    .block-scores-detail {
        width: 300px;
    }
}

.matched-text-preview {
    font-size: 0.875rem;
    color: #698295;  /* Slate gray */
    font-style: italic;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Hide/show animation for block scores */
.hidden {
    display: none;
}

.block-scores-toggle {
    transition: transform 0.2s ease;
}

.block-scores-toggle.expanded {
    transform: rotate(180deg);
}

/* Match Column Redesign */
.match-column {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.match-score-badge {
    background: linear-gradient(135deg, #02365D, #44546A);
    color: white;
    padding: 0.5rem;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.match-score-badge .score-value {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.2;
}

.match-score-badge .score-type {
    font-size: 0.75rem;
    opacity: 0.9;
    margin-top: 0.125rem;
}

/* Block Summary for Match Column */
.block-summary {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    background: #F8FAFC;
    padding: 0.5rem;
    border-radius: 6px;
    border: 1px solid #E2E8F0;
}

.block-summary .best-block {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.875rem;
}

.block-summary .best-block .icon {
    font-size: 1rem;
}

.block-summary .best-block .name {
    flex: 1;
    color: #44546A;
    font-weight: 500;
}

.block-summary .best-block .score {
    color: #02365D;
    font-weight: 600;
}

.block-summary .expand-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    background: white;
    border: 1px solid #ADBACA;
    color: #44546A;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.block-summary .expand-btn:hover {
    background: #02365D;
    color: white;
    border-color: #02365D;
}

.block-summary .expand-btn .icon {
    font-size: 0.625rem;
    transition: transform 0.2s ease;
}

/* Inline Expandable Block Scores */
.block-scores-expanded {
    background-color: #F8FAFC;
}

.block-scores-expanded td {
    padding: 0 !important;
}

.block-scores-container {
    padding: 1.5rem;
    background: #F8FAFC;
    border-top: 2px solid #E2E8F0;
}

.block-scores-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.block-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 1rem;
    transition: all 0.2s ease;
}

.block-card:hover {
    border-color: #ADBACA;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.block-card.highlight {
    background: #FFF5F0;
    border-color: #FD6401;
}

.block-card .block-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.block-card .block-header .icon {
    font-size: 1.25rem;
}

.block-card .block-header .name {
    font-weight: 600;
    color: #02365D;
    font-size: 0.875rem;
}

.block-card .score-visual {
    display: flex;
    justify-content: center;
    margin: 1rem 0;
}

.score-ring {
    position: relative;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.score-ring::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: conic-gradient(
        #02365D calc(var(--score) * 1%),
        #E2E8F0 calc(var(--score) * 1%)
    );
    mask: radial-gradient(circle at center, transparent 65%, black 65%);
    -webkit-mask: radial-gradient(circle at center, transparent 65%, black 65%);
}

.score-ring span {
    font-size: 1.25rem;
    font-weight: 700;
    color: #02365D;
}

.block-card .matched-snippet {
    background: #F8FAFC;
    padding: 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    color: #698295;
    font-style: italic;
    line-height: 1.4;
    margin-top: 0.75rem;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .block-scores-grid {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    }
}

/* Metadata Analysis Styles */
.metadata-summary {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: #F0F9FF;
    border: 1px solid #BFDBFE;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.metadata-summary .summary-text {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

.metadata-summary .icon {
    font-size: 1rem;
}

.metadata-summary .text {
    font-size: 0.875rem;
    color: #02365D;
}

.metadata-summary .expand-btn {
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    background: #02365D;
    color: white;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    transition: all 0.2s;
}

.metadata-summary .expand-btn:hover {
    background: #1e3a8a;
}

.metadata-analysis-expanded {
    background-color: #F8FAFC;
}

.metadata-analysis-container {
    padding: 2rem;
}

.metadata-analysis-container .analysis-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #02365D;
    margin-bottom: 1.5rem;
}

.comparison-block {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.comparison-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #E2E8F0;
}

.compared-with {
    font-weight: 500;
    color: #02365D;
}

.metadata-similarity {
    font-size: 0.875rem;
    color: #698295;
    background: #F0F9FF;
    padding: 0.25rem 0.75rem;
    border-radius: 0.375rem;
}

.differences-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.difference-item {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 1rem;
    padding: 0.75rem;
    background: #F8FAFC;
    border-radius: 0.375rem;
}

.field-name {
    font-weight: 600;
    color: #02365D;
    font-size: 0.875rem;
}

.field-values {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.value-current,
.value-compared {
    display: flex;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.value-current .label,
.value-compared .label {
    font-weight: 500;
    color: #698295;
    min-width: 40px;
}

.value-current .value {
    color: #02365D;
}

.value-compared .value {
    color: #698295;
}

/* Print styles */
@media print {
    .navbar,
    .btn,
    .toast,
    .block-scores-expanded,
    .metadata-analysis-expanded {
        display: none !important;
    }
    
    .container {
        max-width: 100% !important;
    }
}

/* Floating Comparison Button */
#floatingCompareBtn {
    transition: all 0.3s ease;
}

#floatingCompareBtn:hover .absolute {
    opacity: 1;
    visibility: visible;
}

#floatingCompareBtn .absolute {
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

/* Ensure both floating buttons don't overlap */
@media (min-width: 640px) {
    /* When both buttons are shown, position them side by side */
    #selectionToolbar:not(.hidden) ~ #floatingCompareBtn {
        bottom: 2rem;
        right: 22rem; /* Move comparison button to the left of chat toolbar */
    }
}

/* Comparison Modal */
#comparisonModal {
    backdrop-filter: blur(4px);
}

.comparison-results {
    max-height: 70vh;
    overflow-y: auto;
}

.source-comparison-results {
    max-height: 70vh;
    overflow-y: auto;
}

.comparison-results table {
    font-size: 0.875rem;
}

.comparison-results td {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.comparison-results td:hover {
    white-space: normal;
    word-wrap: break-word;
}

/* ==========================================
   Clean Professional Score Display
   ========================================== */

/* Combined search clean display */
.score-display-clean {
    padding: 8px 0;
}

.primary-score {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 6px;
}

.score-main {
    font-size: 1.375rem;
    font-weight: 700;
    color: #1f2937;
    line-height: 1;
}

.score-label {
    font-size: 0.75rem;
    color: #6b7280;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.score-components {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.component-score {
    font-size: 0.8125rem;
    padding: 3px 8px;
    background: #f9fafb;
    border-radius: 4px;
    color: #4b5563;
    font-weight: 500;
    border: 1px solid #e5e7eb;
    transition: all 0.2s;
}

.component-score:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

.component-score.image {
    border-left: 3px solid #3b82f6;
}

.component-score.text {
    border-left: 3px solid #10b981;
}

/* Simplified Block Match Indicator */
.block-match-indicator {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #e5e7eb;
}

.best-match-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8125rem;
}

.best-match-text {
    color: #374151;
    font-weight: 500;
}

.match-percent {
    color: #059669;
    font-weight: 700;
    margin-left: 6px;
}

.btn-text-link {
    background: none;
    border: none;
    color: #6366f1;
    font-size: 0.8125rem;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.2s;
}

.btn-text-link:hover {
    background: #f0f1ff;
    color: #4f46e5;
}

/* Expandable Block Details Animation */
.block-scores-expanded .block-scores-container {
    animation: expandDown 0.3s ease-out;
}

@keyframes expandDown {
    from {
        max-height: 0;
        opacity: 0;
    }
    to {
        max-height: 500px;
        opacity: 1;
    }
}

/* Responsive adjustments for score display */
@media (max-width: 768px) {
    .score-component {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .score-bar {
        width: 100%;
    }
    
    .block-scores-mini {
        font-size: 0.75rem;
    }
}

/* ==========================================
   Source-Based Comparison Styling
   ========================================== */

/* Source Drawing Indicators */
.source-drawing {
    position: relative;
    border-left: 4px solid #FD6401; /* Bruviti orange */
    background-color: rgba(253, 100, 1, 0.05);
}

.source-badge {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    background-color: #FD6401;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Comparison Dropdown Styling */
#comparisonDropdown .dropdown-content li:hover {
    background-color: #F3F8F9;
}

#comparisonDropdown .dropdown-content li a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    transition: all 0.2s ease;
}

#comparisonDropdown .dropdown-content li a:hover {
    background-color: #F3F8F9;
    color: #02365D;
}

/* Source-based comparison results styling */
.source-comparison-results .source-header {
    background-color: #F3F8F9;
    border: 1px solid #FD6401;
    border-radius: 0.5rem;
}

.source-comparison-results .comparison-card {
    border: 1px solid #E5E7EB;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

.source-comparison-results .comparison-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.source-comparison-results .differences-list {
    margin-top: 0.75rem;
}

.source-comparison-results .difference-item {
    padding: 0.5rem;
    background-color: #F8FAFC;
    border-radius: 0.25rem;
    margin-bottom: 0.5rem;
    border-left: 3px solid #E5E7EB;
}

.source-comparison-results .difference-item.value-mismatch {
    border-left-color: #FD6401;
}

.source-comparison-results .difference-item.missing-in-comparison {
    border-left-color: #EF4444;
}

.source-comparison-results .difference-item.extra-in-comparison {
    border-left-color: #10B981;
}

/* Mobile responsiveness for source indicators */
@media (max-width: 768px) {
    .source-badge {
        font-size: 0.625rem;
        padding: 0.125rem 0.5rem;
        top: 0.25rem;
        left: 0.25rem;
    }
    
    .source-drawing {
        border-left-width: 3px;
    }
}

/* Enhanced Source Comparison Table Styling */
.source-comparison-results .comparison-table th.bg-orange-50 {
    border: 2px solid #FD6401;
    border-bottom: 3px solid #FD6401;
    position: relative;
}

.source-comparison-results .comparison-table th.bg-orange-50::before {
    content: '★';
    position: absolute;
    top: 2px;
    right: 4px;
    color: #FD6401;
    font-size: 0.75rem;
}

/* Source value cells highlighting */
.source-comparison-results .comparison-table td[style*="rgba(253, 100, 1, 0.08)"] {
    border-left: 3px solid #FD6401;
    font-weight: 700;
}

/* Different comparison value highlighting */
.source-comparison-results .comparison-table td[style*="rgba(239, 68, 68, 0.08)"] {
    border-left: 3px solid #EF4444;
}

.source-comparison-results .comparison-table td[style*="rgba(34, 197, 94, 0.08)"] {
    border-left: 3px solid #22C55E;
}

.source-comparison-results .comparison-table td[style*="rgba(59, 130, 246, 0.08)"] {
    border-left: 3px solid #3B82F6;
}

.source-comparison-results .comparison-table td[style*="rgba(251, 191, 36, 0.08)"] {
    border-left: 3px solid #FBBF24;
}

/* Checkmark styling */
.source-comparison-results .text-green-600 {
    font-size: 1.125rem;
}

/* Center-align checkmarks and special text */
.source-comparison-results .text-center {
    text-align: center;
}

/* Similarity score badges */
.similarity-score-high {
    background-color: #10B981;
    color: white;
}

.similarity-score-medium {
    background-color: #F59E0B;
    color: white;
}

.similarity-score-low {
    background-color: #EF4444;
    color: white;
}

/* Enhanced source header */
.source-header {
    position: relative;
    overflow: hidden;
}

.source-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #FD6401, #FF9514, #FD6401);
    animation: sourceGlow 3s ease-in-out infinite;
}

@keyframes sourceGlow {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

/* Component Scores Styling */
.component-scores-container {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.score-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.score-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.score-icon {
    font-size: 14px;
}

.drawing-score {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.parts-score {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.text-score {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.overall-score {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    color: white;
    font-weight: 600;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

/* Legacy scores fallback styling */
.legacy-scores {
    display: flex;
    gap: 15px;
    margin-top: 8px;
    font-size: 14px;
}

.visual-match {
    color: #667eea;
    font-weight: 500;
}

.metadata-similarity {
    color: #4facfe;
    font-weight: 500;
}

/* Comparison header improvements */
.comparison-header {
    padding: 12px;
    background: rgba(248, 250, 252, 0.5);
    border-radius: 8px;
    margin-bottom: 12px;
}

.compared-with {
    display: block;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
    font-size: 14px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .component-scores-container {
        gap: 6px;
    }
    
    .score-badge {
        font-size: 12px;
        padding: 4px 8px;
    }
    
    .score-icon {
        font-size: 12px;
    }
}