/**
 * Void Ground - User Inventory (40 Slots) Stylesheet
 * Leonardo da Vinci Renaissance Manuscript Theme
 */

.inventory-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #100804 url('assets/wood-table.jpg') center center / cover no-repeat;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 500;
    padding: 16px;
    box-sizing: border-box;
}

.inventory-modal-overlay.hidden {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

.inventory-ledger-box {
    position: relative;
    width: 96% !important;
    max-width: 840px !important;
    height: 94% !important;
    max-height: 820px !important;
    margin: auto !important;
    background: #e8d7b8 url('assets/deckle-paper.jpg') repeat;
    background-size: cover;
    border: 2px solid #5a3e1b;
    border-radius: 8px;
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.75), inset 0 0 50px rgba(90, 56, 20, 0.35);
    display: flex;
    flex-direction: column;
    padding: 16px 20px;
    box-sizing: border-box;
    font-family: 'Cinzel', 'Palatino Linotype', 'Book Antiqua', Georgia, serif;
    color: #2b1d0c;
}

/* Brass Corner Ornaments */
.inv-corner {
    position: absolute;
    width: 28px;
    height: 28px;
    border: 3px solid #b89355;
    pointer-events: none;
}
.inv-corner.tl { top: 6px; left: 6px; border-right: none; border-bottom: none; }
.inv-corner.tr { top: 6px; right: 6px; border-left: none; border-bottom: none; }
.inv-corner.bl { bottom: 6px; left: 6px; border-right: none; border-top: none; }
.inv-corner.br { bottom: 6px; right: 6px; border-left: none; border-top: none; }

/* Header */
.inventory-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #7c5828;
    padding-bottom: 12px;
    margin-bottom: 12px;
    width: 100%;
    box-sizing: border-box;
}

.inv-title-group h2 {
    margin: 0;
    font-size: 26.5px; /* Scaled +15% from 23px */
    letter-spacing: 1.5px;
    color: #3b230f;
    text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.4);
    display: flex;
    align-items: center;
    gap: 10px;
    padding-left: 6px; /* Symmetrical horizontal margin with close button */
}

.inv-title-group p {
    margin: 3px 0 0 0;
    font-size: 13px;
    font-style: italic;
    color: #63431f;
}

.inv-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.inv-capacity-pill {
    display: none !important;
}

.inv-btn-open-synthesizer {
    background: linear-gradient(180deg, #b8860b 0%, #8b6508 100%);
    color: #fff;
    border: 1px solid #5a3e1b;
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 10.5px;
    font-weight: bold;
    letter-spacing: 1px;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    transition: all 0.2s ease;
}

.inv-btn-open-synthesizer:hover {
    background: linear-gradient(180deg, #d49b10 0%, #9e730a 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.35);
}

.inv-close-btn {
    background: none;
    border: none;
    font-size: 47px; /* Scaled +15% from 41px */
    line-height: 1;
    color: #5a3e1b;
    cursor: pointer;
    padding: 0 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 60px; /* Scaled +15% from 52px */
    min-height: 60px; /* Scaled +15% from 52px */
    transition: color 0.15s, transform 0.15s ease;
}

.inv-close-btn:hover {
    color: #a32214;
    transform: scale(1.1);
}

/* 4x4 Slot Grid Container - Ratio 1x1 Centered */
.inventory-grid-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border: 1px solid rgba(124, 88, 40, 0.35);
    background: rgba(210, 185, 144, 0.25);
    border-radius: 6px;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
    overflow: hidden;
    width: 100%;
}

.inventory-slots-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    grid-template-rows: repeat(4, 1fr);
    gap: 8px;
    height: 100%;
    max-height: 100%;
    aspect-ratio: 6 / 4;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}

/* Single Slot - Responsive Fit Across 6x4 Grid */
.inv-slot {
    position: relative;
    width: 100%;
    height: 100%;
    aspect-ratio: 1 / 1;
    min-width: 0;
    min-height: 0;
    background: #dfcdab;
    border: 1.5px solid #8e6a39;
    border-radius: 6px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.15), 0 2px 4px rgba(0,0,0,0.08);
    overflow: hidden;
    user-select: none;
    padding: 0;
}

.inv-slot:hover {
    border-color: #c79c5e;
    background: #f0e2c5;
    transform: translateY(-2px);
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1), 0 5px 10px rgba(0,0,0,0.18);
}

.inv-slot.empty {
    opacity: 0.7;
    cursor: default;
}
.inv-slot.empty:hover {
    transform: none;
    border-color: #8e6a39;
    background: #dfcdab;
}

.inv-slot.locked {
    opacity: 0.35;
    cursor: not-allowed;
    background: rgba(180, 160, 130, 0.15);
    border: 1.5px dashed #99784e;
}
.inv-slot.locked:hover {
    transform: none;
    border-color: #99784e;
    background: rgba(180, 160, 130, 0.15);
}

.inv-slot-locked-icon {
    font-size: 18px;
    color: #8a6a42;
    opacity: 0.5;
    margin-top: 4px;
}

