/* ============================================================
   Entity Detail Pages — Publisher / Developer
   CineStream SaaS — Game catalog with cover art
   ============================================================ */

/* ── Page Container ──────────────────────────────────────── */
.entity-detail {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem 3rem;
}

/* ── Page Header ───────────────────────────────────────── */
.entity-detail__header {
    padding: 2rem 0 1.25rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.5rem;
    justify-content: space-between;
    display: flex;
}

.entity-detail__header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    line-height: 1.2;
    margin-bottom: 0.5rem;
}

.entity-detail__desc {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-secondary);
    max-width: 720px;
}

/* ── Stats Row ─────────────────────────────────────────── */
.entity-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.entity-stats .stat-block {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1rem;
    transition: all var(--transition-fast);
    text-align: center;
}

.entity-stats .stat-block:hover {
    border-color: var(--border-bright);
    background: var(--bg-hover);
}

.entity-stats .stat-block--locked {
    opacity: 0.5;
    border-style: dashed;
}

.entity-stats .stat-label {
    display: block;
    font-size: 0.625rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.375rem;
}

.entity-stats .stat-value {
    display: block;
    font-family: var(--font-data);
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.entity-stats .stat-value--revenue {
    color: var(--green);
    font-weight: 600;
}

.entity-stats .stat-value--locked {
    color: var(--text-muted);
    font-size: 0.875rem;
    letter-spacing: 0.15em;
}

/* ── Table with Cover Images ───────────────────────────── */
.entity-detail .table-wrap {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    overflow-x: auto;
    margin-bottom: 1.5rem;
}

/* Cover cell */
.cover-cell {
    width: 56px;
    padding: 0.625rem 0.5rem 0.625rem 1rem !important;
    vertical-align: middle;
}

.table-cover {
    width: 60px;
    height: 28px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    transition:
        transform var(--transition-fast),
        box-shadow var(--transition-fast);
    display: block;
}

.cover-cell a:hover .table-cover {
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
}

/* Game name link */
.game-link {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    transition: color var(--transition-fast);
}

.game-link:hover {
    color: var(--accent);
}

/* Dimmed cells (year, review count) */
.dim {
    color: var(--text-muted);
}

/* Price badge in table */
.entity-detail .price-badge {
    display: inline;
    background: var(--green-subtle);
    color: var(--green);
    font-size: 0.6875rem;
    font-weight: 700;
    padding: 0.1rem 0.35rem;
    border-radius: var(--radius-sm);
    margin-right: 0.35rem;
}

/* ── Conditional Coloring (reused from taxonomy.css) ──── */
.val-high {
    color: var(--green);
    font-weight: 600;
}
.val-good {
    color: #0ea5e9;
    font-weight: 500;
}
.val-mid {
    color: var(--text-data);
}
.val-low {
    color: var(--amber);
    font-weight: 500;
}
.val-poor {
    color: var(--red);
    font-weight: 500;
}

.score-excellent {
    color: var(--green);
    font-weight: 600;
}
.score-good {
    color: #0ea5e9;
    font-weight: 500;
}
.score-mid {
    color: var(--amber);
    font-weight: 500;
}
.score-poor {
    color: var(--red);
    font-weight: 500;
}

.review-high {
    color: var(--green);
    font-weight: 500;
}
.review-mid {
    color: var(--text-data);
}
.review-low {
    color: var(--text-muted);
}

/* ── Alternating Rows ──────────────────────────────────── */
.entity-detail .data-table tbody tr:nth-child(even) td {
    background: rgba(99, 102, 241, 0.04);
}

.entity-detail .data-table tbody tr:nth-child(even):hover td {
    background: var(--bg-hover);
}

@media (prefers-color-scheme: dark) {
    .entity-detail .data-table tbody tr:nth-child(even) td {
        background: rgba(129, 140, 248, 0.04);
    }
    .entity-detail .data-table tbody tr:nth-child(even):hover td {
        background: var(--bg-hover);
    }
}

/* ── Pagination ────────────────────────────────────────── */
.entity-detail .pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 0;
}

.page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    background: var(--bg-surface);
    border: 1px solid var(--border);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.page-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-bright);
}

.page-info {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-family: var(--font-data);
    padding: 0 0.5rem;
}

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 768px) {
    .entity-detail__header h1 {
        font-size: 1.375rem;
    }
    .entity-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    .cover-cell {
        width: 44px;
        padding: 0.5rem 0.375rem 0.5rem 0.75rem !important;
    }
    .table-cover {
        width: 36px;
        height: 48px;
    }
    .entity-detail .data-table {
        font-size: 0.8125rem;
    }
    .entity-detail .data-table thead th,
    .entity-detail .data-table tbody td {
        padding: 0.625rem 0.5rem;
    }
}
