/* Custom styles for the training page */

.preview-pair {
    display: flex;
    flex-direction: column;
    border: 1px solid hsl(var(--muted));
    border-radius: 0.5rem;
    overflow: hidden;
}

.preview-image-container {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-image-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.preview-image-container::after {
    content: attr(data-type);
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.25rem;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    font-size: 0.75rem;
    text-align: center;
}

.color-img::after {
    content: 'Color';
}

.mask-img::after {
    content: 'Mask';
}

/* Loading animation */
@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.visible {
    display: flex !important;
}

/* Make sure hidden class works properly */
.hidden {
    display: none !important;
}

/* Chart styling */
#metrics-chart {
    width: 100% !important;
    height: 100% !important;
}

/* Test image styling */
#test-image-preview {
    border: 2px solid hsl(var(--border));
}

/* Progress pulse on training */
@keyframes progress-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(var(--primary-rgb), 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(var(--primary-rgb), 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(var(--primary-rgb), 0);
    }
}

.progress-active {
    animation: progress-pulse 2s infinite;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: hsl(var(--muted));
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: hsl(var(--muted-foreground));
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: hsl(var(--primary));
}

/* Custom slider styling */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    height: 8px;
    background: hsl(var(--muted));
    border-radius: 5px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: hsl(var(--primary));
    cursor: pointer;
    border-radius: 50%;
}

input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: hsl(var(--primary));
    cursor: pointer;
    border-radius: 50%;
    border: none;
}

input[type="range"]:hover::-webkit-slider-thumb {
    background: hsl(var(--primary-foreground));
}

input[type="range"]:hover::-moz-range-thumb {
    background: hsl(var(--primary-foreground));
}