/* Стили для карточек фонов */
.background-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    border: 3px solid transparent;
    height: 200px;
}

.background-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.background-card-active {
    border-color: #28a745;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.3);
}

.background-card-image {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-bottom: 1px solid #eee;
}

.background-card-name {
    padding: 10px 12px 5px;
    font-weight: 600;
    font-size: 14px;
    color: #333;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.background-price {
    text-align: center;
    font-weight: bold;
    font-size: 16px;
    color: #28a745;
    padding: 0 12px 5px;
}

.background-price.free {
    color: #007bff;
}

.background-wearers {
    text-align: center;
    font-size: 12px;
    color: #666;
    padding: 0 12px 8px;
}

.first-wearer {
    color: #ff6b00;
    font-weight: bold;
}

.btn-get-free, .btn-buy-background {
    width: 100%;
    padding: 8px 12px;
    border: none;
    background: #007bff;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
    font-size: 12px;
}

.btn-get-free:hover {
    background: #0056b3;
}

.btn-buy-background {
    background: #28a745;
}

.btn-buy-background:hover {
    background: #1e7e34;
}

/* Редкости фонов */
.background-rarity-common {
    border-left: 4px solid #969696;
}

.background-rarity-rare {
    border-left: 4px solid #0070dd;
}

.background-rarity-epic {
    border-left: 4px solid #a335ee;
}

.background-rarity-legendary {
    border-left: 4px solid #ff8000;
}

.background-rarity-mythical {
    border-left: 4px solid #e60000;
}

.background-card-collection-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(40, 167, 69, 0.9);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: bold;
}

.btn-free-slot {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(220, 53, 69, 0.9);
    color: white;
    border: none;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    cursor: pointer;
}

.btn-free-slot:hover {
    background: rgba(220, 53, 69, 1);
}

/* Админ панель */
.background-item {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.background-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #dee2e6;
}

.background-info {
    display: flex;
    gap: 15px;
}

.background-image-preview {
    width: 150px;
    height: 100px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #ddd;
}

.background-details {
    flex: 1;
}

.background-actions {
    display: flex;
    gap: 10px;
}

/* Бейджи редкостей */
.rarity-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    color: white;
}

.rarity-common { background: #969696; }
.rarity-rare { background: #0070dd; }
.rarity-epic { background: #a335ee; }
.rarity-legendary { background: #ff8000; }
.rarity-mythical { background: #e60000; }

/* Загрузчики */
.loader {
    text-align: center;
    padding: 20px;
}

.spinner-border {
    width: 2rem;
    height: 2rem;
}

/* Адаптивность */
@media (max-width: 768px) {
    .background-info {
        flex-direction: column;
    }
    
    .background-image-preview {
        width: 100%;
        height: 150px;
    }
    
    .background-card {
        height: auto;
    }
}