/* css/inventory-items.css
   Item grid, slot styling, rarity borders, detail panel */

/* ── Tab Bar ── */
.inventory-tabs {
    display: flex;
    border-bottom: 1px solid rgba(255, 215, 0, 0.2);
}

.inventory-tab {
    flex: 1;
    padding: 10px 0;
    background: none;
    border: none;
    color: #666;
    font-size: 13px;
    font-weight: bold;
    letter-spacing: 2px;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
    border-bottom: 2px solid transparent;
    text-align: center;
}

.inventory-tab:hover {
    color: #AAA;
}

.inventory-tab.active {
    color: #FFD700;
    border-bottom-color: #FFD700;
}

/* ── Category Filters ── */
.inventory-filters {
    display: flex;
    gap: 6px;
    padding: 8px 12px;
    flex-wrap: wrap;
}

.inventory-filter-btn {
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #888;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
}

.inventory-filter-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #CCC;
}

.inventory-filter-btn.active {
    background: rgba(255, 215, 0, 0.15);
    border-color: rgba(255, 215, 0, 0.4);
    color: #FFD700;
}

/* ── Equipped Item Display ── */
.inventory-equipped {
    padding: 8px 12px;
    margin: 0 12px 8px;
    background: rgba(0, 255, 100, 0.05);
    border: 1px solid rgba(0, 255, 100, 0.2);
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.inventory-equipped-label {
    font-size: 10px;
    color: #00FF64;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.inventory-equipped-icon {
    font-size: 20px;
}

.inventory-equipped-name {
    font-size: 13px;
    color: #CCC;
    flex: 1;
}

.inventory-equipped-unequip {
    padding: 3px 8px;
    background: rgba(255, 100, 100, 0.1);
    border: 1px solid rgba(255, 100, 100, 0.3);
    border-radius: 6px;
    color: #FF6666;
    font-size: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.inventory-equipped-unequip:hover {
    background: rgba(255, 100, 100, 0.2);
}

/* ── Item Grid ── */
.inventory-item-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    padding: 8px 12px;
}

.inventory-item-slot {
    position: relative;
    aspect-ratio: 1;
    background: rgba(255, 255, 255, 0.03);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    padding: 4px;
}

.inventory-item-slot:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
}

/* Rarity borders */
.inventory-item-slot.rarity-common    { border-color: rgba(255, 255, 255, 0.2); }
.inventory-item-slot.rarity-rare      { border-color: rgba(30, 144, 255, 0.5); box-shadow: 0 0 6px rgba(30, 144, 255, 0.15); }
.inventory-item-slot.rarity-epic      { border-color: rgba(218, 112, 214, 0.5); box-shadow: 0 0 8px rgba(218, 112, 214, 0.15); }
.inventory-item-slot.rarity-legendary { border-color: rgba(255, 215, 0, 0.5); box-shadow: 0 0 10px rgba(255, 215, 0, 0.2); }

.inventory-item-slot.equipped {
    border-color: rgba(0, 255, 100, 0.5);
    box-shadow: 0 0 8px rgba(0, 255, 100, 0.2);
}

.inventory-item-icon {
    font-size: 22px;
    line-height: 1;
}

.inventory-item-name {
    font-size: 8px;
    color: #AAA;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
    margin-top: 2px;
}

.inventory-item-qty {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.15);
    color: #FFF;
    font-size: 10px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── Item Detail Panel ── */
.inventory-detail {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(10, 10, 20, 0.98);
    border-top: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 0 0 15px 15px;
    padding: 16px;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    z-index: 10;
}

.inventory-detail.visible {
    transform: translateY(0);
}

.inventory-detail-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.inventory-detail-icon {
    font-size: 28px;
}

.inventory-detail-info {
    flex: 1;
}

.inventory-detail-name {
    font-size: 16px;
    font-weight: bold;
    color: #FFF;
}

.inventory-detail-type {
    font-size: 11px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.inventory-detail-rarity {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.inventory-detail-rarity.rarity-common    { background: rgba(255,255,255,0.1); color: #CCC; }
.inventory-detail-rarity.rarity-rare      { background: rgba(30,144,255,0.15); color: #1E90FF; }
.inventory-detail-rarity.rarity-epic      { background: rgba(218,112,214,0.15); color: #DA70D6; }
.inventory-detail-rarity.rarity-legendary { background: rgba(255,215,0,0.15); color: #FFD700; }

.inventory-detail-desc {
    font-size: 13px;
    color: #AAA;
    line-height: 1.5;
    margin-bottom: 12px;
}

.inventory-detail-actions {
    display: flex;
    gap: 8px;
}

.inventory-detail-btn {
    flex: 1;
    padding: 8px 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: #FFF;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.inventory-detail-btn:hover {
    background: rgba(255, 255, 255, 0.12);
}

.inventory-detail-btn.use-btn {
    border-color: rgba(0, 200, 100, 0.4);
    color: #00C864;
}

.inventory-detail-btn.equip-btn {
    border-color: rgba(0, 200, 255, 0.4);
    color: #00C8FF;
}

.inventory-detail-btn.unequip-btn {
    border-color: rgba(255, 100, 100, 0.4);
    color: #FF6464;
}

.inventory-detail-close {
    padding: 6px 12px;
    background: none;
    border: none;
    color: #666;
    font-size: 12px;
    cursor: pointer;
    text-align: center;
    display: block;
    margin: 8px auto 0;
}

.inventory-detail-close:hover {
    color: #AAA;
}

/* ── Empty State ── */
.inventory-empty {
    padding: 30px 20px;
    text-align: center;
    color: #555;
    font-size: 13px;
}

.inventory-empty-icon {
    font-size: 36px;
    margin-bottom: 8px;
    opacity: 0.5;
}

/* ── Encounter Counter ── */
.inventory-encounter-count {
    padding: 6px 12px;
    text-align: center;
    font-size: 11px;
    color: #555;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* ── Mobile Adjustments ── */
@media (max-width: 768px) {
    .inventory-item-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .inventory-item-icon {
        font-size: 20px;
    }

    .inventory-item-name {
        font-size: 7px;
    }

    .inventory-detail {
        padding: 12px;
    }

    .inventory-detail-name {
        font-size: 14px;
    }
}
