/**
 * Stylesheet cho công cụ Máy quét tài liệu thông minh (Advanced Document Scanner)
 */

.hihi-scanner-container {
    --primary-indigo: #4f46e5;
    --primary-indigo-hover: #4338ca;
    --accent-emerald: #10b981;
    --accent-emerald-hover: #059669;
}

/* Custom scrollbars for pages list sidebar */
#pages-list::-webkit-scrollbar {
    width: 6px;
}
#pages-list::-webkit-scrollbar-track {
    background: transparent;
}
#pages-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}
#pages-list::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Drag Handles for manual corner cropping */
.crop-handle {
    position: absolute;
    width: 24px;
    height: 24px;
    background-color: rgba(239, 68, 68, 0.85); /* Red-500 */
    border: 2px solid #ffffff;
    border-radius: 50%;
    margin-left: -12px;
    margin-top: -12px;
    cursor: move;
    z-index: 100;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3), inset 0 0 4px rgba(255, 255, 255, 0.6);
    transition: transform 0.1s ease, background-color 0.2s ease;
    touch-action: none; /* Prevent scroll on mobile drag */
}

.crop-handle:hover, .crop-handle.dragging {
    background-color: #ef4444;
    transform: scale(1.2);
    box-shadow: 0 0 0 6px rgba(239, 68, 68, 0.3);
}

.crop-handle::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 6px;
    height: 6px;
    background-color: #ffffff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

/* Sidebar Page Thumbnail Cards */
.page-thumbnail-card {
    position: relative;
    border: 2px solid #f1f5f9;
    border-radius: 1rem;
    padding: 8px;
    background-color: #ffffff;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.page-thumbnail-card:hover {
    border-color: #cbd5e1;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.page-thumbnail-card.active {
    border-color: var(--primary-indigo);
    background-color: rgba(79, 70, 229, 0.02);
    box-shadow: 0 4px 16px rgba(79, 70, 229, 0.08);
}

.page-thumbnail-card.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 20%;
    bottom: 20%;
    width: 4px;
    background-color: var(--primary-indigo);
    border-radius: 0 4px 4px 0;
}

/* Thumbnail drag handle overlay indicator */
.page-badge-num {
    position: absolute;
    top: -6px;
    left: -6px;
    width: 20px;
    height: 20px;
    background-color: #334155;
    color: #ffffff;
    border-radius: 50%;
    font-size: 10px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Active filter selection */
.btn-filter-opt.active {
    background-color: var(--primary-indigo) !important;
    border-color: var(--primary-indigo) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
}

/* CSS animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.animate-fade-in {
    animation: fadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Image adjustments slider custom styles */
input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--primary-indigo);
    cursor: pointer;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
    transition: transform 0.15s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

/* Page action icon buttons */
.page-card-action {
    opacity: 0.7;
    transition: all 0.2s ease;
}

.page-card-action:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .hihi-scanner-container {
        padding: 1rem !important;
        border-radius: 1.5rem !important;
    }
}
