/**
 * Treasure Vault / Inventory Screen Styles
 */

/* ===== CARD WRAPPER ===== */
.inventory-content-card {
    min-height: 400px;
}

/* Stardust display in header */
#inventory-screen .dashboard-header-v2 {
    display: flex;
    align-items: center;
}

/* ===== TABS ===== */
.inventory-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.inventory-tab {
    padding: 10px 18px;
    border: none;
    border-radius: 25px;
    background: #f0eeff;
    color: #666;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.inventory-tab:hover {
    background: #e4dcff;
    color: #444;
}

.inventory-tab.active {
    background: linear-gradient(135deg, #9C27B0, #7B1FA2);
    color: #fff;
    box-shadow: 0 4px 15px rgba(156, 39, 176, 0.4);
}

/* ===== CONTENT AREA ===== */
.inventory-content {
    min-height: 300px;
}

/* ===== COLLECTION SUBCATEGORY TABS ===== */
.collection-subcategory-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.subcategory-tab {
    padding: 6px 14px;
    border: none;
    border-radius: 20px;
    background: #f0f0f5;
    color: #888;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.subcategory-tab:hover {
    background: #e8e4f8;
    color: #555;
}

.subcategory-tab.active {
    background: rgba(156, 39, 176, 0.15);
    color: #7B1FA2;
    border: 1px solid rgba(156, 39, 176, 0.3);
}

/* ===== COLLECTION GRID ===== */
.collection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

/* ===== COLLECTION CARD ===== */
.collection-card {
    background: #f8f7ff;
    border-radius: 16px;
    padding: 16px 10px;
    text-align: center;
    transition: all 0.3s ease;
    border: 2px solid #eee;
    position: relative;
}

.collection-card.owned {
    opacity: 1;
    background: linear-gradient(135deg, #f0eeff 0%, #fef0f5 100%);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08);
}

.collection-card.owned:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.2);
    border-color: #c5b4fc;
}

.collection-card.locked {
    opacity: 0.4;
    filter: grayscale(0.6);
}

.collection-card-emoji {
    font-size: 2.2rem;
    margin-bottom: 8px;
    display: block;
}

.collection-card-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.collection-card.locked .collection-card-name {
    color: #999;
}

/* Rarity dot */
.rarity-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    margin-bottom: 6px;
}

