/* ==================================================================== */
/* inventory.css - ФИНАЛЬНАЯ ВЕРСИЯ: БЕЗ РАМОК И БЕЗ ПОДСВЕТКИ */
/* ==================================================================== */

.inventory-section {
    padding: 10px 4% 100px 4%;
    width: 92%;
    margin: 0 auto;
}

.inventory-section h2 {
    color: #E0FFFF;
    margin-bottom: 20px;
    font-size: 1.2em;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    opacity: 0.9;
    border-bottom: 1px solid rgba(169, 217, 248, 0.2);
    padding-bottom: 10px;
}

/* --- Сетка предметов (3 колонки) --- */
.inventory-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); 
    gap: 10px; /* Оптимальный зазор для карточек без рамок */
    margin-top: 10px;
}

/* --- Карточка предмета (Чистая плитка) --- */
.item-card {
    background: rgba(28, 39, 56, 0.85); 
    backdrop-filter: blur(10px);
    aspect-ratio: 1 / 1; 
    border-radius: 20px; 
    
    /* ПОЛНОСТЬЮ УБИРАЕМ РАМКУ И СВЕЧЕНИЕ */
    border: none !important; 
    box-shadow: none !important;
    outline: none !important;

    position: relative;
    cursor: pointer;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 12px 6px; 
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.item-card:active {
    transform: scale(0.92);
    background: rgba(45, 59, 82, 0.95); /* Чуть светлее при нажатии для отклика */
}

/* Изображение предмета */
.item-card-image {
    width: 100%;
    height: 150%; /* Было 65% - увеличиваем */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px; /* Добавляем немного отступов */
}

.item-card-image img {
    width: 100% !important; /* Было 90% - увеличиваем */
    height: 150% !important; /* Было 90% - увеличиваем */
    max-width: 120px; /* Максимальный размер */
    max-height: 120px; /* Максимальный размер */
    object-fit: contain;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.4));
}

/* Бейдж с количеством */
.item-card-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.5); /* Полупрозрачный фон */
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 8px;
    backdrop-filter: blur(4px);
    z-index: 2;
}

/* Футер карточки */
.item-card-footer {
    width: 100%;
}

.item-name {
    font-size: 10px;
    font-weight: 800;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    padding: 0 5px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    /* Цвет берется из rarityColor в JS */
}

.item-price {
    font-size: 9px;
    color: #fbbf24;
    font-weight: bold;
    opacity: 0.9;
}

/* --- Состояния инвентаря --- */
.empty-state, .loading-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 50px 20px;
    color: #94a3b8;
    background: rgba(28, 39, 56, 0.4);
    border-radius: 20px;
    border: 1px dashed rgba(255, 255, 255, 0.1);
}

.btn-test {
    background: linear-gradient(90deg, #7868e6, #3f55d2);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    margin-top: 15px;
    font-weight: bold;
    cursor: pointer;
}

/* --- Кнопка продажи --- */
.sell-all-btn-wrapper {
    margin-top: 30px;
    padding: 0 5px;
}

.btn-sell-all {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 16px;
    background: linear-gradient(90deg, #f44336, #d32f2f);
    color: white;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(244, 67, 54, 0.2);
    transition: all 0.2s;
}

.btn-sell-all:active {
    transform: translateY(2px);
    filter: brightness(0.9);
}

.inventory-controls {
    display: flex;
    justify-content: center;
    padding: 15px 0;
}

.sort-toggle {
    display: flex;
    background: #1c222b; /* Темный фон как в инвентаре */
    padding: 4px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.sort-btn {
    background: none;
    border: none;
    color: #8a8f98;
    padding: 6px 14px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.sort-btn.active {
    background: #2a313d; /* Чуть светлее при активации */
    color: #ffd700; /* Золотой текст */
    box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
}

.inventory-stats {
    text-align: center;
    font-size: 16px;
    font-weight: bold;
    color: #fff;
    margin-bottom: 10px;
    background: rgba(255, 255, 255, 0.05);
    padding: 8px;
    border-radius: 10px;
}

#total-inventory-value {
    color: #ffd700; /* Золотой цвет для цифр */
    margin-left: 5px;
}

/* Контейнер для всех групп кнопок */
.inventory-controls {
    display: flex;
    flex-wrap: wrap; /* Чтобы на маленьких экранах кнопки переносились */
    gap: 12px;
    justify-content: center;
    margin-bottom: 20px;
    padding: 0 10px;
}

/* Общие стили для оберток переключателей */
.sort-toggle, .view-toggle {
    display: flex;
    background: rgba(255, 255, 255, 0.05);
    padding: 4px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Стили самих кнопок */
.sort-btn, .view-btn {
    background: transparent;
    border: none;
    color: #888;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 9px;
    cursor: pointer;
    transition: all 0.3s ease;
}

/* Активное состояние (когда кнопка выбрана) */
.sort-btn.active, .view-btn.active {
    background: #ffffff;
    color: #000000;
    box-shadow: 0 4px 10px rgba(255, 255, 255, 0.2);
}

/* Эффект при наведении на неактивные кнопки */
.sort-btn:not(.active):hover, .view-btn:not(.active):hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

/* Дополнительно: стиль для статистики инвентаря */
.inventory-stats {
    background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.05) 50%, rgba(255,255,255,0) 100%);
    text-align: center;
    padding: 10px;
    margin-bottom: 15px;
    font-size: 14px;
    color: #aaa;
}

#total-inventory-value {
    color: #ffd700;
    font-weight: bold;
    font-size: 16px;
}

/* Стили для блока статистики инвентаря */
.inventory-stats {
    text-align: center;
    padding: 15px;
    background: rgba(255, 255, 255, 0.03); /* Легкая подложка */
    border-radius: 12px;
    margin-bottom: 20px;
    line-height: 1.6; /* Расстояние между строками */
}

/* Основная сумма (крупно) */
#total-inventory-value {
    font-weight: bold;
    font-size: 18px;
    color: #ffd700; /* Золотой цвет для суммы */
}

/* Строка "Всего предметов" */
.inventory-stats span[style*="font-size: 14px"] {
    display: block; /* Выносит количество на новую строку */
    margin-top: 5px;
    letter-spacing: 0.5px;
}

/* Само число предметов */
#total-items-count {
    font-size: 16px;
    color: #ffffff !important;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

/* Анимация появления модалки */
@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

#inventory-item-modal > div {
    animation: modalFadeIn 0.3s ease-out;
}

/* Стиль для значка закрепления - маленький в углу */
.pinned-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(169, 217, 248, 0.9);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    border: 2px solid white;
}

.pinned-item {
    border: 2px solid #A9D9F8 !important;
    position: relative;
}

/* Стили для закрепленных предметов */
.pinned-item {
    border: 2px solid #FFD700 !important;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.3) !important;
    position: relative;
}

.pin-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(255, 215, 0, 0.9);
    color: #000;
    font-size: 12px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* Стили для выпадающего меню */
#modal-menu-dropdown {
    display: none;
    flex-direction: column;
    gap: 8px;
}

@keyframes dropdownFade {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

#modal-menu-dropdown button {
    transition: background 0.2s;
}

#modal-menu-dropdown button:hover {
    background: rgba(169, 217, 248, 0.1) !important;
}