/* Deck Comparison Styles */

/* Checkbox column in table */
.deck-select-checkbox {
    width: 30px;
    text-align: center;
}

.deck-select-checkbox input[type="checkbox"] {
    cursor: pointer;
    width: 18px;
    height: 18px;
}

/* Compare button */
#compareDecksBtn {
    transition: all 0.3s ease;
}

#compareDecksBtn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Modal styling */
#deckComparisonModal .modal-dialog {
    max-width: 95%;
}

/* Deck stats badges */
.deck-stats {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.deck-stats .badge {
    font-size: 0.9rem;
    padding: 0.5rem 0.75rem;
}

/* Card difference lists */
.card-difference-list {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 1rem;
    background-color: #f8f9fa;
}

.card-difference-list:empty::before {
    content: "No differences found";
    color: #6c757d;
    font-style: italic;
}

.card-diff-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    background-color: white;
    border-radius: 0.25rem;
    border-left: 3px solid transparent;
}

.card-diff-item.only-deck1 {
    border-left-color: #0d6efd;
}

.card-diff-item.only-deck2 {
    border-left-color: #198754;
}

.card-diff-item.different-quantity {
    border-left-color: #ffc107;
}

.card-diff-item .card-name {
    font-weight: 500;
    flex-grow: 1;
}

.card-diff-item .card-quantity {
    font-weight: bold;
    color: #495057;
    margin-left: 1rem;
}

.card-diff-item .quantity-comparison {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.card-diff-item .quantity-comparison .deck1-qty {
    color: #0d6efd;
    font-weight: bold;
}

.card-diff-item .quantity-comparison .deck2-qty {
    color: #198754;
    font-weight: bold;
}

.card-diff-item .quantity-comparison .arrow {
    color: #6c757d;
}

/* Decklist container for side-by-side view */
.decklist-container {
    max-height: 600px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 1rem;
    background-color: #f8f9fa;
}

.decklist-container .card-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.25rem 0.5rem;
    margin-bottom: 0.25rem;
    background-color: white;
    border-radius: 0.25rem;
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.9rem;
}

.decklist-container .card-item .card-name {
    flex-grow: 1;
}

.decklist-container .card-item .card-quantity {
    margin-left: auto;
    padding-left: 1rem;
    white-space: nowrap;
}

.decklist-container .card-section-title {
    font-weight: bold;
    color: #495057;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    padding-bottom: 0.25rem;
    border-bottom: 2px solid #dee2e6;
}

.decklist-container .card-section-title:first-child {
    margin-top: 0;
}

/* GitHub-style diff highlighting for side-by-side view */
.decklist-container .card-item.diff-removed {
    background-color: #ffeef0;
    border-left: 3px solid #d73a49;
}

.decklist-container .card-item.diff-added {
    background-color: #e6ffed;
    border-left: 3px solid #28a745;
}

.decklist-container .card-item.diff-modified {
    background-color: #fff5b1;
    border-left: 3px solid #ffc107;
}

.decklist-container .card-item.diff-unchanged {
    background-color: #ffffff;
    opacity: 0.7;
}

/* Hover effects for diff items */
.decklist-container .card-item.diff-removed:hover {
    background-color: #ffdce0;
}

.decklist-container .card-item.diff-added:hover {
    background-color: #d4f8dd;
}

.decklist-container .card-item.diff-modified:hover {
    background-color: #ffe69c;
}

.decklist-container .card-item.diff-unchanged:hover {
    opacity: 1;
    background-color: #f8f9fa;
}

/* Legacy classes for backwards compatibility */
.decklist-container .card-item.in-both {
    background-color: #d1ecf1;
}

.decklist-container .card-item.quantity-diff {
    background-color: #fff3cd;
}

/* Enhanced quantity display for modified cards */
.decklist-container .card-item.diff-modified .card-quantity {
    font-weight: bold;
    color: #856404;
}

.decklist-container .card-item.diff-removed .card-name {
    color: #6a1b1b;
}

.decklist-container .card-item.diff-added .card-name {
    color: #155724;
}

/* Add subtle icons to diff items */
.decklist-container .card-item.diff-removed::before {
    content: '−';
    margin-right: 0.5rem;
    color: #d73a49;
    font-weight: bold;
}

.decklist-container .card-item.diff-added::before {
    content: '+';
    margin-right: 0.5rem;
    color: #28a745;
    font-weight: bold;
}

.decklist-container .card-item.diff-modified::before {
    content: '±';
    margin-right: 0.5rem;
    color: #ffc107;
    font-weight: bold;
}

.decklist-container .card-item.diff-unchanged::before {
    content: ' ';
    margin-right: 0.5rem;
    display: inline-block;
    width: 1em;
}

/* Statistics table styling */
.table-sm tbody tr td:first-child {
    font-weight: 500;
}

.stat-better {
    color: #198754;
    font-weight: bold;
}

.stat-worse {
    color: #dc3545;
    font-weight: bold;
}

/* Mana symbols in modal */
#deckComparisonModal .mana-symbols {
    display: flex;
    justify-content: center;
    gap: 0.25rem;
}

/* Scrollbar styling for lists */
.card-difference-list::-webkit-scrollbar,
.decklist-container::-webkit-scrollbar {
    width: 8px;
}

.card-difference-list::-webkit-scrollbar-track,
.decklist-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.card-difference-list::-webkit-scrollbar-thumb,
.decklist-container::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.card-difference-list::-webkit-scrollbar-thumb:hover,
.decklist-container::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Deck name link in chart selector */
.deck-name-link {
    cursor: pointer;
    color: #0d6efd;
    transition: all 0.2s ease;
    border-bottom: 1px dotted #0d6efd;
}

.deck-name-link:hover {
    color: #0a58ca;
    border-bottom: 1px solid #0a58ca;
}

/* Deck view modal */
#deckViewModal .card-list {
    padding: 0.5rem 0;
}

#deckViewModal .card-list .card-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.25rem 0.5rem;
    margin-bottom: 0.25rem;
    background-color: #f8f9fa;
    border-radius: 0.25rem;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.9rem;
}

#deckViewModal .card-list .card-item .card-name {
    flex-grow: 1;
}

#deckViewModal .card-list .card-item .card-quantity {
    margin-left: auto;
    padding-left: 1rem;
    white-space: nowrap;
    font-weight: bold;
    color: #495057;
}

#deckViewModal .mana-symbols {
    display: flex;
    justify-content: center;
    gap: 0.25rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #deckComparisonModal .modal-dialog {
        max-width: 100%;
        margin: 0.5rem;
    }

    .card-difference-list,
    .decklist-container {
        max-height: 300px;
    }
}
