/* Loot Table Page — aligned with Build Planner theme */

.loot-table-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
}

.loot-table-header {
    text-align: center;
    margin-bottom: 2rem;
}

.loot-table-header h1 {
    font-family: var(--font-heading, 'OldFenris', serif);
    font-size: 2.2rem;
    color: var(--gold, #a50905);
    margin: 0 0 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.loot-table-subtitle {
    color: var(--text-secondary, #a09d94);
    font-size: 1rem;
    margin: 0;
}

.loot-table-hint {
    color: var(--mythic-red, #ff6b6b);
    font-size: 0.85rem;
    margin: 0.4rem 0 0;
    font-style: italic;
    opacity: 0.85;
}

/* Filters */
.loot-table-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.loot-filter-group {
    flex: 0 0 auto;
}

.loot-filter-search {
    flex: 1 1 200px;
}

.loot-filter-select,
.loot-filter-input {
    background: var(--bg-input, #1F2025);
    border: 1px solid var(--border-color, #2a2a35);
    color: var(--text-primary, #e0ddd5);
    padding: 8px 12px;
    border-radius: var(--border-radius, 4px);
    font-size: 13px;
    font-family: var(--font-body);
    width: 100%;
    transition: border-color 0.2s;
}

.loot-filter-select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 36px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1.5l5 5 5-5' stroke='%237a7870' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    cursor: pointer;
}

.loot-filter-select:focus,
.loot-filter-input:focus {
    outline: none;
    border-color: var(--gold, #a50905);
}

.loot-filter-select option {
    background: var(--bg-secondary, #1a1b20);
    color: var(--text-primary, #e0ddd5);
}

/* Content */
.loot-table-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.loot-loading,
.loot-error,
.loot-empty {
    text-align: center;
    padding: 3rem;
    color: var(--text-dimmed, #7a7870);
    font-size: 1rem;
}

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

/* Boss Card */
.loot-boss-card {
    background: var(--bg-panel, #1A1B1F);
    border: 1px solid var(--border-panel, #252830);
    border-radius: var(--border-radius-lg, 8px);
    overflow: hidden;
    transition: border-color 0.2s;
}

.loot-boss-card:hover {
    border-color: var(--border-hover, #3a3a45);
}

.loot-boss-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-panel, #252830);
    background: var(--bg-secondary, #1a1b20);
}

.loot-boss-icon {
    width: 55px;
    height: 55px;
    border-radius: var(--border-radius, 4px);
    object-fit: contain;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color, #2a2a35);
}

.loot-boss-icon--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: var(--text-dimmed, #7a7870);
    border: 1px dashed var(--border-color, #2a2a35);
}

.loot-boss-info {
    flex: 1;
    min-width: 0;
}

.loot-boss-name {
    font-family: 'Roboto', var(--font-body);
    font-size: 1.1rem;
    color: var(--text-primary, #e0ddd5);
    margin: 0 0 2px;
    font-weight: 600;
}

.loot-boss-meta {
    display: flex;
    gap: 10px;
    font-size: 12px;
    align-items: center;
}

.loot-boss-type {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 11px;
}

.loot-boss-location {
    color: var(--text-dimmed, #7a7870);
}

.loot-boss-location::before {
    content: '';
    display: inline-block;
    width: 3px;
    height: 3px;
    background: var(--text-dimmed, #7a7870);
    border-radius: 50%;
    margin-right: 7px;
    vertical-align: middle;
}

.loot-boss-description {
    margin-top: 4px;
    font-size: 12px;
    color: var(--text-dimmed, #7a7870);
    line-height: 1.4;
    font-style: italic;
}

.loot-item-count {
    flex-shrink: 0;
    font-size: 12px;
    color: var(--text-dimmed, #7a7870);
    background: rgba(255, 255, 255, 0.04);
    padding: 3px 10px;
    border-radius: 10px;
    border: 1px solid var(--border-color, #2a2a35);
}

/* Section label (e.g. "All Classes" divider) */
.loot-section-label {
    padding: 6px 16px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-dimmed, #7a7870);
    background: rgba(255, 255, 255, 0.02);
    border-top: 1px solid var(--border-color, #2a2a35);
}

/* Klassen-Header (immer offen) */
.loot-section-label--class {
    color: #c4a24e;
}

/* Klappbarer Header */
.loot-section-label--toggle {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    user-select: none;
}
.loot-section-label--toggle:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* Pfeil */
.loot-section-arrow {
    transition: transform 0.2s;
    font-size: 14px;
}
.loot-section-label--open .loot-section-arrow {
    transform: rotate(90deg);
}

/* Eingeklapptes Grid — needs higher specificity to override .loot-item-grid display:grid */
.loot-item-grid.loot-section-collapsed {
    display: none;
}

/* Item Grid */
.loot-item-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 0;
}

.loot-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: var(--bg-panel, #1A1B1F);
    border-right: 1px solid var(--border-panel, #252830);
    border-bottom: 1px solid var(--border-panel, #252830);
    transition: background 0.15s;
    cursor: default;
}

.loot-item:hover {
    background: var(--bg-panel-hover, #22232a);
}

.loot-item-icon {
    width: 34px;
    height: 34px;
    border-radius: var(--border-radius, 4px);
    object-fit: contain;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color, #2a2a35);
}

.loot-item-icon--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: var(--text-dark, #4a4840);
    border: 1px dashed var(--border-color, #2a2a35);
}

.loot-item-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.loot-item-name {
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.loot-item-meta {
    font-size: 11px;
    color: var(--text-dimmed, #7a7870);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.loot-no-items {
    padding: 18px;
    text-align: center;
    color: var(--text-dark, #4a4840);
    font-size: 13px;
    font-style: italic;
}

/* Item Tooltip (Diablo-style, cursor-following) */
.item-tooltip {
    position: fixed;
    z-index: var(--z-tooltip, 99999);
    background: var(--bg-secondary, #1a1b20);
    border: 1px solid var(--border-color, #2a2a35);
    border-radius: 2px;
    min-width: 280px;
    max-width: 340px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.8);
    pointer-events: none;
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.15s ease-out, transform 0.15s ease-out;
    will-change: opacity, transform;
    font-family: var(--font-body);
}

.item-tooltip h1,
.item-tooltip h2,
.item-tooltip h3,
.item-tooltip h4 { font-family: inherit; }

.item-tooltip--visible {
    opacity: 1;
    transform: scale(1);
}

.item-tooltip__name {
    font-family: var(--font-body);
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.item-tooltip__name--unique { color: var(--unique-gold, #d1a781); }
.item-tooltip__name--mythic { color: var(--mythic-red, #c0a1d8); text-shadow: 0 0 12px rgba(192, 161, 216, 0.6); }
.item-tooltip__name--legendary { color: var(--legendary-purple, #d98c3c); }
.item-tooltip__name--rare { color: var(--rare-yellow, #f1f25c); }
.item-tooltip__name--magic { color: var(--magic-blue, #6d6ed9); }

.item-tooltip__type {
    font-size: 0.8rem;
    color: var(--text-secondary, #a09d94);
    margin-bottom: 0.25rem;
}

.item-tooltip__rarity {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.item-tooltip__divider {
    height: 1px;
    background: var(--border-color, #2a2a35);
    margin: 0.75rem 0;
}

.item-tooltip__affixes { margin: 0.75rem 0; }

.item-tooltip__affix {
    font-size: 0.85rem;
    color: var(--text-primary, #e0ddd5);
    margin-bottom: 0.4rem;
    padding-left: 0.5rem;
    border-left: 2px solid transparent;
}

.item-tooltip__affix--greater {
    color: var(--gold, #a50905);
    border-left-color: var(--gold, #a50905);
    font-weight: 600;
}

.item-tooltip__affix--temper {
    color: var(--legendary-purple, #d98c3c);
    border-left-color: var(--legendary-purple, #d98c3c);
}

.item-tooltip__unique-effect {
    background: rgba(209, 167, 129, 0.08);
    border: 1px solid var(--unique-gold, #d1a781);
    border-radius: var(--border-radius, 4px);
    padding: 0.75rem;
    margin: 0.75rem 0;
    font-size: 0.85rem;
    color: var(--unique-gold, #d1a781);
    line-height: 1.4;
}

.item-tooltip__aspect {
    background: rgba(217, 140, 60, 0.08);
    border: 1px solid var(--legendary-purple, #d98c3c);
    border-radius: var(--border-radius, 4px);
    padding: 0.75rem;
    margin: 0.75rem 0;
}

.item-tooltip__aspect-name {
    font-weight: 600;
    color: var(--legendary-purple, #d98c3c);
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
}

.item-tooltip__aspect-description {
    font-size: 0.8rem;
    color: var(--text-primary, #e0ddd5);
    line-height: 1.4;
}

.item-tooltip__flavor {
    font-size: 0.75rem;
    font-style: italic;
    color: var(--text-dark, #4a4840);
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color, #2a2a35);
    line-height: 1.4;
}

/* Responsive */
@media (max-width: 768px) {
    .loot-table-page {
        padding: 0.75rem 0.5rem;
    }

    .loot-table-header {
        margin-bottom: 1rem;
    }

    .loot-table-header h1 {
        font-size: 1.4rem;
    }

    .loot-table-subtitle {
        font-size: 0.85rem;
    }

    .loot-table-hint {
        font-size: 0.75rem;
    }

    /* Filter: 2-spaltig statt vertikal */
    .loot-table-filters {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 6px;
        margin-bottom: 1rem;
    }

    .loot-filter-group {
        min-width: 0;
    }

    /* Suchfeld volle Breite */
    .loot-filter-search {
        grid-column: 1 / -1;
    }

    .loot-filter-select,
    .loot-filter-input {
        padding: 7px 10px;
        font-size: 12px;
    }

    .loot-filter-select {
        padding-right: 28px;
        background-position: right 8px center;
    }

    /* Boss-Header kompakter */
    .loot-boss-header {
        padding: 10px 12px;
        gap: 10px;
    }

    .loot-boss-icon {
        width: 36px;
        height: 36px;
    }

    .loot-boss-name {
        font-size: 0.95rem;
    }

    .loot-boss-meta {
        flex-wrap: wrap;
        gap: 4px 8px;
        font-size: 11px;
    }

    .loot-boss-description {
        font-size: 11px;
    }

    /* Items: 1 Spalte, kompakter */
    .loot-item-grid {
        grid-template-columns: 1fr;
    }

    .loot-item {
        padding: 8px 12px;
        gap: 8px;
    }

    .loot-item-icon {
        width: 28px;
        height: 28px;
    }

    .loot-item-name {
        font-size: 12px;
    }

    .loot-item-meta {
        font-size: 10px;
    }

    /* Section Labels */
    .loot-section-label {
        padding: 5px 12px;
        font-size: 10px;
    }

    .loot-item-count {
        display: none;
    }

    .loot-table-content {
        gap: 0.75rem;
    }
}
