/* Draggable Image Compare Plugin Styles */

.dic-container {
    position: relative;
    display: inline-block;
    max-width: 100%;
    margin: 20px 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    background: #f8f9fa;
}

.dic-image-wrapper {
    position: relative;
    display: block;
    width: 100%;
    height: auto;
    overflow: hidden;
}

.dic-before-image,
.dic-after-image {
    display: block;
    width: 100%;
    height: auto;
    max-width: 100%;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.dic-after-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 100%;
    overflow: hidden;
    transition: none;
}

.dic-horizontal .dic-after-overlay {
    width: 50%;
    height: 100%;
}

.dic-vertical .dic-after-overlay {
    width: 100%;
    height: 50%;
}

.dic-divider {
    position: absolute;
    background: #ffffff;
    cursor: grab;
    z-index: 10;
    transition: none;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.dic-divider:active {
    cursor: grabbing;
}

.dic-horizontal .dic-divider {
    top: 0;
    left: 50%;
    width: 4px;
    height: 100%;
    transform: translateX(-50%);
    cursor: ew-resize;
}

.dic-vertical .dic-divider {
    left: 0;
    top: 50%;
    width: 100%;
    height: 4px;
    transform: translateY(-50%);
    cursor: ns-resize;
}

.dic-handle {
    position: absolute;
    background: #ffffff;
    border: 2px solid #e0e0e0;
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dic-horizontal .dic-handle {
    width: 40px;
    height: 40px;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.dic-vertical .dic-handle {
    width: 40px;
    height: 40px;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.dic-handle:hover {
    background: #f0f0f0;
    border-color: #999;
    transform: translate(-50%, -50%) scale(1.1);
}

.dic-handle-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
}

.dic-arrow {
    width: 0;
    height: 0;
    display: inline-block;
}

.dic-horizontal .dic-arrow-left {
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-right: 8px solid #666;
}

.dic-horizontal .dic-arrow-right {
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-left: 8px solid #666;
}

.dic-vertical .dic-arrow-left {
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 8px solid #666;
}

.dic-vertical .dic-arrow-right {
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 8px solid #666;
}

.dic-labels {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

.dic-label {
    position: absolute;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.dic-container:hover .dic-label {
    opacity: 1;
}

.dic-label-before {
    top: 20px;
    left: 20px;
}

.dic-label-after {
    top: 20px;
    right: 20px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .dic-container {
        margin: 15px 0;
    }
    
    .dic-handle {
        width: 35px !important;
        height: 35px !important;
    }
    
    .dic-label {
        font-size: 12px;
        padding: 6px 8px;
    }
    
    .dic-label-before,
    .dic-label-after {
        top: 10px;
    }
    
    .dic-label-before {
        left: 10px;
    }
    
    .dic-label-after {
        right: 10px;
    }
}

@media (max-width: 480px) {
    .dic-container {
        margin: 10px 0;
    }
    
    .dic-handle {
        width: 30px !important;
        height: 30px !important;
    }
    
    .dic-arrow-left,
    .dic-arrow-right {
        border-width: 4px !important;
    }
    
    .dic-horizontal .dic-arrow-left {
        border-right-width: 6px !important;
    }
    
    .dic-horizontal .dic-arrow-right {
        border-left-width: 6px !important;
    }
    
    .dic-vertical .dic-arrow-left {
        border-bottom-width: 6px !important;
    }
    
    .dic-vertical .dic-arrow-right {
        border-top-width: 6px !important;
    }
}

/* Loading State */
.dic-container.loading {
    opacity: 0.7;
    pointer-events: none;
}

.dic-container.loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #333;
    border-radius: 50%;
    animation: dic-spin 1s linear infinite;
    z-index: 20;
}

@keyframes dic-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error State */
.dic-error {
    background: #ffebee;
    color: #c62828;
    padding: 15px;
    border-radius: 4px;
    border: 1px solid #ffcdd2;
    margin: 10px 0;
}

/* Accessibility */
.dic-container:focus-within .dic-divider,
.dic-divider:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .dic-handle {
        border-color: #000;
        background: #fff;
    }
    
    .dic-divider {
        background: #000;
    }
    
    .dic-arrow-left,
    .dic-arrow-right {
        border-color: #000 !important;
    }
}