/* Upload Area */
.wm-upload-container {
    max-width: 700px;
    margin: 0 auto;
}

.wm-upload-area {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 300px;
    padding: 60px 24px;
    border: 2px dashed rgba(var(--primary-rgb, 99, 102, 241), 0.3);
    border-radius: var(--radius, 12px);
    background: var(--bg-card);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.wm-upload-area::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius, 12px);
    background: linear-gradient(135deg, rgba(var(--primary-rgb, 99, 102, 241), 0.08) 0%, rgba(var(--primary-rgb, 99, 102, 241), 0.03) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.wm-upload-area:hover,
.wm-upload-area.dragover {
    border-color: var(--primary, #6366f1);
    background: var(--bg-card-hover, rgba(255, 255, 255, 0.07));
    box-shadow: 0 0 40px rgba(var(--primary-rgb, 99, 102, 241), 0.15);
    transform: translateY(-2px);
}

.wm-upload-area:hover::before,
.wm-upload-area.dragover::before {
    opacity: 1;
}

.wm-upload-icon {
    position: relative;
    z-index: 1;
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(var(--primary-rgb, 99, 102, 241), 0.12) 0%, rgba(var(--primary-rgb, 99, 102, 241), 0.06) 100%);
    border: 1px solid rgba(var(--primary-rgb, 99, 102, 241), 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.wm-upload-area:hover .wm-upload-icon {
    transform: scale(1.1);
    box-shadow: 0 0 30px rgba(var(--primary-rgb, 99, 102, 241), 0.2);
}

.wm-upload-icon svg {
    width: 28px;
    height: 28px;
    color: var(--primary, #6366f1);
}

.wm-upload-text {
    position: relative;
    z-index: 1;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main, #f0f0f5);
    margin-bottom: 6px;
}

.wm-upload-hint {
    position: relative;
    z-index: 1;
    font-size: 13px;
    color: var(--text-muted, #6b7280);
}

.wm-file-input {
    display: none;
}



/* Preview Container */
.wm-preview-container {
    margin-top: 32px;
    animation: wmFadeInUp 0.5s ease-out both;
}

.wm-preview-layout {
    display: flex;
    gap: 24px;
}

.wm-preview-main {
    flex: 1;
    min-width: 0;
}

.wm-preview-sidebar {
    width: 280px;
    flex-shrink: 0;
}

/* Preview Cards */
.wm-card {
    background: var(--bg-card);
    border: 1px solid var(--border, rgba(255, 255, 255, 0.1));
    border-radius: var(--radius, 12px);
    overflow: hidden;
    margin-bottom: 20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.wm-card:hover {
    border-color: rgba(var(--primary-rgb, 99, 102, 241), 0.3);
}

.wm-card.wm-result {
    border-color: rgba(52, 211, 153, 0.2);
}

.wm-card.wm-result:hover {
    border-color: rgba(52, 211, 153, 0.4);
}

.wm-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border, rgba(255, 255, 255, 0.1));
    background: rgba(255, 255, 255, 0.02);
}

.wm-card-header h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 0;
}

.wm-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.wm-dot-original {
    background: #f87171;
    box-shadow: 0 0 8px rgba(248, 113, 113, 0.4);
}

.wm-dot-processed {
    background: #34d399;
    box-shadow: 0 0 8px rgba(52, 211, 153, 0.4);
}

.wm-info-text {
    font-size: 12px;
    color: var(--text-muted, #6b7280);
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
}

.wm-canvas-area {
    position: relative;
    height: 400px;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-image:
        linear-gradient(45deg, rgba(255, 255, 255, 0.02) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(255, 255, 255, 0.02) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, rgba(255, 255, 255, 0.02) 75%),
        linear-gradient(-45deg, transparent 75%, rgba(255, 255, 255, 0.02) 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

.wm-canvas-area img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    cursor: zoom-in;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.wm-canvas-area img:hover {
    transform: scale(1.02);
}

/* Sidebar Panel */
.wm-panel {
    background: var(--bg-card);
    border: 1px solid var(--border, rgba(255, 255, 255, 0.1));
    border-radius: var(--radius, 12px);
    padding: 24px;
    position: sticky;
    top: 88px;
}

.wm-panel h4 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 20px;
}

.wm-panel-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Buttons */
.wm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius, 12px);
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    border: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
}

.wm-btn svg {
    width: 18px;
    height: 18px;
}

.wm-btn-primary {
    background: var(--primary, #6366f1);
    color: white;
    box-shadow: 0 4px 20px rgba(var(--primary-rgb, 99, 102, 241), 0.3);
}

.wm-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(var(--primary-rgb, 99, 102, 241), 0.4);
    background: var(--primary-hover, #4f46e5);
}

.wm-btn-secondary {
    background: var(--bg-card);
    color: var(--text-muted, #94a3b8);
    border: 1px solid var(--border, rgba(255, 255, 255, 0.1));
}

.wm-btn-secondary:hover {
    background: var(--bg-card-hover, rgba(255, 255, 255, 0.07));
    border-color: rgba(var(--primary-rgb, 99, 102, 241), 0.3);
    color: var(--text-main, #f0f0f5);
}

.wm-btn-small {
    padding: 8px 16px;
    font-size: 13px;
}

/* Format Select */
.wm-format-select {
    margin-bottom: 20px;
}

.wm-format-select label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted, #94a3b8);
    margin-bottom: 8px;
}

.wm-select {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-card);
    border: 1px solid var(--primary, #6366f1);
    border-radius: var(--radius, 8px);
    color: var(--text-main, #f1f5f9);
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
}

.wm-select:hover, .wm-select:focus {
    border-color: rgba(var(--primary-rgb, 99, 102, 241), 0.4);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb, 99, 102, 241), 0.1);
}

.wm-select option {
    background: #1a1a1a;
    color: #fff;
}

/* Status Message */
.wm-status-msg {
    margin-top: 16px;
    font-size: 13px;
    min-height: 20px;
}

.wm-status-warn {
    color: #fbbf24;
}

.wm-status-success {
    color: #34d399;
}

/* Batch Mode */
.wm-batch-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.wm-batch-header h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 0;
}

.wm-image-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 18px;
    background: var(--bg-card);
    border: 1px solid var(--border, rgba(255, 255, 255, 0.1));
    border-radius: var(--radius, 12px);
    margin-bottom: 10px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: wmSlideIn 0.3s ease-out both;
}

.wm-image-card:hover {
    background: var(--bg-card-hover, rgba(255, 255, 255, 0.07));
    border-color: rgba(var(--primary-rgb, 99, 102, 241), 0.3);
}

.wm-image-card-thumb {
    width: 64px;
    height: 64px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.03);
    display: flex;
    align-items: center;
    justify-content: center;
}

.wm-image-card-thumb img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 8px;
}