.inv-slot-num {
    position: absolute;
    top: 6px;
    left: 8px;
    font-size: 14.5px;
    color: #f7eed8;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.95), 0 0 3px rgba(0, 0, 0, 0.9);
    font-weight: 800;
    z-index: 2;
    pointer-events: none;
}

.inv-slot.empty .inv-slot-num {
    color: #8a6a42;
    text-shadow: none;
}

.inv-item-icon {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
    transition: transform 0.2s ease;
    padding: 0;
    box-sizing: border-box;
}

.inv-slot:hover .inv-item-icon {
    transform: scale(1.08);
}

.inv-item-qty {
    position: absolute;
    bottom: 6px;
    right: 8px;
    background: rgba(20, 12, 6, 0.92);
    color: #fce7b0;
    font-size: 14px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 4px;
    border: 1px solid rgba(212, 175, 55, 0.65);
    letter-spacing: 0.5px;
    z-index: 2;
    pointer-events: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

/* Pagination Bar */
.inv-pagination-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    margin-top: 8px;
    border-top: 1px solid rgba(124, 88, 40, 0.35);
    border-bottom: 1px solid rgba(124, 88, 40, 0.35);
    background: rgba(210, 185, 144, 0.2);
    border-radius: 4px;
}

.inv-nav-btn {
    width: 48px;
    min-width: 48px;
    height: 42px;
    background: #e6dac0;
    border: 1.5px solid #876c40;
    border-radius: 6px;
    padding: 0;
    font-size: 22px;
    font-family: 'Cinzel', Georgia, serif;
    font-weight: 900;
    color: #402f18;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    transition: all 0.18s ease;
    flex-shrink: 0;
}

.inv-nav-btn:hover:not(:disabled) {
    background: #876c40;
    color: #f7eed8;
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
}

.inv-nav-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    border-color: #b5a484;
    transform: none;
}

.inv-pagination-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}

.inv-folio-text {
    display: none !important; /* "tulisan 'Folio 1 ...' itu ilangin aja" */
    font-size: 13.5px;
    font-weight: 700;
    color: #451a03;
    font-family: 'Cinzel', Georgia, serif;
    letter-spacing: 0.5px;
}

.inv-dots-container {
    display: flex;
    gap: 6px;
    align-items: center;
}

.inv-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #c7b897;
    border: 1px solid #8c734b;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

.inv-dot:hover {
    background: #9e7b4c;
}

.inv-dot.active {
    background: #731e18;
    border-color: #400f0b;
    transform: scale(1.25);
}

/* Tier Glow Borders */
.inv-slot.tier-normal {
    border-color: #0284c7;
    background: linear-gradient(135deg, rgba(2, 132, 199, 0.12) 0%, #dfcdab 100%);
}
.inv-slot.tier-great {
    border-color: #ea580c;
    background: linear-gradient(135deg, rgba(234, 88, 12, 0.14) 0%, #dfcdab 100%);
}
.inv-slot.tier-rare {
    border-color: #eab308;
    background: linear-gradient(135deg, rgba(234, 179, 8, 0.16) 0%, #dfcdab 100%);
}
.inv-slot.tier-very_rare {
    border-color: #9333ea;
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.16) 0%, #dfcdab 100%);
}
.inv-slot.tier-legend {
    border-color: #06b6d4;
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.22) 0%, #dfcdab 100%);
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.4);
}

/* Selected Slot - Thick Dark Brown Frame ("cukup kasih frame cokelat tebal di item yang sedang di select") */
.inv-slot.selected,
.wb-inv-slot.selected {
    border: 3.5px solid #3b230f !important;
    outline: 2px solid #5a3818 !important;
    outline-offset: -1px !important;
    box-shadow: 0 0 12px rgba(59, 35, 15, 0.85), inset 0 0 8px rgba(59, 35, 15, 0.4) !important;
    z-index: 10;
}

.inv-slot.selected:hover,
.wb-inv-slot.selected:hover {
    border-color: #3b230f !important;
    outline-color: #5a3818 !important;
}

/* Item Detail Popover / Footer */
.inventory-footer-info {
    display: none !important; /* "informasi yang di bagian paling bawah itu juga ilangin aja" */
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid rgba(124, 88, 40, 0.4);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: #5a3818;
}

.inv-detail-preview {
    display: flex;
    align-items: center;
    gap: 12px;
}

.inv-detail-name {
    font-weight: bold;
    font-size: 12.5px;
    color: #2b1d0c;
}

