/*
 * Modal profissional para detalhes de cartas no TCGdex MyCollection.
 */

.tcgdex-modal-overlay {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 15, 25, 0.82);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    padding: 24px;
}
.tcgdex-modal-overlay.active {
    display: flex;
}
.tcgdex-modal {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 0;
    max-width: 920px;
    width: min(92vw, 920px);
    max-height: 88vh;
    overflow: hidden;
    color: #1f2937;
    box-shadow: 0 28px 90px rgba(15, 23, 42, 0.36);
}
.tcgdex-modal-header {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 22px;
    background: #ffffff;
    border-bottom: 1px solid #eef2f7;
}
.tcgdex-modal-header h2 {
    margin: 0;
    font-size: clamp(1.45rem, 3vw, 2rem);
    line-height: 1.1;
    color: #111827;
    font-weight: 800;
}
.tcgdex-modal-close {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #f3f7fb;
    border: 1px solid #dbe7f3;
    color: #1f2937;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.tcgdex-modal-close:hover {
    color: #ffffff;
    background: #0175D0;
    border-color: #0175D0;
}
.tcgdex-modal-body {
    display: grid;
    grid-template-columns: minmax(240px, 340px) minmax(0, 1fr);
    gap: 22px;
    padding: 22px;
    max-height: calc(88vh - 76px);
    overflow-y: auto;
    background: linear-gradient(180deg, #ffffff 0%, #f7faff 100%);
}
.tcgdex-modal-media {
    align-self: start;
    background: #f4f7fb;
    border: 1px solid #e1e8f0;
    border-radius: 14px;
    padding: 14px;
    text-align: center;
}
.tcgdex-modal-body img {
    max-width: 100%;
    width: 100%;
    height: auto;
    object-fit: contain;
    margin: 0 auto;
    display: block;
    border-radius: 12px;
}
.tcgdex-modal-details {
    min-width: 0;
}
.tcgdex-modal-body .card-info {
    display: grid;
    gap: 10px;
    font-size: 0.95rem;
    line-height: 1.45;
}
.tcgdex-info-row {
    display: grid;
    grid-template-columns: 140px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    padding: 10px 12px;
    background: #ffffff;
    border: 1px solid #e8eef6;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}
.tcgdex-info-row:nth-child(even) {
    background: #f7faff;
}
.tcgdex-info-label {
    color: #0175D0;
    font-weight: 800;
}
.tcgdex-info-value {
    color: #1f2937;
    overflow-wrap: anywhere;
}
.tcgdex-info-row-block {
    grid-template-columns: 1fr;
    gap: 6px;
}
.tcgdex-info-section {
    display: grid;
    gap: 8px;
    padding: 12px;
    background: #eef6fd;
    border: 1px solid #d4e8f8;
    border-radius: 12px;
}
.tcgdex-info-section h3 {
    margin: 0 0 2px;
    color: #111827;
    font-size: 1rem;
    font-weight: 800;
}
.tcgdex-info-section .tcgdex-info-row {
    box-shadow: none;
}
@media (max-width: 760px) {
    .tcgdex-modal {
        width: 95vw;
        max-height: 90vh;
    }
    .tcgdex-modal-body {
        grid-template-columns: 1fr;
        padding: 16px;
        max-height: calc(90vh - 72px);
    }
    .tcgdex-modal-media {
        max-width: 360px;
        width: 100%;
        margin: 0 auto;
    }
    .tcgdex-info-row {
        grid-template-columns: 1fr;
        gap: 4px;
    }
}
