/* ============================================
   Deck Builder Styles - The 12 Tribes™ TCG
   ============================================ */

/* -- My deck cards -- */
.my-deck-card {
    padding: 0.75rem 1rem;
    background: rgba(22, 33, 62, 0.5);
    border: 1px solid rgba(55, 65, 81, 0.5);
    border-radius: 0.75rem;
    transition: all 0.15s;
}

.my-deck-card:hover {
    background: rgba(22, 33, 62, 0.8);
    border-color: #D4A017;
    box-shadow: 0 0 12px rgba(212, 160, 23, 0.1);
}

/* -- Deck card row (in deck list) -- */
.deck-card-row {
    --fc: #6B7280;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: color-mix(in srgb, var(--fc) 4%, rgba(22, 33, 62, 0.5));
    border: 1px solid color-mix(in srgb, var(--fc) 15%, transparent);
    border-radius: 0.5rem;
    transition: all 0.15s;
    cursor: default;
}

.deck-card-row:hover {
    background: color-mix(in srgb, var(--fc) 8%, rgba(22, 33, 62, 0.8));
    border-color: color-mix(in srgb, var(--fc) 35%, transparent);
}

.deck-card-row[data-faction="kingdom"]  { --fc: #D4A017; }
.deck-card-row[data-faction="prophecy"] { --fc: #2563EB; }
.deck-card-row[data-faction="law"]      { --fc: #9CA3AF; }
.deck-card-row[data-faction="wisdom"]   { --fc: #16A34A; }
.deck-card-row[data-faction="wrath"]    { --fc: #DC2626; }
.deck-card-row[data-faction="divine"]   { --fc: #A855F7; }

.deck-card-row.dragging {
    opacity: 0.4;
    border-style: dashed;
}

.deck-card-row.drag-over {
    border-color: #D4A017;
    background: rgba(212, 160, 23, 0.1);
}

.deck-card-drag {
    color: #4B5563;
    font-size: 0.75rem;
    cursor: grab;
    user-select: none;
    letter-spacing: -1px;
    flex-shrink: 0;
    width: 1rem;
    text-align: center;
}

.deck-card-drag:active {
    cursor: grabbing;
}

.deck-card-cost {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--fc), color-mix(in srgb, var(--fc) 70%, #000));
    color: #1A1A2E;
    font-weight: 800;
    font-size: 0.65rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.deck-card-info {
    flex: 1;
    min-width: 0;
}

.deck-card-name {
    font-family: "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
    font-weight: 700;
    font-size: 0.75rem;
    color: #F3F4F6;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.deck-card-meta {
    font-size: 0.6rem;
    color: #9CA3AF;
}

.deck-card-qty {
    font-weight: 800;
    font-size: 0.75rem;
    color: var(--fc);
    min-width: 1.5rem;
    text-align: center;
}

.deck-card-controls {
    display: flex;
    align-items: center;
    gap: 0.125rem;
    flex-shrink: 0;
}

.qty-btn {
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.25rem;
    font-size: 0.7rem;
    font-weight: 700;
    color: #9CA3AF;
    background: rgba(55, 65, 81, 0.3);
    border: 1px solid rgba(55, 65, 81, 0.5);
    cursor: pointer;
    transition: all 0.15s;
}

.qty-btn:hover {
    background: rgba(55, 65, 81, 0.6);
    color: #E5E7EB;
}

.qty-minus:hover { color: #F87171; border-color: rgba(248, 113, 113, 0.3); }
.qty-plus:hover { color: #4ADE80; border-color: rgba(74, 222, 128, 0.3); }
.qty-delete:hover { color: #DC2626; border-color: rgba(220, 38, 38, 0.3); background: rgba(220, 38, 38, 0.1); }

/* -- Card browser mini cards -- */
.db-card-mini {
    --fc: #6B7280;
    background: color-mix(in srgb, var(--fc) 4%, rgba(22, 33, 62, 0.7));
    border: 1px solid color-mix(in srgb, var(--fc) 15%, transparent);
    border-radius: 0.625rem;
    padding: 0.5rem;
    transition: all 0.15s;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.db-card-mini:hover {
    border-color: color-mix(in srgb, var(--fc) 40%, transparent);
    background: color-mix(in srgb, var(--fc) 8%, rgba(22, 33, 62, 0.8));
}

.db-card-mini.in-deck {
    border-color: color-mix(in srgb, var(--fc) 40%, transparent);
    box-shadow: 0 0 8px color-mix(in srgb, var(--fc) 15%, transparent);
}

.db-card-mini[data-faction="kingdom"]  { --fc: #D4A017; }
.db-card-mini[data-faction="prophecy"] { --fc: #2563EB; }
.db-card-mini[data-faction="law"]      { --fc: #9CA3AF; }
.db-card-mini[data-faction="wisdom"]   { --fc: #16A34A; }
.db-card-mini[data-faction="wrath"]    { --fc: #DC2626; }
.db-card-mini[data-faction="divine"]   { --fc: #A855F7; }

.db-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.db-card-cost {
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--fc), color-mix(in srgb, var(--fc) 70%, #000));
    color: #1A1A2E;
    font-weight: 800;
    font-size: 0.55rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.db-card-faction-tag {
    font-size: 0.5rem;
    font-weight: 600;
    color: var(--fc);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.db-card-name {
    font-family: "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
    font-weight: 700;
    font-size: 0.65rem;
    color: #F3F4F6;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.db-card-meta {
    font-size: 0.5rem;
    color: #9CA3AF;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.db-card-stats {
    font-size: 0.5rem;
    font-weight: 700;
    display: flex;
    gap: 0.5rem;
}

.db-add-btn {
    margin-top: auto;
    padding: 0.25rem 0;
    background: color-mix(in srgb, var(--fc) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--fc) 25%, transparent);
    border-radius: 0.375rem;
    color: var(--fc);
    font-size: 0.55rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
    text-align: center;
}

.db-add-btn:hover {
    background: color-mix(in srgb, var(--fc) 25%, transparent);
    border-color: var(--fc);
}

/* -- Toast notification -- */
.db-toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-size: 0.8rem;
    font-weight: 600;
    z-index: 200;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
}

.db-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.db-toast-success {
    background: rgba(22, 163, 74, 0.9);
    color: white;
    border: 1px solid rgba(74, 222, 128, 0.3);
}

.db-toast-error {
    background: rgba(220, 38, 38, 0.9);
    color: white;
    border: 1px solid rgba(248, 113, 113, 0.3);
}

.db-toast-info {
    background: rgba(37, 99, 235, 0.9);
    color: white;
    border: 1px solid rgba(96, 165, 250, 0.3);
}

/* -- Deck scrollbar -- */
.deck-scrollbar::-webkit-scrollbar { width: 5px; }
.deck-scrollbar::-webkit-scrollbar-track { background: transparent; }
.deck-scrollbar::-webkit-scrollbar-thumb { background: #374151; border-radius: 3px; }
.deck-scrollbar::-webkit-scrollbar-thumb:hover { background: #4B5563; }

/* -- Page buttons (reuse from cards.css pattern) -- */
.page-btn {
    min-width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
    transition: all 0.15s;
    border: 1px solid #374151;
    color: #9CA3AF;
    background: #16213E;
    cursor: pointer;
}

.page-btn:hover:not(:disabled):not(.active) {
    background: #1E3A5F;
    border-color: #4B5563;
    color: #E5E7EB;
}

.page-btn.active {
    background: linear-gradient(135deg, #D4A017, #A67C00);
    color: #1A1A2E;
    font-weight: 700;
    border-color: #D4A017;
}

.page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* -- Responsive adjustments -- */
@media (max-width: 639px) {
    .deck-card-controls {
        gap: 0.0625rem;
    }
    .qty-btn {
        width: 1.25rem;
        height: 1.25rem;
        font-size: 0.6rem;
    }
    .deck-card-name {
        font-size: 0.65rem;
    }
    .db-card-mini {
        padding: 0.375rem;
    }
}