.inv-tier-tag {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 3px;
    font-size: 9px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.inv-tier-tag.normal { background: #0284c7; color: #fff; }
.inv-tier-tag.great { background: #ea580c; color: #fff; }
.inv-tier-tag.rare { background: #eab308; color: #1a1205; }
.inv-tier-tag.very_rare { background: #9333ea; color: #fff; }
.inv-tier-tag.legend { background: #06b6d4; color: #082f49; }

/* ==========================================================================
   WORKBENCH SIDEBAR INVENTORY (4x4 Grid in Meja Kerja)
   ========================================================================== */
.wb-inv-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #8c5d2e;
    padding-bottom: 4px;
    margin-top: 4px;
    font-family: 'Cinzel', Georgia, serif;
    font-size: 11.5px;
    color: #3b230f;
    letter-spacing: 1px;
    flex-shrink: 0;
}

.wb-inv-capacity-pill {
    display: none !important;
}

.wb-inv-grid-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 6px;
    border: 1px solid rgba(124, 88, 40, 0.35);
    background: rgba(210, 185, 144, 0.25);
    border-radius: 6px;
    box-shadow: inset 0 1px 5px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
    overflow: hidden;
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    max-height: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wb-inv-slots-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: auto;
    gap: 6px;
    width: 100%;
    height: auto;
    box-sizing: border-box;
    touch-action: pan-y;
    will-change: transform, opacity;
}

.wb-inv-slot {
    position: relative;
    background: #dfcdab;
    border: 1.5px solid #8e6a39;
    border-radius: 5px;
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    min-height: 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.12), 0 1px 3px rgba(0,0,0,0.06);
    overflow: hidden;
    user-select: none;
    padding: 0;
}

.wb-inv-slot:hover {
    border-color: #c79c5e;
    background: #f0e2c5;
    transform: translateY(-1px);
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.1), 0 3px 6px rgba(0,0,0,0.15);
}

.wb-inv-slot.empty {
    opacity: 0.7;
    cursor: default;
}
.wb-inv-slot.empty:hover {
    transform: none;
    border-color: #8e6a39;
    background: #dfcdab;
}

.wb-inv-slot.locked {
    opacity: 0.35;
    cursor: not-allowed;
    background: rgba(180, 160, 130, 0.15);
    border: 1px dashed #99784e;
}
.wb-inv-slot.locked:hover {
    transform: none;
    border-color: #99784e;
    background: rgba(180, 160, 130, 0.15);
}

.wb-inv-slot-num {
    position: absolute;
    top: 5px;
    left: 6px;
    font-size: 13px;
    color: #f7eed8;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.95), 0 0 3px rgba(0, 0, 0, 0.9);
    font-weight: 700;
    line-height: 1;
    z-index: 2;
    pointer-events: none;
}

.wb-inv-slot.empty .wb-inv-slot-num {
    color: #8a6a42;
    text-shadow: none;
}

.wb-inv-item-icon {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
    transition: transform 0.18s ease;
}

.wb-inv-slot:hover .wb-inv-item-icon {
    transform: scale(1.08);
}

.wb-inv-item-qty {
    position: absolute;
    bottom: 5px;
    right: 5px;
    background: rgba(20, 12, 6, 0.92);
    color: #fce7b0;
    font-size: 13px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid rgba(212, 175, 55, 0.65);
    line-height: 1.1;
    z-index: 2;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

/* Tier Glow Borders for Workbench Slots */
.wb-inv-slot.tier-normal {
    border-color: #0284c7;
    box-shadow: 0 0 5px rgba(2, 132, 199, 0.35);
}
.wb-inv-slot.tier-great {
    border-color: #ea580c;
    box-shadow: 0 0 5px rgba(234, 88, 12, 0.35);
}
.wb-inv-slot.tier-rare {
    border-color: #eab308;
    box-shadow: 0 0 6px rgba(234, 179, 8, 0.4);
}
.wb-inv-slot.tier-very_rare {
    border-color: #9333ea;
    box-shadow: 0 0 6px rgba(147, 51, 234, 0.4);
}
.wb-inv-slot.tier-legend {
    border-color: #06b6d4;
    box-shadow: 0 0 8px rgba(6, 182, 212, 0.5);
}

/* Workbench Pagination Bar */
.wb-inv-pagination-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    margin-top: 0;
    border-top: 1px solid rgba(124, 88, 40, 0.35);
    background: rgba(210, 185, 144, 0.2);
    border-radius: 4px;
    flex-shrink: 0;
}

.wb-inv-nav-btn {
    background: #3b2210;
    border: 1px solid #754c25;
    border-radius: 6px;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    font-size: 18px;
    font-weight: 700;
    color: #f7eed8;
    cursor: pointer;
    transition: all 0.15s ease;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}

.wb-inv-nav-btn:hover:not(:disabled) {
    background: #5d381b;
    border-color: #baa06e;
    color: #ffffff;
}

.wb-inv-nav-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    background: #3b2210;
    border-color: #754c25;
    color: #f7eed8;
}

.wb-inv-pagination-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}

.wb-inv-page-text {
    font-size: 14px;
    font-weight: 700;
    color: #4a341a;
    font-family: 'Cinzel', Georgia, serif;
    letter-spacing: 0.5px;
}

.wb-inv-dots {
    display: flex;
    gap: 4px;
    align-items: center;
}

.wb-inv-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #c7b897;
    border: 1px solid #8c734b;
    cursor: pointer;
    transition: background 0.15s, transform 0.15s;
}

.wb-inv-dot.active {
    background: #731e18;
    border-color: #400f0b;
    transform: scale(1.2);
}
