@import "filters-LpKK0CJ.css";

/* Loot Attribution Page */
.loot-page {
    display: flex;
    min-height: calc(100vh - 60px);
}

.loot-content {
    flex: 1;
    padding: 2rem;
    background: var(--bg-dark);
}

/* Page Header */
.loot-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.loot-header svg {
    flex-shrink: 0;
}

.loot-header h1 {
    color: var(--text-primary);
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
}

/* Loot Table Container */
.loot-table-container {
    background: linear-gradient(145deg, var(--bg-surface-1), var(--bg-surface-2));
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    overflow: hidden;
}

/* Boss Section */
.boss-section {
    margin-bottom: 0.85rem;
}

.boss-section:last-child {
    margin-bottom: 0;
}

.boss-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    background: var(--bg-primary-subtle);
    border-bottom: 2px solid var(--border-primary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.boss-header:hover {
    background: var(--bg-primary-hover);
}

.boss-icon {
    width: 48px;
    height: 48px;
}

.boss-info {
    flex: 1;
}

.boss-name {
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
}

.boss-loot-count {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.boss-toggle {
    color: var(--color-primary);
    transition: transform 0.3s ease;
}

.boss-section.collapsed .boss-toggle {
    transform: rotate(-90deg);
}

/* Loot Table */
.loot-table {
    width: 100%;
    border-collapse: collapse;
}

.loot-table thead {
    background: var(--bg-primary-faint);
    border-bottom: 1px solid var(--border-primary);
}

.loot-table th {
    padding: 0.625rem 0.875rem;
    text-align: left;
    color: var(--color-primary);
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.loot-table th:nth-child(1) { width: 20%; } /* Item Name */
.loot-table th:nth-child(2) { width: 12%; } /* Type */
.loot-table th:nth-child(3) { width: 8%; }  /* Slot */
.loot-table th:nth-child(4) { width: 60%; max-width: 60%; } /* Characters (Gain) */

.loot-table td:nth-child(4) {
    max-width: 0; /* Force scrollbar */
}

.loot-table tbody tr {
    border-bottom: 1px solid var(--border-faint);
    transition: all 0.2s ease;
}

.loot-table tbody tr:hover {
    background: var(--bg-primary-ghost);
}

.loot-table tbody tr:last-child {
    border-bottom: none;
}

.loot-table td {
    padding: 0.625rem 0.875rem;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.boss-section.collapsed .loot-table {
    display: none;
}


/* Gains List */
.gains-inline {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
    width: 100%;
}

.gains-inline__list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    width: 100%;
}

.gains-inline__entry {
    flex: 0 0 255px;
    max-width: 255px;
}

.gains-inline__entry.is-hidden {
    display: none;
}

.gains-inline-toggle-btn {
    flex-shrink: 0;
    background: none;
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.8rem;
    padding: 0.35rem 0.85rem;
    transition: color 0.2s, border-color 0.2s;
    white-space: nowrap;
}

.gains-inline-toggle-btn:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.gain-item {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 0.375rem;
    padding: 0.25rem 0.5rem;
    background: var(--bg-input-faint);
    border: none;
    border-radius: 4px;
    box-sizing: border-box;
    min-height: 34px;
    width: 100%;
    min-width: 0;
}

.gain-item--looted {
    opacity: 0.45;
    filter: grayscale(0.6);
}

.gain-value {
    color: var(--color-success);
    font-weight: 700;
    font-size: 0.8rem;
}

.gain-separator {
    color: var(--text-placeholder);
    font-size: 0.8rem;
}

.gain-char {
    display: inline-block;
    font-weight: 600;
    font-size: 0.9rem;
    max-width: 90px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gain-char .main-star {
    color: var(--color-gold);
    margin-left: 0.2rem;
    font-size: 0.75rem;
}

.gain-spec {
    display: inline-block;
    color: var(--text-muted);
    font-size: 0.85rem;
    max-width: 74px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gain-item .wish-badge {
    flex-shrink: 0;
}

.item-icon {
    margin-right: 1em;
}

.display-item-inline {
    display: flex;
    align-items: center;
}

.display-item-inline div {
    height: 100%;
    vertical-align: center;
}

/* Grouped set items */
.set-group-names,
.set-group-gains {
    vertical-align: top;
}

.set-group-item {
    padding: 0.15rem 0;
}

.set-group-item + .set-group-item {
    border-top: 1px solid var(--border-faint);
    margin-top: 0.15rem;
    padding-top: 0.3rem;
}

.set-group-summary {
    display: flex;
    align-items: center;
}

.set-group-title {
    font-weight: 700;
    color: var(--text-primary);
}

.set-group-token-head {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.set-group-token-icon {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    border: 1px solid var(--border-subtle);
    object-fit: cover;
}

.set-group-meta {
    color: var(--text-muted);
    font-size: 0.82rem;
}

.set-group-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.55rem;
    width: 100%;
}

.set-group-toggle-btn {
    background: none;
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.65rem;
    transition: color 0.2s, border-color 0.2s;
    white-space: nowrap;
}

.set-group-toggle-btn:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.set-group-toggle-btn[aria-expanded="true"] {
    color: var(--color-primary);
    border-color: var(--color-primary);
}

.set-group-detail-row > td {
    padding: 0;
    border-top: none;
}

.set-group-detail {
    padding: 0.45rem 0.875rem 0.6rem 2.5rem;
    border-top: 1px dashed var(--border-faint);
}

.set-group-detail.is-collapsed {
    display: none;
}

.set-group-detail-grid {
    display: grid;
    grid-template-columns: minmax(220px, 34%) minmax(0, 1fr);
    gap: 0.75rem;
}

.set-group-gains-row {
    padding: 0.15rem 0;
}

.set-group-gains-row + .set-group-gains-row {
    border-top: 1px solid var(--border-faint);
    margin-top: 0.15rem;
    padding-top: 0.3rem;
}

.item-name-link {
    color: var(--color-heroic);
    font-weight: 600;
    text-decoration: none;
}

.item-name-link:hover {
    text-decoration: underline;
}

.item-type {
    color: var(--text-muted);
}

.item-set-badge {
    font-weight: 600;
}

.item-slot {
    font-weight: 600;
}

.item-id {
    color: var(--text-placeholder);
    font-family: monospace;
}

.gains-empty {
    color: var(--text-placeholder);
    font-style: italic;
}

.loot-message {
    text-align: center;
    padding: 3rem;
    color: var(--text-placeholder);
}

.loot-message--error {
    color: var(--color-error, #f44336);
}

/* Category separator rows */
.category-separator > td {
    padding: 0.6rem 0.875rem;
    background: none;
    border: none;
}

.category-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--color-primary);
}

.category-label::before,
.category-label::after {
    content: '';
    flex: 1;
    height: 2px;
    background: var(--border-primary);
}

/* Catalyst variant sub-row */
.catalyst-row > td {
    padding: 0;
    border-top: none;
}

.catalyst-section {
    padding: 0.4rem 0.875rem 0.5rem 2.5rem;
    background: transparent;
    border-top: 1px dashed var(--border-faint);
}

.catalyst-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.35rem;
}

.catalyst-label {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.03em;
}

.catalyst-meta {
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
}

.catalyst-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.55rem;
}

.catalyst-toggle-btn {
    background: none;
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.65rem;
    transition: color 0.2s, border-color 0.2s;
    white-space: nowrap;
}

.catalyst-toggle-btn:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.catalyst-toggle-btn[aria-expanded="true"] {
    color: var(--color-primary);
    border-color: var(--color-primary);
}

.catalyst-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.catalyst-list.is-collapsed {
    display: none;
}

.catalyst-item {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.catalyst-item__name {
    flex: 0 0 260px;
}

.catalyst-item__gains {
    flex: 1;
    min-width: 0;
}
