/* ========================================
   OSRS-Style Shop Interface
   Authentic RuneScape shop appearance
   ======================================== */

/* Main Shop Container */
.osrs-shop-container {
    background: linear-gradient(135deg, #3e3529 0%, #4a3c2f 50%, #3e3529 100%);
    border: 3px solid #0d0c0a;
    border-radius: 0;
    width: 100%;
    max-width: 100%;
    box-shadow:
        inset 0 0 20px rgba(0, 0, 0, 0.5),
        0 4px 12px rgba(0, 0, 0, 0.4);
    font-family: 'RuneScape Small', 'Runescape UF', Arial, sans-serif;
    position: relative;
}

/* Shop Header/Title Bar */
.osrs-shop-header {
    background: linear-gradient(to bottom, #4a3d30 0%, #3d3020 100%);
    border-bottom: 2px solid #0d0c0a;
    padding: 6px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.osrs-shop-header .shop-title {
    color: #ff981f;
    font-size: 16px;
    font-weight: bold;
    text-shadow: 1px 1px 0 #000;
    letter-spacing: 0.5px;
}

/* Shop Content Area */
.osrs-shop-content {
    display: flex;
    padding: 8px;
    background: rgba(0, 0, 0, 0.2);
    margin: 4px;
    border: 1px solid #0d0c0a;
}

/* Shop Item Grid - 8 columns x 5 rows */
.osrs-shop-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: repeat(5, 42px);
    gap: 2px;
    background: #1a1612;
    border: 1px solid #0d0c0a;
    padding: 4px;
    width: 100%;
}

/* Individual Shop Slot */
.osrs-shop-slot {
    width: 100%;
    height: 100%;
    background: #2d2820;
    border: 1px solid #1a1612;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.1s ease;
}

.osrs-shop-slot:hover {
    background: #3d3830;
    border-color: #5c4a32;
}

.osrs-shop-slot.empty {
    cursor: default;
}

.osrs-shop-slot.empty:hover {
    background: #2d2820;
    border-color: #1a1612;
}

/* Item sprite in slot */
.osrs-shop-slot img {
    max-width: 32px;
    max-height: 32px;
    object-fit: contain;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

/* Item Quantity Display */
.osrs-shop-slot .item-qty {
    position: absolute;
    top: 1px;
    left: 2px;
    font-size: 10px;
    font-weight: bold;
    text-shadow:
        -1px -1px 0 #000,
        1px -1px 0 #000,
        -1px 1px 0 #000,
        1px 1px 0 #000;
    z-index: 1;
    font-family: 'RuneScape Small', 'Courier New', monospace;
    line-height: 1;
}

/* Quantity color coding (OSRS style) */
.osrs-shop-slot .item-qty.qty-yellow {
    color: #ffff00;
}

.osrs-shop-slot .item-qty.qty-white {
    color: #ffffff;
}

.osrs-shop-slot .item-qty.qty-green {
    color: #00ff00;
}

/* Out of stock styling */
.osrs-shop-slot.out-of-stock {
    opacity: 0.5;
    filter: grayscale(30%);
}

.osrs-shop-slot.out-of-stock:hover {
    opacity: 0.6;
}

/* Low stock indicator */
.osrs-shop-slot.low-stock {
    box-shadow: inset 0 0 8px rgba(255, 100, 0, 0.3);
}

/* Shop Footer */
.osrs-shop-footer {
    background: linear-gradient(to bottom, #3d3020 0%, #2d2518 100%);
    border-top: 2px solid #0d0c0a;
    padding: 6px 10px;
    text-align: center;
    color: #c9b896;
    font-size: 11px;
    text-shadow: 1px 1px 0 #000;
}

/* ========================================
   Shop Context Menu
   ======================================== */

.osrs-shop-context {
    position: fixed;
    background: #3e3529;
    border: 2px solid #0d0c0a;
    min-width: 120px;
    z-index: 10000;
    display: none;
    box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.5);
    font-family: 'RuneScape Small', Arial, sans-serif;
}

.osrs-shop-context.visible {
    display: block;
}

.osrs-shop-context .context-title {
    background: linear-gradient(to bottom, #4a3d30 0%, #3d3020 100%);
    padding: 4px 8px;
    color: #ff981f;
    font-weight: bold;
    font-size: 12px;
    text-shadow: 1px 1px 0 #000;
    border-bottom: 1px solid #0d0c0a;
}

.osrs-shop-context .context-option {
    padding: 3px 8px;
    cursor: pointer;
    font-size: 12px;
    color: #ffffff;
    text-shadow: 1px 1px 0 #000;
}

.osrs-shop-context .context-option:hover {
    background: #4a3d30;
}

.osrs-shop-context .context-option.disabled {
    color: #666;
    cursor: not-allowed;
}

.osrs-shop-context .context-option.disabled:hover {
    background: transparent;
}

.osrs-shop-context .context-option .action-name {
    color: #ff981f;
}

.osrs-shop-context .context-option .target-name {
    color: #00ffff;
}

.osrs-shop-context .context-option.examine .action-name {
    color: #ff981f;
}

.osrs-shop-context .context-separator {
    height: 1px;
    background: #0d0c0a;
    margin: 2px 4px;
}

.osrs-shop-context .context-cancel {
    padding: 3px 8px;
    cursor: pointer;
    font-size: 12px;
    color: #ffffff;
    text-shadow: 1px 1px 0 #000;
}

/* ========================================
   Inventory Panel While Shop Open
   ======================================== */

.shop-inventory-hint {
    color: #c9b896;
    font-size: 10px;
    text-align: center;
    padding: 4px;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid #0d0c0a;
}

/* ========================================
   Shop Messages (in game log)
   ======================================== */

.shop-message {
    color: #00ff00;
}

.shop-message.buy {
    color: #00ff00;
}

.shop-message.sell {
    color: #ffff00;
}

.shop-message.error {
    color: #ff4444;
}

.shop-message.value {
    color: #00ffff;
}

/* ========================================
   Amount Input Modal (Buy X / Sell X)
   ======================================== */

.osrs-shop-amount-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #3e3529;
    border: 3px solid #0d0c0a;
    padding: 15px;
    z-index: 10001;
    display: none;
    text-align: center;
    min-width: 200px;
}

.osrs-shop-amount-modal.visible {
    display: block;
}

.osrs-shop-amount-modal .modal-title {
    color: #ff981f;
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 10px;
    text-shadow: 1px 1px 0 #000;
}

.osrs-shop-amount-modal input[type="number"] {
    width: 100%;
    padding: 6px;
    background: #2d2820;
    border: 2px solid #0d0c0a;
    color: #ffffff;
    font-size: 14px;
    text-align: center;
    margin-bottom: 10px;
}

.osrs-shop-amount-modal input[type="number"]:focus {
    outline: none;
    border-color: #ff981f;
}

.osrs-shop-amount-modal .modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.osrs-shop-amount-modal .modal-btn {
    padding: 5px 15px;
    background: linear-gradient(to bottom, #5c4a32 0%, #3d3020 100%);
    border: 2px solid #0d0c0a;
    color: #ff981f;
    font-weight: bold;
    cursor: pointer;
    font-size: 12px;
}

.osrs-shop-amount-modal .modal-btn:hover {
    background: linear-gradient(to bottom, #6d5a42 0%, #4d4030 100%);
}

.osrs-shop-amount-modal .modal-btn.confirm {
    color: #00ff00;
}

.osrs-shop-amount-modal .modal-btn.cancel {
    color: #ff6666;
}

/* ========================================
   Responsive Adjustments
   ======================================== */

@media (max-width: 520px) {
    .osrs-shop-grid {
        grid-template-rows: repeat(5, 36px);
    }

    .osrs-shop-slot img {
        max-width: 28px;
        max-height: 28px;
    }

    .osrs-shop-slot .item-qty {
        font-size: 9px;
    }
}
