/* 
    Game-Style Inventory CSS 🎮
    Phyzioline Premium UI
*/

:root {
    --inventory-bg: #1a1a1a;
    --slot-bg: rgba(255, 255, 255, 0.05);
    --slot-border: rgba(255, 255, 255, 0.1);

    /* Rarity Colors */
    --rarity-basic: #9e9e9e;
    --rarity-advanced: #3498db;
    --rarity-premium: #f1c40f;

    /* Glow Glares */
    --glow-basic: rgba(158, 158, 158, 0.3);
    --glow-advanced: rgba(52, 152, 219, 0.5);
    --glow-premium: rgba(241, 196, 15, 0.6);
}

.inventory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
    padding: 20px;
    background: var(--inventory-bg);
    border-radius: 16px;
    border: 2px solid #333;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
}

.inventory-slot {
    aspect-ratio: 1/1;
    background: var(--slot-bg);
    border: 1px solid var(--slot-border);
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.inventory-slot:hover {
    transform: scale(1.05) translateY(-5px);
    z-index: 10;
    border-color: #fff;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
}

/* Rarity Borders & Glows */
.inventory-slot.rarity-basic {
    border-bottom: 4px solid var(--rarity-basic);
}

.inventory-slot.rarity-advanced {
    border-bottom: 4px solid var(--rarity-advanced);
}

.inventory-slot.rarity-premium {
    border-bottom: 4px solid var(--rarity-premium);
}

.inventory-slot.rarity-advanced:hover {
    box-shadow: 0 0 15px var(--glow-advanced);
}

.inventory-slot.rarity-premium:hover {
    box-shadow: 0 0 25px var(--glow-premium);
}

.slot-icon {
    width: 70%;
    height: 70%;
    object-fit: contain;
    filter: drop-shadow(0 5px 10px rgba(0, 0, 0, 0.3));
    transition: transform 0.3s ease;
}

.inventory-slot:hover .slot-icon {
    transform: scale(1.1) rotate(5deg);
}

.slot-level {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: bold;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(4px);
}

.slot-name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: #fff;
    font-size: 11px;
    text-align: center;
    padding: 15px 5px 5px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.inventory-slot:hover .slot-name {
    opacity: 1;
}

/* Animation: Sparkle for Premium */
@keyframes sparkle {
    0% {
        opacity: 0.5;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(1.1);
    }

    100% {
        opacity: 0.5;
        transform: scale(1);
    }
}

.inventory-slot.rarity-premium::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(transparent, rgba(241, 196, 15, 0.1), transparent 30%);
    animation: rotate 4s linear infinite;
    pointer-events: none;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Tooltip/Details Card */
.inventory-details {
    margin-top: 20px;
    background: #252525;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #444;
    color: #eee;
    display: none;
    /* Shown via JS */
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.rarity-tag {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 12px;
    text-transform: uppercase;
    font-weight: bold;
    margin-bottom: 10px;
}

.tag-basic {
    background: var(--rarity-basic);
    color: #000;
}

.tag-advanced {
    background: var(--rarity-advanced);
    color: #fff;
}

.tag-premium {
    background: var(--rarity-premium);
    color: #000;
    box-shadow: 0 0 10px var(--glow-premium);
}

/* Management & Action Styles */
.add-slot {
    border: 2px dashed var(--slot-border) !important;
    background: transparent !important;
    opacity: 0.6;
}

.add-slot:hover {
    border-style: solid !important;
    border-color: #2ecc71 !important;
    opacity: 1;
}

.hover-pulse:hover i {
    animation: inventory-pulse 1.5s infinite;
}

@keyframes inventory-pulse {
    0% {
        transform: scale(1);
        opacity: 0.5;
    }

    50% {
        transform: scale(1.2);
        opacity: 1;
    }

    100% {
        transform: scale(1);
        opacity: 0.5;
    }
}

.detail-img-box {
    width: 80px;
    height: 80px;
    background: #000;
    border-radius: 8px;
    border: 1px solid #444;
    overflow: hidden;
}

.item-actions .btn {
    border-radius: 8px !important;
    padding: 0.25rem 0.6rem !important;
    font-size: 1.1rem !important;
    transition: all 0.2s;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.item-actions .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    background: rgba(255, 255, 255, 0.1);
}

/* Modal Dark Theme Utilities */
.bg-soft-dark {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.bg-soft-dark:focus {
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: var(--rarity-advanced) !important;
    color: #fff !important;
    box-shadow: none !important;
}

.modal-content.bg-dark {
    background-color: #1a1a1a !important;
    border: 1px solid #333 !important;
}