.wm-image-card-info {
    flex: 1;
    min-width: 0;
}

.wm-image-card-name {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.wm-image-card-status {
    font-size: 12px;
    color: var(--text-muted, #6b7280);
}

/* Loading Overlay */
.wm-loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 15, 15, 0.85);
    backdrop-filter: blur(12px);
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 16px;
}

.wm-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(var(--primary-rgb, 99, 102, 241), 0.2);
    border-top-color: var(--primary, #6366f1);
    border-radius: 50%;
    animation: wmSpin 0.8s linear infinite;
}

.wm-loading-text {
    font-size: 14px;
    color: var(--text-muted, #94a3b8);
}

/* Lightbox */
.wm-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(20px);
    z-index: 300;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
    padding: 40px;
}

.wm-lightbox img {
    max-width: 95%;
    max-height: 95%;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

/* Animations */
@keyframes wmFadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes wmSpin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes wmSlideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Hidden utility */
.wm-hidden {
    display: none !important;
}

/* Responsive */
@media (max-width: 1024px) {
    .wm-preview-layout {
        flex-direction: column;
    }
    .wm-preview-sidebar {
        width: 100%;
    }
    .wm-panel {
        position: static;
    }
}

@media (max-width: 768px) {

    .wm-canvas-area {
        height: 250px;
    }
    .wm-batch-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
}

/* Before/After Slider */
.wm-comparison-container {
    position: relative;
    width: 100%;
    margin: 4rem auto;
    max-width: 900px;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius, 16px);
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
    border: 1px solid var(--border, rgba(255,255,255,0.1));
    background: var(--bg-card);
}

.wm-comparison-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
}

.wm-comparison-before {
    z-index: 10;
    clip-path: inset(0 50% 0 0);
}

.wm-comparison-after {
    z-index: 5;
}

.wm-range-slider {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: col-resize;
    z-index: 30;
    margin: 0;
}

.wm-comparison-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 2px;
    background: rgba(255,255,255,0.8);
    transform: translateX(-50%);
    pointer-events: none;
    box-shadow: 0 0 15px rgba(var(--primary-rgb, 99, 102, 241), 0.5);
    z-index: 25;
}

.wm-comparison-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--primary, #6366f1);
    border: 3px solid white;
    box-shadow: 0 0 20px rgba(0,0,0,0.3), 0 0 10px rgba(var(--primary-rgb), 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    cursor: col-resize;
    z-index: 26;
    pointer-events: none;
}

.wm-comparison-circle svg {
    width: 20px;
    height: 20px;
}

.wm-comparison-label {
    position: absolute;
    top: 20px;
    padding: 6px 14px;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(8px);
    border-radius: 6px;
    color: white;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    z-index: 15;
    pointer-events: none;
}

.wm-comparison-label-before { left: 20px; }
.wm-comparison-label-after { right: 20px; }

@media (max-width: 768px) {
    .wm-comparison-circle {
        width: 36px;
        height: 36px;
    }
}
