/* Custom Range Slider */
.batch-slider {
    height: 8px;
    background: repeating-linear-gradient(
        45deg,
        #e9ecef,
        #e9ecef 5px,
        #d3d6d9 5px,
        #d3d6d9 10px
    );
    border-radius: 4px;
    outline: none;
    -webkit-appearance: none;
}

.batch-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: #052c65;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.batch-slider::-webkit-slider-thumb:hover {
    background: #041f4a;
    transform: scale(1.1);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
}

.batch-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #052c65;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.batch-slider::-moz-range-thumb:hover {
    background: #041f4a;
    transform: scale(1.1);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
}

.batch-slider::-webkit-slider-runnable-track {
    height: 8px;
    background: linear-gradient(to right,
        #052c65 0%,
        #052c65 var(--value, 0%),
        transparent var(--value, 0%)),
        repeating-linear-gradient(
            45deg,
            #e9ecef,
            #e9ecef 5px,
            #d3d6d9 5px,
            #d3d6d9 10px
        );
    border-radius: 4px;
}

.batch-slider::-moz-range-track {
    height: 8px;
    background: repeating-linear-gradient(
        45deg,
        #e9ecef,
        #e9ecef 5px,
        #d3d6d9 5px,
        #d3d6d9 10px
    );
    border-radius: 4px;
}

.batch-slider::-moz-range-progress {
    height: 8px;
    background: #052c65;
    border-radius: 4px;
}

/* Dark mode slider */
[data-bs-theme="dark"] .batch-slider {
    background: #343a40;
}

[data-bs-theme="dark"] .batch-slider::-webkit-slider-thumb {
    background: #6ea8fe;
}

[data-bs-theme="dark"] .batch-slider::-webkit-slider-thumb:hover {
    background: #9ec5fe;
}

[data-bs-theme="dark"] .batch-slider::-moz-range-thumb {
    background: #6ea8fe;
}

[data-bs-theme="dark"] .batch-slider::-moz-range-thumb:hover {
    background: #9ec5fe;
}

[data-bs-theme="dark"] .batch-slider::-webkit-slider-runnable-track {
    background: linear-gradient(to right, #6ea8fe 0%, #6ea8fe var(--value, 0%), #343a40 var(--value, 0%), #343a40 100%);
}

[data-bs-theme="dark"] .batch-slider::-moz-range-track {
    background: #343a40;
}

[data-bs-theme="dark"] .batch-slider::-moz-range-progress {
    background: #6ea8fe;
}

/* Switch Toggle Cursor */
.form-check.form-switch .form-check-input {
    cursor: pointer;
}

/* Drag & Drop Zone */
.drag-drop-zone.dragover {
    border-color: var(--bs-primary);
    background-color: rgba(5, 44, 101, 0.05);
}

[data-bs-theme="dark"] .drag-drop-zone.dragover {
    background-color: rgba(99, 153, 255, 0.1);
}

/* Image Grid */
.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
}

.image-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 6px;
    overflow: hidden;
    background: var(--bs-tertiary-bg);
    border: 1px solid var(--bs-border-color);
}

.image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-item .remove-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.image-item:hover .remove-btn {
    opacity: 1;
}

.image-item .remove-btn img {
    width: 10px;
    height: 10px;
    filter: brightness(0) invert(1);
}

.image-item .image-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 4px 6px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    color: white;
}

.image-item .image-name {
    font-size: 10px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.image-item .image-size {
    font-size: 9px;
    opacity: 0.8;
}

/* Watermark Preview */
.watermark-thumb {
    max-width: 100%;
    max-height: 60px;
    border-radius: 4px;
    border: 1px solid var(--bs-border-color);
    display: block;
    margin: 0 auto;
}

/* Result Grid */
.result-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: var(--bs-tertiary-bg);
    border-radius: 6px;
    border: 1px solid var(--bs-border-color);
}

.result-item .result-thumb {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.result-info {
    flex: 1;
    min-width: 0;
}

.result-name {
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.result-meta {
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.result-meta .badge {
    font-size: 10px;
    font-weight: 500;
    padding: 2px 6px;
}

.result-dims {
    font-size: 11px;
}

.result-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.result-actions .btn {
    padding: 4px 8px;
}

/* Compare Modal */
.compare-container {
    position: relative;
    width: 100%;
    height: 500px;
    overflow: hidden;
    background: var(--bs-dark);
    -webkit-user-select: none;
    user-select: none;
}

.compare-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.compare-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.compare-before {
    z-index: 2;
    clip-path: inset(0 50% 0 0);
}

.compare-after {
    z-index: 1;
}

.compare-label {
    position: absolute;
    bottom: 16px;
    padding: 4px 12px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 12px;
    font-weight: 500;
    border-radius: 4px;
    text-transform: uppercase;
}

.compare-before .compare-label {
    left: 16px;
}

.compare-after .compare-label {
    right: 16px;
}

.compare-slider {
    position: absolute;
    top: 0;
    left: 50%;
    width: 4px;
    height: 100%;
    background: white;
    z-index: 10;
    cursor: ew-resize;
    transform: translateX(-50%);
}

.compare-handle {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 36px;
    height: 36px;
    background: white;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.compare-handle::before,
.compare-handle::after {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border-style: solid;
}

.compare-handle::before {
    left: 7px;
    border-width: 5px 7px 5px 0;
    border-color: transparent #333 transparent transparent;
}

.compare-handle::after {
    right: 7px;
    border-width: 5px 0 5px 7px;
    border-color: transparent transparent transparent #333;
}

.compare-stats {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Responsive */
@media (max-width: 768px) {
    .compare-container {
        height: 350px;
    }

    .image-grid {
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
        gap: 6px;
    }
}

@media (max-width: 576px) {
    .compare-container {
        height: 280px;
    }

    .compare-handle {
        width: 30px;
        height: 30px;
    }

    .result-item {
        flex-wrap: wrap;
    }

    .result-actions {
        width: 100%;
        justify-content: flex-end;
        margin-top: 8px;
    }
}