.rarity-dot.common { background: #9E9E9E; }
.rarity-dot.rare { background: #2196F3; }
.rarity-dot.epic { background: #9C27B0; }
.rarity-dot.legendary { background: #FF9800; box-shadow: 0 0 8px rgba(255, 152, 0, 0.6); }

/* Lock overlay for locked cards */
.collection-card.locked .lock-icon {
    font-size: 1.2rem;
    display: block;
    margin-bottom: 4px;
    opacity: 0.6;
}

/* Equipped badge */
.equipped-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    background: linear-gradient(135deg, #4CAF50, #388E3C);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    margin-top: 6px;
}

/* Equip button */
.equip-btn {
    display: inline-block;
    padding: 4px 14px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #9C27B0, #7B1FA2);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
    margin-top: 6px;
    transition: all 0.2s ease;
}

.equip-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(156, 39, 176, 0.4);
}

/* ===== CHEST TYPE GRID ===== */
.chest-type-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.chest-type-card {
    background: #f8f7ff;
    border-radius: 16px;
    padding: 24px 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid #eee;
}

.chest-type-card:hover {
    transform: translateY(-3px);
}

.chest-type-card.bronze:hover { border-color: #CD7F32; box-shadow: 0 6px 20px rgba(205, 127, 50, 0.2); }
.chest-type-card.silver:hover { border-color: #C0C0C0; box-shadow: 0 6px 20px rgba(192, 192, 192, 0.2); }
.chest-type-card.golden:hover { border-color: #FFD700; box-shadow: 0 6px 20px rgba(255, 215, 0, 0.2); }
.chest-type-card.legendary:hover { border-color: #E040FB; box-shadow: 0 6px 20px rgba(224, 64, 251, 0.2); }

.chest-type-emoji {
    font-size: 3rem;
    margin-bottom: 10px;
    display: block;
}

.chest-type-name {
    font-size: 1rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 4px;
}

.chest-type-count {
    font-size: 0.85rem;
    color: #888;
}

.no-chests-message {
    text-align: center;
    color: #888;
    padding: 40px 20px;
    font-size: 1rem;
}

.no-chests-message .no-chests-emoji {
    font-size: 3rem;
    display: block;
    margin-bottom: 12px;
}

/* ===== SHOP GRID ===== */
.shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.shop-card {
    background: #f8f7ff;
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    border: 2px solid #eee;
}

.shop-card:hover:not(.cant-afford) {
    transform: translateY(-3px);
    background: linear-gradient(135deg, #fffbf0 0%, #fff8e8 100%);
    border-color: #FFD700;
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.15);
}

.shop-card.cant-afford {
    opacity: 0.5;
}

.shop-card-emoji {
    font-size: 2.5rem;
    margin-bottom: 10px;
    display: block;
}

.shop-card-name {
    font-size: 1rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 6px;
}

.shop-card-desc {
    font-size: 0.8rem;
    color: #777;
    margin-bottom: 12px;
}

.shop-card-cost {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 1rem;
    font-weight: 700;
    color: #E6A800;
    margin-bottom: 12px;
}

.shop-buy-btn {
    padding: 8px 24px;
    border: none;
    border-radius: 20px;
    background: linear-gradient(135deg, #FFD700, #FF9800);
    color: #000;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.shop-buy-btn:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
}

.shop-buy-btn:disabled {
    background: #ccc;
    color: #999;
    cursor: not-allowed;
}

/* ===== CONSUMABLE GRID ===== */
.consumable-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.consumable-card {
    background: #f8f7ff;
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    border: 2px solid #eee;
}

.consumable-card:hover {
    background: linear-gradient(135deg, #f0eeff 0%, #fef0f5 100%);
    border-color: #c5b4fc;
}

.consumable-card-emoji {
    font-size: 2.5rem;
    margin-bottom: 8px;
    display: block;
}

.consumable-card-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 4px;
}

.consumable-card-desc {
    font-size: 0.75rem;
    color: #777;
    margin-bottom: 10px;
}

.consumable-card-count {
    font-size: 2rem;
    font-weight: 700;
    color: #7B1FA2;
    margin-bottom: 10px;
    display: block;
}

.consumable-use-btn {
    padding: 8px 24px;
    border: none;
    border-radius: 20px;
    background: linear-gradient(135deg, #4CAF50, #388E3C);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.consumable-use-btn:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
}

.consumable-use-btn:disabled {
    background: #ccc;
    color: #999;
    cursor: not-allowed;
}

/* ===== INVENTORY TOAST ===== */
.inventory-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
    z-index: 3000;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    max-width: 90%;
    text-align: center;
}

.inventory-toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.inventory-toast.success {
    background: linear-gradient(135deg, #4CAF50, #388E3C);
    box-shadow: 0 4px 20px rgba(76, 175, 80, 0.4);
}

.inventory-toast.error {
    background: linear-gradient(135deg, #f44336, #d32f2f);
    box-shadow: 0 4px 20px rgba(244, 67, 54, 0.4);
}

.inventory-toast.info {
    background: linear-gradient(135deg, #2196F3, #1976D2);
    box-shadow: 0 4px 20px rgba(33, 150, 243, 0.4);
}

/* ===== SECTION HEADERS ===== */
.inventory-section-header {
    font-size: 1rem;
    font-weight: 600;
    color: #666;
    margin-bottom: 12px;
    margin-top: 8px;
}

/* ===== LOADING STATE ===== */
.inventory-loading {
    text-align: center;
    padding: 60px 20px;
    color: #888;
}

.inventory-loading-spinner {
    font-size: 2rem;
    animation: inventorySpin 1s linear infinite;
    display: block;
    margin-bottom: 12px;
}

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

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
    .inventory-tabs {
        gap: 6px;
    }

    .inventory-tab {
        padding: 8px 14px;
        font-size: 0.8rem;
    }

    .collection-grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
        gap: 8px;
    }

    .collection-card {
        padding: 12px 8px;
    }

    .collection-card-emoji {
        font-size: 1.8rem;
    }

    .collection-card-name {
        font-size: 0.7rem;
    }

    .chest-type-grid {
        gap: 10px;
    }

    .shop-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 10px;
    }

    .consumable-grid {
        gap: 10px;
    }
}
