/* Shop Container - Mirroring Boss Modal */
.shop-container {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 100000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
    pointer-events: none;
}

.shop-container.active {
    display: flex;
    pointer-events: auto;
}

/* Disable touch controls when shop is open */
.shop-container.active ~ .touch-controls,
.shop-container.active + * .touch-controls,
body .shop-container.active ~ .touch-controls {
    pointer-events: none !important;
    z-index: 100 !important;
    opacity: 0.3;
}

.shop-container.active * {
    pointer-events: auto;
}

/* Shop Panel - styled like boss-content */
.shop-panel {
    background: #111111;
    border: 1px solid #333;
    border-radius: 8px;
    width: min(700px, 95vw);
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 20px rgba(0,0,0,0.8);
    color: #e0e0e0;
    font-family: Arial, sans-serif;
    position: relative;
    overflow: hidden;
}

/* Shop Header - styled like boss-header */
.shop-header {
    background: linear-gradient(180deg, #222 0%, #111 100%);
    border-bottom: 1px solid #444;
    padding: 15px;
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.shop-header h3 {
    margin: 0;
    color: #fff;
    font-size: 16px;
    font-weight: bold;
}

/* Shop Body - styled like boss-body for vertical side-by-side tabs and content */
.shop-body {
    display: flex;
    flex-direction: row;
    padding: 15px;
    gap: 15px;
    height: 65vh; /* Fixed height for independent scrolling */
    min-height: 200px;
    max-height: calc(85vh - 60px); /* Fits inside panel */
    overflow: hidden;
    width: 100%;
}

/* Shop Tabs - styled like boss-tabs */
.shop-tabs {
    display: flex;
    flex-direction: column;
    width: 150px;
    min-width: 150px;
    gap: 5px;
    border-right: 1px solid #333;
    padding-right: 15px;
    overflow-y: auto;
}

.shop-tab {
    flex-shrink: 0;
    background: #222;
    border: 1px solid #444;
    color: #ccc;
    padding: 10px;
    text-align: left;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
    font-weight: bold;
    font-size: 13px;
    white-space: nowrap;
}

.shop-tab:hover {
    background: #333;
    color: #fff;
}

.shop-tab.active {
    background: #555;
    color: #ff9900;
    border-color: #777;
}

/* Shop Close Button */
.shop-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.shop-close img {
    width: 20px;
    height: 20px;
}

/* Shop Content */
.shop-content {
    flex: 1;
    overflow-y: auto;
    padding-right: 5px;
    max-height: 100%;
    display: flex;
    flex-direction: column;
}

/* Pagination */
.shop-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 10px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: auto;
}

.shop-pagination-button {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    transition: all 0.2s ease;
    min-width: 35px;
}

.shop-pagination-button:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.shop-pagination-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.shop-pagination-button.active {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
}

.shop-pagination-info {
    color: #95a5a6;
    font-size: 11px;
    margin: 0 8px;
}

.shop-content::-webkit-scrollbar {
    width: 8px;
}

.shop-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.shop-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.shop-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Shop Items Grid */
.shop-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 10px;
    padding: 5px 0;
}

.shop-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.shop-item:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.shop-item-image {
    width: 50px;
    height: 50px;
    object-fit: contain;
    margin-bottom: 6px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    padding: 3px;
}

.shop-item-name {
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 4px;
    min-height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.2;
}

.shop-item-quantity {
    color: #95a5a6;
    font-size: 10px;
    margin-bottom: 6px;
}

.shop-item-price {
    display: flex;
    flex-direction: column;
    gap: 3px;
    width: 100%;
    margin-top: auto;
}

.shop-price-gold,
.shop-price-ruby {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
}

.shop-price-gold {
    background: rgba(241, 196, 15, 0.2);
    border: 1px solid rgba(241, 196, 15, 0.4);
    color: #f1c40f;
}

.shop-price-ruby {
    background: rgba(231, 76, 60, 0.2);
    border: 1px solid rgba(231, 76, 60, 0.4);
    color: #e74c3c;
}

.shop-price-gold img,
.shop-price-ruby img {
    width: 12px;
    height: 12px;
    object-fit: contain;
}

.shop-buy-button {
    width: 100%;
    padding: 6px;
    margin-top: 6px;
    background: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.shop-buy-button:hover {
    background: #2a2a2a;
    border-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.02);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.shop-buy-button:active {
    transform: scale(0.98);
    background: #0a0a0a;
}

.shop-buy-button:disabled {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.5);
    cursor: not-allowed;
    transform: none;
}

.shop-buy-button:disabled:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: none;
    box-shadow: none;
}

/* Loading and Empty States */
.shop-loading,
.shop-empty {
    text-align: center;
    padding: 40px 20px;
    color: #95a5a6;
    font-size: 16px;
}

.shop-empty-icon {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

/* Responsive - Mobile giống PC */
@media (max-width: 768px) {
    .shop-panel {
        width: 88%;
        max-width: 100%;
        max-height: 55vh;
    }

    .shop-header {
        padding: 3px 5px;
    }

    .shop-header h3 {
        font-size: 14px;
    }

    .shop-close {
        font-size: 16px;
        width: 20px;
        height: 20px;
    }

    .shop-content {
        padding: 3px;
    }

    .shop-items {
        grid-template-columns: repeat(auto-fill, minmax(75px, 1fr));
        gap: 4px;
        padding: 2px 0;
    }

    .shop-item {
        padding: 4px;
    }

    .shop-item-image {
        width: 32px;
        height: 32px;
        margin-bottom: 3px;
    }

    .shop-item-name {
        font-size: 9px;
        min-height: 20px;
        margin-bottom: 2px;
    }

    .shop-item-quantity {
        font-size: 8px;
        margin-bottom: 2px;
    }

    .shop-price-gold,
    .shop-price-ruby {
        padding: 2px 4px;
        font-size: 8px;
        gap: 2px;
    }

    .shop-price-gold img,
    .shop-price-ruby img {
        width: 8px;
        height: 8px;
    }

    .shop-buy-button {
        padding: 3px;
        font-size: 8px;
        margin-top: 2px;
    }

    .shop-pagination {
        padding: 5px 0;
        gap: 4px;
    }

    .shop-pagination-button {
        padding: 3px 6px;
        font-size: 9px;
        min-width: 28px;
    }

    .shop-pagination-info {
        font-size: 9px;
        margin: 0 4px;
    }
}

/* Shop button - now inside dropdown, remove old positioning */
.shop-toggle.minimap-button {
    display: none; /* Hide old shop button if exists */
}

.shop-toggle.menu-dropdown-item {
    display: flex; /* Show in dropdown */
}

