body {
    overflow-y: scroll; /* Force scrollbar */
}

.deck-builder-container {
    display: flex;
    height: calc(100vh - 150px); /* Adjust based on header height */
    overflow: hidden;
}

.deck-panel {
    width: 300px;
    background-color: #1e1e1e;
    padding: 10px;
    border-right: 1px solid #333;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    flex-shrink: 0;
}

.deck-stats {
    margin-bottom: 20px;
    border-bottom: 1px solid #444;
    padding-bottom: 10px;
}

.deck-stats.invalid {
    color: red;
}
.deck-stats.valid {
    color: green;
}

#deckValidationStatus {
    font-weight: bold;
    margin: 5px 0;
}

#deckValidationStatus.invalid {
    color: #ff6b6b;
}

#deckValidationStatus.valid {
    color: #51cf66;
}

.deck-lists {
    flex-grow: 1;
    overflow-y: auto;
}

.deck-card-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

/* Updated Deck List Item Styles */
.deck-card-item {
    display: flex;
    align-items: center;
    background-color: #2c2c2c;
    padding: 5px;
    border-radius: 4px;
    font-size: 0.9em;
    cursor: pointer; /* Clickable */
    transition: background-color 0.2s;
}

.deck-card-item:hover {
    background-color: #383838;
}

.deck-card-thumb {
    width: 40px;
    height: auto;
    border-radius: 2px;
    margin-right: 10px;
    object-fit: contain;
}

.deck-card-info {
    flex-grow: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.deck-card-item .card-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: bold;
    font-size: 0.95em;
}

.deck-card-item .card-id {
    font-size: 0.8em;
    color: #aaa;
}

.deck-card-quantity {
    font-weight: bold;
    color: #4CAF50;
    margin: 0 10px;
    min-width: 20px;
    text-align: right;
}

.remove-btn {
    background-color: #ff4d4d;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    padding: 5px 8px; /* Larger hit area */
    font-weight: bold;
    margin-left: 5px;
}

.remove-btn:hover {
    background-color: #ff3333;
}

.card-selection-panel {
    flex-grow: 1;
    padding: 10px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    padding: 10px;
}

.card {
    border: 1px solid #444;
    border-radius: 8px;
    padding: 5px;
    text-align: center;
    background-color: #222;
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.card img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

.card-quantity {
    font-size: 0.9em;
    margin-top: 5px;
    color: #aaa;
}

.card-quantity.active {
    color: #4CAF50;
    font-weight: bold;
}

.add-btn {
    margin-top: 5px;
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    width: 100%;
}

.add-btn:hover {
    background-color: #45a049;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .deck-builder-container {
        flex-direction: column;
        height: auto;
        overflow: visible;
    }

    .deck-panel {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #333;
        max-height: 300px;
    }

    .card-selection-panel {
        height: auto;
    }
}
