/* Inventory CSS - Specifically for inventory items and lootboxes */

/* Lootbox item styles */
.lootbox-item {
    position: relative;
    display: flex;
    flex-direction: column;
    border-radius: 10px;
    padding: 1rem;
    min-height: 140px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    overflow: hidden;
}

.lootbox-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

.lootbox-item .lootbox-icon {
    font-size: 1.5rem;
    margin-bottom: 0.3rem;
    color: #eee;
}

.lootbox-item .lootbox-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
    color: white;
}

.lootbox-item .lootbox-description {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 0.5rem;
    flex-grow: 1;
    /* Only show two lines of text */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lootbox-item .lootbox-quantity {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 1rem;
}

.lootbox-item .lootbox-actions {
    margin-top: auto;
}

/* Rarity indicators - Simple border style */
.lootbox-item.common { 
    border-left: 5px solid #9e9e9e; 
}

.lootbox-item.uncommon { 
    border-left: 5px solid #4caf50; 
}

.lootbox-item.rare { 
    border-left: 5px solid #2196f3; 
}

.lootbox-item.epic { 
    border-left: 5px solid #9c27b0; 
}

/* Legendary item special styling */
.lootbox-item.legendary { 
    position: relative;
    border: none;
    padding: 1.5rem;
}

.lootbox-item.legendary:before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    z-index: -1;
    border-radius: 13px;
    background: linear-gradient(90deg, 
        #ff0000, #ff7f00, #ffff00, #00ff00, 
        #0000ff, #4b0082, #9400d3, #ff0000);
    background-size: 400% 400%;
    animation: rainbow-border 3s ease infinite;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
}

.lootbox-item.legendary .lootbox-icon { 
    color: #ffd700;
    text-shadow: 0 0 15px rgba(255,215,0,0.7);
    animation: pulse-glow 1.5s infinite alternate;
}

.lootbox-item.legendary .lootbox-name {
    font-size: 1.4rem;
    background: linear-gradient(90deg, #ffd700, #FFA500);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    text-shadow: 0 2px 10px rgba(255,215,0,0.4);
}

/* Animation keyframes */
@keyframes rainbow-border {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes pulse-glow {
    from {
        text-shadow: 0 0 5px rgba(255,215,0,0.5);
    }
    to {
        text-shadow: 0 0 20px rgba(255,215,0,1), 0 0 30px rgba(255,165,0,0.8);
    }
}

/* Grid for displaying lootboxes */
.lootbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

/* Empty inventory styling */
.empty-inventory {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    color: rgba(255, 255, 255, 0.6);
    text-align: center;
}

.empty-inventory i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.6;
}

.empty-inventory p {
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.empty-inventory .empty-subtitle {
    font-size: 0.9rem;
    opacity: 0.7;
}

/* Open lootbox button styling */
.open-lootbox-btn {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 5px;
    padding: 0.5rem 1rem;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
}

.open-lootbox-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

.lootbox-item.legendary .open-lootbox-btn {
    background: rgba(255, 215, 0, 0.3);
}

.lootbox-item.legendary .open-lootbox-btn:hover {
    background: rgba(255, 215, 0, 0.5);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
}

/* Section title styling */
.lootbox-section .section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.4rem;
    margin-bottom: 1rem;
    color: white;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 0.5rem;
}

.lootbox-section .section-title i {
    opacity: 0.8;
}

/* ========== MOBILE INVENTORY IMPROVEMENTS ========== */

@media (max-width: 768px) {
    .inventory-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }

    .lootbox-item {
        padding: 0.75rem;
        min-height: 120px;
    }

    .lootbox-item .lootbox-icon {
        font-size: 1.25rem;
    }

    .lootbox-item .lootbox-name {
        font-size: 0.95rem;
    }

    .lootbox-item .lootbox-description {
        font-size: 0.75rem;
    }

    .lootbox-section .section-title {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .inventory-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .lootbox-item {
        padding: 0.6rem;
        min-height: 100px;
    }

    .lootbox-item .lootbox-icon {
        font-size: 1rem;
        margin-bottom: 0.2rem;
    }

    .lootbox-item .lootbox-name {
        font-size: 0.85rem;
    }

    .lootbox-item .lootbox-description {
        font-size: 0.7rem;
        -webkit-line-clamp: 1;
        line-clamp: 1;
    }

    .lootbox-item .lootbox-quantity {
        font-size: 0.8rem;
    }

    .lootbox-section .section-title {
        font-size: 1rem;
        margin-bottom: 0.75rem;
    }
}
