/*
 * combo-card.css — styles for static/js/combo-card.js, shared by /combos and /combos/new.
 * Moved verbatim out of templates/combos.html; pages supply the :root colour tokens
 * (--bg-card, --border-subtle, --text-*, --accent-primary).
 */

.combo-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    transition: border-color 0.15s ease;
}
.combo-card:hover { border-color: var(--border-medium); }

.combo-card-header {
    display: flex; justify-content: space-between;
    align-items: flex-start; margin-bottom: 1rem; gap: 1rem;
}
.combo-card-pieces { display: flex; gap: 0.75rem; flex-wrap: wrap; flex: 1; }

.combo-piece-img {
    /* Reserve the card's shape before the lazy image loads: no collapse, no layout
       shift, and scroll restore lands where it should. Scryfall "normal" is 488x680. */
    width: 200px; aspect-ratio: 488 / 680; height: auto; background: var(--bg-surface, #12121a); border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    transition: transform 0.15s ease; cursor: pointer;
}
.combo-piece-img:hover { transform: scale(1.08); }

.combo-piece-missing { position: relative; }
.combo-piece-missing .combo-piece-img { border: 2px solid rgba(239, 68, 68, 0.8); }

.combo-add-btn {
    display: block;
    margin: 0.35rem auto 0;
    padding: 0.25rem 0.6rem;
    background: var(--accent-primary, #8b5cf6);
    border: 1px solid var(--accent-primary, #8b5cf6);
    border-radius: 5px;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, opacity 0.15s;
}
.combo-add-btn:hover { opacity: 0.85; }
.combo-add-btn:disabled { opacity: 0.5; cursor: default; }

.combo-search-add-btn {
    align-self: stretch;
    margin-top: 0.5rem;
    padding: 0.45rem 0.75rem;
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    border: none;
    border-radius: 6px;
    color: #fff;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: filter 0.15s, box-shadow 0.15s;
}
.combo-search-add-btn:hover { filter: brightness(1.1); box-shadow: 0 4px 14px rgba(124,58,237,0.35); }

.combo-piece-price { font-size: 0.72rem; color: var(--text-secondary); margin-top: 0.25rem; text-align: center; }
.combo-piece-buy-links { display: flex; justify-content: center; gap: 0.4rem; margin-top: 0.2rem; }
.combo-buy-link {
    font-size: 0.62rem; font-weight: 600; color: #d4a017;
    text-decoration: none; padding: 0.1rem 0.35rem;
    border: 1px solid rgba(212, 160, 23, 0.3); border-radius: 4px;
    transition: background 0.15s, color 0.15s;
}
.combo-buy-link:hover { background: rgba(212, 160, 23, 0.15); color: #f0c040; border-color: rgba(212, 160, 23, 0.6); }
.combo-total-price { font-size: 0.8rem; font-weight: 600; color: #d4a017; }

.combo-card-meta {
    display: flex; flex-direction: column; align-items: flex-end;
    gap: 0.35rem; flex-shrink: 0;
}
.combo-mana-cost {
    font-size: 0.85rem; color: var(--text-secondary);
    display: flex; align-items: center; gap: 0.25rem;
}
.combo-popularity { font-size: 0.7rem; color: var(--text-muted); }
.combo-meta-label { font-size: 0.65rem; color: var(--text-muted); margin-right: 0.25rem; font-weight: 500; }

.combo-bracket {
    display: inline-flex; align-items: center;
    padding: 0.15rem 0.45rem; border-radius: 4px;
    font-size: 0.65rem; font-weight: 600; letter-spacing: 0.5px;
}
.combo-bracket.bracket-R { background: rgba(239, 68, 68, 0.2); color: #f87171; }
.combo-bracket.bracket-S { background: rgba(251, 191, 36, 0.2); color: #fbbf24; }
.combo-bracket.bracket-P { background: rgba(168, 85, 247, 0.2); color: #c084fc; }
.combo-bracket.bracket-C { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }
.combo-bracket.bracket-O { background: rgba(34, 197, 94, 0.2); color: #4ade80; }
.combo-bracket.bracket-E { background: rgba(148, 163, 184, 0.2); color: #94a3b8; }
.combo-bracket.bracket-B { background: rgba(107, 114, 128, 0.2); color: #9ca3af; }

.combo-produces { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.75rem; }
.combo-produce-tag {
    display: inline-flex; align-items: center; gap: 0.25rem;
    padding: 0.2rem 0.55rem; border-radius: 12px;
    font-size: 0.7rem; font-weight: 500;
    background: rgba(139, 92, 246, 0.15); color: #a78bfa;
    border: 1px solid rgba(139, 92, 246, 0.25);
}
.combo-produce-tag.win { background: rgba(239, 68, 68, 0.15); color: #f87171; border-color: rgba(239, 68, 68, 0.25); }
.combo-produce-tag.infinite { background: rgba(59, 130, 246, 0.15); color: #60a5fa; border-color: rgba(59, 130, 246, 0.25); }

.combo-description {
    background: var(--bg-surface); border: 1px solid var(--border-subtle);
    border-radius: 8px; padding: 0.85rem 1rem; margin-bottom: 0.75rem;
}
.combo-description-toggle {
    display: flex; align-items: center; justify-content: space-between;
    cursor: pointer; color: var(--text-secondary); font-size: 0.8rem;
    font-weight: 500; user-select: none;
}
.combo-description-toggle svg { width: 16px; height: 16px; transition: transform 0.2s ease; }
.combo-description-toggle.expanded svg { transform: rotate(180deg); }

.combo-steps {
    display: none; margin-top: 0.65rem; padding-top: 0.65rem;
    border-top: 1px solid var(--border-subtle);
}
.combo-steps.visible { display: block; }
.combo-step {
    display: flex; gap: 0.6rem; margin-bottom: 0.5rem;
    font-size: 0.8rem; color: var(--text-secondary); line-height: 1.45;
}
.combo-step-num {
    flex-shrink: 0; width: 20px; height: 20px;
    display: flex; align-items: center; justify-content: center;
    background: var(--accent-primary); color: white;
    border-radius: 50%; font-size: 0.65rem; font-weight: 700; margin-top: 1px;
}
.combo-step-text {
    flex: 1; min-width: 0; word-wrap: break-word;
}

.combo-requires-card {
    width: 200px; height: 279px;
    border-radius: 8px; border: 2px solid rgba(212, 160, 23, 0.5);
    background: linear-gradient(135deg, rgba(30, 25, 40, 0.95), rgba(20, 18, 30, 0.95));
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 1rem 0.75rem; box-sizing: border-box;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    flex-shrink: 0; align-self: flex-start;
}
.combo-requires-card-label {
    font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
    color: #d4a017; margin-bottom: 0.5rem;
    border-bottom: 1px solid rgba(212, 160, 23, 0.3); padding-bottom: 0.35rem; width: 100%; text-align: center;
}
.combo-requires-card-text {
    font-size: 0.72rem; color: var(--text-secondary, #ccc); line-height: 1.45;
    text-align: center; word-break: break-word;
}

.mana-svg { display: inline-block; width: 16px; height: 16px; vertical-align: text-bottom; }

/* New Combos additions */
.combo-piece { position: relative; }
.combo-piece-art { position: relative; display: inline-block; vertical-align: top; line-height: 0; }
/* Bottom-left, over the collector-number line: the top of a card is its name. */
.combo-piece-new-badge {
    position: absolute; bottom: 1.5%; left: 5%; z-index: 1; line-height: 1.15;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.55);
    padding: 0.1rem 0.4rem; border-radius: 4px;
    background: #22c55e; color: #052e16;
    font-size: 0.6rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
}
.combo-piece-new .combo-piece-img { outline: 2px solid rgba(34, 197, 94, 0.85); outline-offset: 2px; }

@media (max-width: 768px) {
    .combo-card-header { flex-direction: column; }
    .combo-card-meta { flex-direction: row; align-items: center; }
    .combo-piece-img { width: 100px; }
    .combo-requires-card { width: 100px; height: 140px; padding: 0.5rem 0.4rem; }
    .combo-requires-card-label { font-size: 0.6rem; }
    .combo-requires-card-text { font-size: 0.58rem; }
    .combo-buy-link { font-size: 0.55rem; padding: 0.1rem 0.25rem; }
    .combo-piece-buy-links { gap: 0.25rem; }
}
