/* comparison.css - Fixed Version */

/* General Styles */
.comparison-select,
.comparison-input {
    position: relative;
}

.comparison-select:focus,
.comparison-input:focus {
    border-color: #146c94 !important;
    outline: none !important;
    box-shadow: 0 0 0 4px rgba(20, 108, 148, 0.2) !important;
}

.comparison-select:disabled,
.comparison-input:disabled {
    background-color: #f3f4f6;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Fix Double Arrow in Select */
.comparison-select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: none !important;
    padding-right: 1rem !important;
    padding-left: 2.5rem !important;
}

.comparison-select::-ms-expand {
    display: none;
}

/* Fix Icon Position */
.comparison-select + i,
.comparison-input + i {
    pointer-events: none;
    z-index: 1;
}

/* Tab Active State */
.comparison-tab.active {
    background: linear-gradient(135deg, #146c94 0%, #19a7ce 100%) !important;
    color: white !important;
    border-color: transparent !important;
}

/* Tab Content */
.tab-content {
    animation: fadeInUp 0.4s ease-out;
}

.tab-content.hidden {
    display: none;
}

/* Compare Button Fix */
.compare-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    min-width: 280px;
}

.compare-btn i {
    display: inline-block;
    margin-left: 0.75rem;
    flex-shrink: 0;
}

.compare-btn:hover:not(:disabled) {
    transform: scale(1.05);
}

.compare-btn:active:not(:disabled) {
    transform: scale(0.98);
}

/* Table Styles */
#comparisonTable tbody tr {
    transition: all 0.3s ease;
}

#comparisonTable tbody tr:hover {
    background: linear-gradient(to left, #eff6ff, #ede9fe);
    transform: translateY(-1px);
}

#comparisonTable tbody tr.selected-row {
    background: linear-gradient(to right, #dbeafe, #e0e7ff) !important;
    border-left: 4px solid #146c94;
}

/* Checkbox in Table */
.table-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #146c94;
}

/* Comparison Cards in Result Page - FIXED */
.comparison-article-card {
    animation: slideInUp 0.5s ease-out;
    transition: all 0.3s ease;
    margin-bottom: 2rem;
}

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

/* Text Highlights - IMPROVED */
.prose {
    max-width: 100%;
}

.prose p {
    margin-bottom: 1rem;
    line-height: 2;
    text-align: justify;
    word-wrap: break-word;
}

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

.prose span {
    display: inline;
    word-break: keep-all;
}

/* Better Text Highlighting */
.bg-green-100 {
    background-color: #d1fae5 !important;
    color: #065f46 !important;
    padding: 2px 4px;
    border-radius: 4px;
}

.bg-red-100 {
    background-color: #fee2e2 !important;
    color: #991b1b !important;
    padding: 2px 4px;
    border-radius: 4px;
}

.bg-yellow-100 {
    background-color: #fef3c7 !important;
    color: #92400e !important;
    padding: 2px 4px;
    border-radius: 4px;
}

.text-red-600 {
    color: #dc2626 !important;
}

.line-through {
    text-decoration: line-through !important;
}

/* Grid Layout Fix for Result Page */
.comparison-article-card .grid {
    display: grid;
}

@media (min-width: 768px) {
    .comparison-article-card .grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.comparison-article-card .border-l {
    border-left-width: 1px;
    border-color: #e5e7eb;
}

/* Active Nav Indicator */
nav a[href="lexicomparison"],
nav a[href="comparison-result"] {
    position: relative;
}

nav a[href="lexicomparison"]::after,
nav a[href="comparison-result"]::after {
    content: "";
    position: absolute;
    bottom: -8px;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(to right, #146c94, #19a7ce);
    border-radius: 3px 3px 0 0;
}

/* Navigation Buttons Fix */
.nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.nav-btn:hover:not(:disabled) {
    transform: translateY(-2px);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.animate-fadeIn {
    animation: fadeIn 0.3s ease-out;
}

/* Loading State */
.loading-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Sticky Legend */
.sticky {
    position: -webkit-sticky;
    position: sticky;
}

/* Comparison Badges */
.comparison-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 600;
    margin: 2px;
    white-space: nowrap;
}

.comparison-badge.epc {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
}

.comparison-badge.pc {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.comparison-badge.ep {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

.comparison-badge.available {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
}

/* Responsive Adjustments */
@media (max-width: 1024px) {
    .sticky {
        position: relative;
        top: auto !important;
    }

    .comparison-article-card .grid {
        grid-template-columns: 1fr;
    }

    .comparison-article-card .border-l {
        border-left: none;
        border-top: 1px solid #e5e7eb;
    }
}

@media (max-width: 768px) {
    .comparison-tab {
        font-size: 0.875rem;
        padding: 0.75rem 1rem;
    }

    .nav-btn,
    .compare-btn {
        font-size: 0.875rem;
        padding: 0.75rem 1rem;
        min-width: auto;
    }

    .compare-btn {
        width: 100%;
    }
}

/* Custom Scrollbar */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 10px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, #3b82f6, #8b5cf6);
    border-radius: 10px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(to bottom, #2563eb, #7c3aed);
}

/* Selection Color */
::selection {
    background-color: rgba(20, 108, 148, 0.3);
    color: inherit;
}

/* Focus Visible */
*:focus-visible {
    outline: 3px solid rgba(20, 108, 148, 0.5);
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .nav-btn,
    .compare-btn,
    nav,
    footer {
        display: none !important;
    }

    .comparison-article-card {
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid #e5e7eb;
    }
}
/* Fix Contract Selection Border Colors */
.bg-gradient-to-br.from-blue-50 {
    border-color: rgba(20, 108, 148, 0.3) !important;
}

/* Alternative: Target specific containers */
#specificationsTab .rounded-2xl.border-2 {
    border-color: rgba(20, 108, 148, 0.3) !important;
    transition: border-color 0.3s ease;
}

#specificationsTab .rounded-2xl.border-2:hover {
    border-color: rgba(20, 108, 148, 0.5) !important;
}
