.compare-page {
    min-height: 100vh;
    font-family: 'Nunito', sans-serif;
    color: #0f172a;
}

.compare-page-container {
    max-width: 1800px;
    margin: 0 auto;
    padding: 60px 24px 100px;
}

cp-compare {
    display: block;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    overflow-x: auto;
    overflow-y: hidden;
    position: relative;
    width: 100%;
}

cp-compare::-webkit-scrollbar { height: 6px; }
cp-compare::-webkit-scrollbar-track { background: transparent; }
cp-compare::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
cp-compare::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

.compare-header, cp-compare-row {
    display: flex;
    flex-wrap: nowrap;
    width: max-content;
    min-width: 100%;
}

.compare-header::before {
    content: "";
    width: 252px;
    flex-shrink: 0;
    position: sticky;
    left: 0;
    background: #ffffff;
    z-index: 20;
    border-right: 1px solid #e2e8f0;
}

cp-match-indicator {
    width: 4px;
    flex-shrink: 0;
    position: sticky;
    left: 0;
    background-color: #e2e8f0;
    z-index: 20;
    transition: background-color 0.3s ease;
}

cp-match-indicator.is-match { background-color: #c1d82f; }
cp-match-indicator.is-diff { background-color: #f87171; }

cp-compare-label {
    width: 200px;
    flex-shrink: 0;
    position: sticky;
    left: 4px;
    background: #ffffff;
    z-index: 20;
    display: flex;
    align-items: center;
    padding: 0 24px;
    border-right: 1px solid #e2e8f0;
}

cp-compare-label span {
    font-size: 0.8rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}


.compare-header {
    padding: 24px 0 24px 0;
    border-bottom: 1px solid #e2e8f0;
}

cp-compare-item {
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex-shrink: 0;
    width: 280px;
    padding: 0 24px;
    border-right: 1px solid transparent;
}

cp-compare-item.dragging {
    opacity: 0.4;
}

.compare_item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.compare_item-opt {
    display: flex;
    align-items: center;
    gap: 12px;
}

.compare_item-move {
    background: transparent;
    border: none;
    color: #cbd5e1;
    cursor: grab;
    padding: 4px;
    display: flex;
    align-items: center;
    transition: color 0.2s;
}
.compare_item-move:hover { color: #0f172a; }
.compare_item-move:active { cursor: grabbing; }

.compare_item-count {
    font-size: 0.85rem;
    font-weight: 800;
    color: #94a3b8;
}

.compare_item-delete {
    background: transparent;
    color: #cbd5e1;
    border: none;
    width: 28px;
    height: 28px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
}
.compare_item-delete:hover { background: #fee2e2; color: #ef4444; }

.compare_item-content {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.compare_item-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 8px;
    overflow: hidden;
    background: #f1f5f9;
}
.compare_item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.compare_item-name h2 {
    font-size: 1.15rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
    line-height: 1.4;
}

cp-compare-row {
    border-bottom: 1px solid #f1f5f9;
    transition: background-color 0.2s;
}
cp-compare-row:hover { background-color: #f8fafc; }
cp-compare-row:hover cp-compare-label { background-color: #f8fafc; }
cp-compare-row:last-child { border-bottom: none; }

cp-compare-value {
    width: 280px;
    flex-shrink: 0;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.05rem;
    font-weight: 600;
    color: #334155;
}

cp-compare-value small {
    color: #94a3b8;
    font-size: 0.9rem;
    margin-left: 2px;
}

.compare_value-img.flag-img {
    width: 24px;
    height: 18px;
    border-radius: 3px;
    object-fit: cover;
    border: 1px solid #e2e8f0;
}

.compare_value-badge.diff-badge {
    background: #0f172a;
    color: #ffffff;
    width: 32px;
    height: 32px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 6px;
    font-weight: 800;
    font-size: 1rem;
}

.cp-context-menu {
    position: fixed;
    z-index: 10000;
    width: 280px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    border: 1px solid #e2e8f0;
    padding: 8px 0;
    margin: 0;
    list-style: none;
    display: none;
    font-size: 0.95rem;
    font-weight: 600;
}

.cp-context-menu.show { display: block; }

.cp-context-menu li {
    padding: 12px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    color: #334155;
    transition: background 0.2s;
}

.cp-context-menu li:hover { background: #f8fafc; }
.cp-context-menu .menu-icon { margin-right: 12px; display: flex; align-items: center; color: #64748b; }
.cp-context-menu .menu-text { flex-grow: 1; user-select: none; }
.cp-context-menu .menu-divider { height: 1px; background: #e2e8f0; margin: 6px 0; padding: 0; cursor: default; }

.cp-toggle {
    width: 38px;
    height: 22px;
    background-color: #cbd5e1;
    border-radius: 20px;
    position: relative;
    transition: background-color 0.3s ease;
    flex-shrink: 0;
}

.cp-toggle::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.cp-toggle.active { background-color: #10b981; }
.cp-toggle.active::after { transform: translateX(16px); }

.cp-checkbox {
    width: 22px;
    height: 22px;
    border: 2px solid #cbd5e1;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
    background-color: transparent;
}

.cp-checkbox svg {
    width: 14px;
    height: 14px;
    color: white;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.2s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.cp-checkbox.active {
    background-color: #3b82f6;
    border-color: #3b82f6;
}

.cp-checkbox.active svg {
    opacity: 1;
    transform: scale(1);
}

cp-compare-value.is-best {
    background: rgba(251, 191, 36, 0.15);
    border-left: 3px solid #fbbf24;
}

cp-compare-value.is-manual-highlight {
    background: rgba(59, 130, 246, 0.15);
    border-left: 3px solid #3b82f6;
}

cp-compare.hide-matches cp-compare-row.is-matching-row {
    display: none !important;
}

cp-compare.show-tooltips cp-compare-label[data-tooltip] {
    cursor: help;
    position: relative;
}

cp-compare.show-tooltips cp-compare-label[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 24px;
    bottom: 100%;
    margin-bottom: 8px;
    background: #0f172a;
    color: #fff;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: normal;
    white-space: nowrap;
    z-index: 100;
    pointer-events: none;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}