/* Spinner style */
.spinner {
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid #fff;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* CS Item tile styling */
.cs-item-tile {
    width: 100%;
    background-color: #0c0e16;
    border-radius: 0.375rem;
    overflow: hidden;
    position: relative;
    transition: transform 0.2s;
    /* Remove fixed aspect ratio to allow for dynamic content */
    /* aspect-ratio: 1 / 1.6; */
    min-height: 300px;
    display: flex;
    flex-direction: column;
}

.cs-item-tile:hover {
    transform: translateY(-3px);
}

.cs-item-image {
    width: 100%;
    height: 180px; /* Fixed height instead of percentage */
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    padding: 0.75rem;
}

.cs-item-image img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.5));
    z-index: 2;
}

.cs-wear-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    padding: 1px 4px;
    border-radius: 2px;
    z-index: 3;
}

.cs-item-details {
    padding: 0.5rem 0.75rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    position: relative;
    z-index: 3;
}

.cs-item-type {
    font-size: 0.875rem;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.125rem;
}

.cs-item-name {
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.5rem;
}

.cs-item-price {
    font-size: 1.25rem;
    font-weight: bold;
    color: white;
    margin-bottom: 0.5rem;
}

.cs-buy-button {
    width: 100%;
    height: 32px;
    padding: 0;
    background-color: transparent;
    color: white;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid; /* Border color is set inline based on item color */
    border-radius: 1.375rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
    margin-top: auto;
    margin-bottom: 0.5rem;
    overflow: visible;
    white-space: nowrap;
    line-height: 1;
    position: relative;
    z-index: 5;
}

/* Hover effect is handled by inline onmouseover/onmouseout */

.cs-buy-button:disabled {
    background-color: transparent;
    border-color: #4b5563;
    color: #9ca3af;
    cursor: not-allowed;
}

/* Active category button - color is set dynamically in JavaScript */
button[data-category].active {
    color: white;
}

/* Pagination styling */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-top: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.pagination-controls {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.page-numbers {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    max-width: 100%;
    overflow-x: auto;
    padding: 0.25rem;
}

.page-button {
    min-width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.375rem;
    transition: background-color 0.2s;
}

@media (max-width: 640px) {
    .pagination-container {
        flex-direction: column;
        align-items: center;
    }
    
    .pagination-controls {
        width: 100%;
        justify-content: center;
    }
}

/* Modal animations */
@keyframes modalEnter {
    0%   { opacity: 0; transform: scale(0.9); }
    100% { opacity: 1; transform: scale(1); }
}

.modal-animate {
    animation: modalEnter 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* Balance flash animations */
@keyframes blinkRed {
    0%   { background-color: transparent; }
    50%  { background-color: rgba(255,0,0,0.3); }
    100% { background-color: transparent; }
}

@keyframes blinkGreen {
    0%   { background-color: transparent; }
    50%  { background-color: rgba(0,255,0,0.3); }
    100% { background-color: transparent; }
}

.balance-flash-red {
    animation: blinkRed 1s ease;
}

.balance-flash-green {
    animation: blinkGreen 1s ease;
}
