/* ===================================
   УНИФИЦИРОВАННЫЕ СТИЛИ ДЛЯ ПАНЕЛЕЙ
   Магазин и Инвентарь приведены к единому стилю
   =================================== */

/* === TABS HEADER (для Инвентаря) === */
.panel-tabs-header {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    padding: 0 4px;
}

.panel-tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.panel-tab-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.panel-tab-btn.active {
    background: linear-gradient(135deg, rgba(76, 175, 255, 0.3), rgba(138, 43, 226, 0.3));
    border-color: rgba(255, 255, 255, 0.4);
    color: white;
}

.panel-tab-btn .tab-icon {
    font-size: 18px;
}

.panel-tab-btn .tab-text {
    font-size: 13px;
}

/* === UNIFIED GRID (2x2) === */
.items-grid-unified {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 12px;
    /* УВЕЛИЧЕНО: Панели теперь больше, снасти помещаются полностью (было 260px) */
    min-height: 280px;
    max-height: 400px;
    padding: 8px;
    margin: 0 auto;
    justify-content: center;
    align-content: start;
}

.items-grid-unified .item-slot,
.items-grid-unified .shop-item,
.items-grid-unified .inventory-item,
.items-grid-unified .gear-slot {
    height: 120px;
    min-height: 120px;
    max-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.items-grid-unified .item-slot:hover,
.items-grid-unified .shop-item:hover,
.items-grid-unified .inventory-item:hover,
.items-grid-unified .gear-slot:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.items-grid-unified .item-icon {
    font-size: 40px;
    margin-bottom: 4px;
}

.items-grid-unified .item-name {
    font-size: 12px;
    font-weight: 600;
    color: white;
    text-align: center;
    margin-bottom: 4px;
}

.items-grid-unified .item-price,
.items-grid-unified .item-count {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
}

/* Gear-specific styles */
.items-grid-unified .gear-icon {
    font-size: 28px;
    margin-bottom: 4px;
}

.items-grid-unified .gear-name {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
    margin-bottom: 2px;
}

.items-grid-unified .gear-item-name {
    font-size: 9px;
    color: rgba(255, 255, 255, 0.6);
    text-align: center;
    margin-bottom: 2px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.items-grid-unified .gear-uses {
    font-size: 8px;
    color: rgba(255, 255, 255, 0.7);
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 4px;
    padding: 1px 3px;
}

.items-grid-unified .gear-empty {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.4);
    text-align: center;
}

.items-grid-unified .gear-border {
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 14px;
    pointer-events: none;
    transition: all 0.3s ease;
}

/* === UNIFIED PAGINATION === */
.pagination-footer {
    margin-top: auto;
    padding-top: 12px;
}

.pagination-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.pagination-controls .nav-arrow-small {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pagination-controls .nav-arrow-small:hover:not(.disabled) {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.pagination-controls .nav-arrow-small:active:not(.disabled) {
    transform: scale(0.95);
}

.pagination-controls .nav-arrow-small.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

.pagination-controls .pagination-info {
    min-width: 50px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

/* === PANEL CONTENT LAYOUT === */
.inventory-content,
.shop-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.tab-content {
    display: none;
    flex-direction: column;
    height: 100%;
}

.tab-content.active {
    display: flex;
}

/* === ITEMS GRID SLOTS (with empty slots display) === */
.items-grid-slots {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 12px;
    min-height: 260px;
    max-height: 260px;
    padding: 8px;
    margin: 0 auto;
    justify-content: center;
    align-content: start;
}

.items-grid-slots .item-slot {
    height: 120px;
    min-height: 120px;
    max-height: 120px;
}

/* === RESPONSIVE === */
@media (max-width: 400px) {
    .panel-tab-btn {
        padding: 8px 12px;
        font-size: 12px;
    }

    .panel-tab-btn .tab-icon {
        font-size: 16px;
    }

    .panel-tab-btn .tab-text {
        font-size: 11px;
    }

    .items-grid-unified {
        gap: 10px;
        padding: 6px;
        min-height: 240px;
        max-height: 240px;
    }

    .items-grid-unified .item-slot,
    .items-grid-unified .shop-item,
    .items-grid-unified .inventory-item,
    .items-grid-unified .gear-slot {
        height: 110px;
        min-height: 110px;
        max-height: 110px;
        padding: 8px;
    }

    .items-grid-unified .item-icon {
        font-size: 36px;
    }

    .items-grid-unified .item-name {
        font-size: 11px;
    }

    .items-grid-unified .item-price,
    .items-grid-unified .item-count {
        font-size: 10px;
    }
}
