/* Shop UI Styles */
#shop-page {
    background-color: #1a1a2e;
    color: #fff;
    display: flex;
    flex-direction: column;
}

.shop-gold-display {
    position: absolute;
    right: 20px;
    top: 20px;
    background: rgba(0, 0, 0, 0.6);
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid #ffd700;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.2em;
    color: #ffd700;
}

.shop-container {
    display: flex;
    flex: 1;
    padding: 20px;
    gap: 20px;
    overflow: hidden;
}

/* Left Section: Fixed Items */
.shop-section.left {
    width: 30%;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    border: 1px solid #444;
}

/* Right Section: Random Items */
.shop-section.right {
    width: 70%;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    border: 1px solid #444;
}

.shop-section-title {
    margin-top: 0;
    margin-bottom: 15px;
    color: #4ecca3;
    font-size: 1.4em;
    border-bottom: 2px solid #4ecca3;
    padding-bottom: 8px;
}

.shop-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 2px solid #e94560;
    padding-bottom: 8px;
}

.shop-section.right .shop-section-title {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
    color: #e94560;
}

.refresh-btn {
    background: linear-gradient(135deg, #e67e22 0%, #d35400 100%);
    border: none;
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: transform 0.2s, box-shadow 0.2s;
}

.refresh-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 10px rgba(230, 126, 34, 0.6);
}

.refresh-btn:active {
    transform: scale(0.95);
}

/* Grid Layouts */
.shop-grid {
    display: grid;
    gap: 10px;
    overflow-y: auto;
    padding-right: 5px;
}

/* Left list is vertical */
.shop-section.left .shop-grid.compact-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
}

/* Right list is grid (2-3 columns depending on width) */
.shop-section.right .shop-grid.compact-list {
    grid-template-columns: repeat(2, 1fr);
    max-height: 180px;
}

/* Item Card */
.shop-item-card {
    background: #252540;
    border: 2px solid #555;
    border-radius: 8px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 120px;
}

.shop-item-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    border-color: #aaa;
}

.shop-item-card:active {
    transform: translateY(0);
}

/* Rarity Colors */
.shop-item-card.rarity-1 { border-color: #bdc3c7; } /* Common - Gray */
.shop-item-card.rarity-2 { border-color: #3498db; box-shadow: 0 0 5px rgba(52, 152, 219, 0.2); } /* Rare - Blue */
.shop-item-card.rarity-3 { border-color: #f1c40f; box-shadow: 0 0 8px rgba(241, 196, 15, 0.3); } /* Legendary - Gold */

/* Empty / Sold Out */
.shop-item-card.empty-slot {
    background: #151525;
    border: 2px dashed #444;
    justify-content: center;
    color: #555;
    cursor: default;
    min-height: 100px;
}
.shop-item-card.empty-slot:hover {
    transform: none;
    box-shadow: none;
    border-color: #444;
}

.shop-item-card.sold-out {
    opacity: 0.5;
    filter: grayscale(100%);
    cursor: not-allowed;
}
.shop-item-card.sold-out::after {
    content: "SOLD";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-15deg);
    font-size: 1.5em;
    font-weight: bold;
    color: #e74c3c;
    border: 2px solid #e74c3c;
    padding: 2px 5px;
    border-radius: 4px;
    opacity: 0.8;
}

.item-badge {
    position: absolute;
    top: 4px;
    left: 4px;
    font-size: 0.6em;
    padding: 2px 4px;
    border-radius: 3px;
    color: white;
    font-weight: bold;
    text-transform: uppercase;
}

.item-icon-box {
    width: 48px;
    height: 48px;
    background: rgba(0,0,0,0.3);
    border-radius: 8px;
    margin: 12px 0 5px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.shop-item-name {
    font-size: 0.85em;
    font-weight: bold;
    text-align: center;
    margin: 2px 0;
    color: #ecf0f1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.shop-item-price {
    font-size: 0.9em;
    color: #f1c40f;
    font-weight: bold;
    margin-top: auto;
}

.shop-item-stock {
    font-size: 0.7em;
    color: #95a5a6;
    margin-top: 2px;
}

/* Scrollbar styling */
.shop-grid::-webkit-scrollbar {
    width: 6px;
}
.shop-grid::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.1);
}
.shop-grid::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 3px;
}
