/**
 * Стили для индикаторов качества фотографий товаров
 * Ненавязчивое отображение в углу фото без отвлечения внимания
 */

/* Миниатюрный индикатор в правом верхнем углу фото */
.quality-badge-mini {
    display: inline-block;
    font-size: 1rem;
    opacity: 0.8;
    transition: opacity 0.2s ease-in-out;
    cursor: help;
}

.quality-badge-mini:hover {
    opacity: 1;
}

/* Контейнер с позиционированием для индикатора качества */
.quality-indicator {
    font-size: 0.9rem;
    z-index: 10;
    pointer-events: none; /* Не блокирует клики на фото */
}

.quality-indicator .badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.4rem 0.6rem;
    font-size: 0.85rem;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    border-radius: 4px;
}

.quality-indicator .badge.fs-5 {
    font-size: 1.2rem !important;
}

.quality-indicator .badge.fs-6 {
    font-size: 1rem !important;
}

/* Фотографии в сетке на странице товара */
.photo-card-with-quality {
    position: relative;
    overflow: hidden;
    border-radius: 4px;
}

.photo-card-with-quality .photo-container {
    position: relative;
    width: 100%;
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fa;
    cursor: pointer;
    overflow: hidden;
}

.photo-card-with-quality .photo-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.photo-card-with-quality .quality-indicator {
    pointer-events: none;
}

/* В списках товаров - компактный вид */
.photo-list-item {
    position: relative;
    display: inline-block;
}

.photo-list-item img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
}

.photo-list-item .quality-icon {
    position: absolute;
    top: -4px;
    right: -4px;
    font-size: 0.9rem;
    display: inline-block;
    background: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Для таблиц - строка со статусом качества */
.quality-status-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.25rem;
    font-size: 0.75rem;
}

.quality-status-row .badge {
    padding: 0.25rem 0.5rem;
    font-size: 0.65rem;
}

/* Tooltip для качества */
.bs-tooltip-top .tooltip-inner {
    background-color: rgba(33, 37, 41, 0.95);
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    font-size: 0.875rem;
}

.bs-tooltip-auto[data-popper-placement^="top"] .tooltip-arrow::before,
.bs-tooltip-top .tooltip-arrow::before {
    border-top-color: rgba(33, 37, 41, 0.95);
}

/* Ненавязчивые цвета для indirectных уровней качества */
.quality-indicator .badge.bg-success {
    background-color: #28a745 !important;
}

.quality-indicator .badge.bg-info {
    background-color: #17a2b8 !important;
}

.quality-indicator .badge.bg-warning {
    background-color: #ffc107 !important;
    color: #333 !important;
}

.quality-indicator .badge.bg-danger {
    background-color: #dc3545 !important;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 576px) {
    .quality-indicator {
        font-size: 0.8rem;
    }

    .quality-indicator .badge {
        padding: 0.3rem 0.5rem;
        font-size: 0.75rem;
    }

    .photo-list-item .quality-icon {
        width: 18px;
        height: 18px;
        font-size: 0.8rem;
    }
}

/* Анимация при наведении для модальной галереи */
.carousel-item .quality-indicator {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Для скрытия warning значка если фото в порядке */
.quality-indicator .badge.bg-danger:not(:has(.badge)) {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.8;
    }
    50% {
        opacity: 1;
    }
}
