.marketplace-container {
    display: flex;
    flex-direction: row;
    gap: 30px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    height: calc(100vh - 180px);
}

.inventory-section {
    flex: 3;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 20px;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
}

.basket-section {
    flex: 1;
    min-width: 300px;
    display: flex;
    flex-direction: column;
}

.basket-card {
    background: linear-gradient(145deg, rgba(30, 30, 45, 0.9), rgba(20, 20, 30, 0.9));
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 15px;
    padding: 20px;
    height: 100%;
    display: flex;
    flex-direction: column;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
}

.basket-card h3 {
    margin-top: 0;
    margin-bottom: 5px;
    font-size: 1.5rem;
    color: #00ced1;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.basket-card p#basketCount {
    color: #aaa;
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.basket-items {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 20px;
    padding-right: 10px;
}

.empty-basket-msg {
    color: #666;
    font-style: italic;
    text-align: center;
    margin-top: 50px;
}

.btn-primary {
    background: linear-gradient(90deg, #1e90ff, #00ced1);
    color: white;
    border: none;
    padding: 15px;
    border-radius: 8px;
    font-size: 1.1rem;
    font-family: 'Outfit', sans-serif;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    text-align: center;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 206, 209, 0.4);
}

.btn-primary:disabled {
    background: #444;
    color: #888;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.loading-spinner {
    text-align: center;
    color: white;
    font-size: 1.5rem;
    margin-top: 100px;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { opacity: 0.5; }
    50% { opacity: 1; }
    100% { opacity: 0.5; }
}

.inventory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
}

.item-card {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.item-card:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6);
}

.item-card.selected {
    border-color: #00ced1;
    background: rgba(0, 206, 209, 0.1);
    box-shadow: 0 0 15px rgba(0, 206, 209, 0.3);
}

.item-card.selected::after {
    content: '✓';
    position: absolute;
    top: 10px;
    right: 10px;
    background: #00ced1;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9rem;
}

.item-image {
    width: 120px;
    height: 120px;
    object-fit: contain;
    margin-bottom: 15px;
    filter: drop-shadow(0 5px 5px rgba(0,0,0,0.5));
    transition: transform 0.3s ease;
}

.item-card:hover .item-image {
    transform: scale(1.1);
}

.item-name {
    color: white;
    font-size: 0.9rem;
    margin-bottom: 5px;
    font-weight: bold;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-type {
    color: #888;
    font-size: 0.8rem;
}

.basket-item {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.3);
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.basket-item-img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    margin-right: 15px;
}

.basket-item-info {
    flex: 1;
}

.basket-item-name {
    color: white;
    font-size: 0.85rem;
    margin: 0 0 3px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}

.basket-item-remove {
    background: rgba(255, 71, 87, 0.2);
    color: #ff4757;
    border: 1px solid rgba(255, 71, 87, 0.5);
    border-radius: 4px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.8rem;
}

.basket-item-remove:hover {
    background: #ff4757;
    color: white;
}

/* Custom scrollbar for webkit */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.4);
}

@media (max-width: 900px) {
    .marketplace-container {
        flex-direction: column;
        height: auto;
    }
    
    .inventory-section {
        max-height: 60vh;
    }
    
    .basket-section {
        max-height: 40vh;
    }
}
