/* ==========================================================================
   Imgly Background Remover Module Styles v1.0.1 (PENTACROSS)
   ========================================================================== */

:root {
    --ixbr-bg-color: #1a1b1e;
    --ixbr-panel-bg: rgba(37, 38, 43, 0.7);
    --ixbr-border: rgba(255,255,255,0.08);
    --ixbr-text: #c1c2c5 !important;
    --ixbr-primary: #339af0;
    --ixbr-primary-hover: #228be6;
    --ixbr-success: #40c057;
    --ixbr-font: 'Inter', system-ui, -apple-system, sans-serif;
    --ixbr-radius: 12px;
}

.ixbr-wrapper * { color: inherit; box-sizing: border-box; }

.ixbr-wrapper {
    font-family: var(--ixbr-font);
    background-color: var(--ixbr-bg-color);
    color: #c1c2c5 !important;
    padding: 30px;
    border-radius: var(--ixbr-radius);
    max-width: 860px;
    margin: 0 auto;
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
    border: 1px solid var(--ixbr-border);
}

/* Header */
.ixbr-header { text-align: center; margin-bottom: 30px; }
.ixbr-icon-box {
    width: 60px; height: 60px;
    background: rgba(51, 154, 240, 0.1);
    border-radius: 16px;
    display: flex; justify-content: center; align-items: center;
    margin: 0 auto 15px;
    border: 1px solid rgba(51, 154, 240, 0.2);
}
.ixbr-title { font-size: 24px; font-weight: 700; margin: 0 0 10px; color: #ffffff !important; }
.ixbr-highlight { color: var(--ixbr-primary) !important; }
.ixbr-desc { color: #909296 !important; font-size: 14px; margin: 0; }

/* Glass panel */
.ixbr-view-state {
    background: var(--ixbr-panel-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--ixbr-border);
    border-radius: var(--ixbr-radius);
    padding: 40px;
    text-align: center;
    transition: all 0.3s ease;
}

/* Upload View */
.ixbr-drop-area {
    border: 2px dashed rgba(255,255,255,0.15);
    border-radius: var(--ixbr-radius);
    padding: 50px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}
.ixbr-drop-area:hover, .ixbr-drop-area.dragover {
    border-color: var(--ixbr-primary);
    background: rgba(51, 154, 240, 0.05);
}
.ixbr-upload-icon { margin-bottom: 15px; }
.ixbr-drop-area h3 { margin: 0 0 10px; color: #ffffff !important; font-size: 18px; }
.ixbr-drop-area p { color: #909296 !important; font-size: 14px; margin: 0; }

/* Buttons */
.ixbr-btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 12px 24px; border-radius: 8px;
    font-weight: 600; font-size: 14px;
    cursor: pointer; border: none;
    transition: all 0.2s ease;
    font-family: inherit;
    color: #fff !important;
}
.ixbr-btn-primary { background: var(--ixbr-primary); box-shadow: 0 4px 15px rgba(51,154,240,0.4); }
.ixbr-btn-primary:hover { background: var(--ixbr-primary-hover); transform: translateY(-2px); }
.ixbr-btn-secondary { background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2); }
.ixbr-btn-secondary:hover { background: rgba(255,255,255,0.2); }
.ixbr-btn-success { background: var(--ixbr-success); box-shadow: 0 4px 15px rgba(64,192,87,0.3); }
.ixbr-btn-success:hover { background: #37b24d; transform: translateY(-2px); }

/* Processing View */
.ixbr-spin-icon { animation: ixbr-spin 1.5s linear infinite; margin-bottom: 20px; }
@keyframes ixbr-spin { 100% { transform: rotate(360deg); } }
.ixbr-status-title { color: #fff !important; font-size: 18px; margin-bottom: 25px; }
.ixbr-progress-container { max-width: 400px; margin: 0 auto; }
.ixbr-progress-bar-bg {
    width: 100%; height: 8px;
    background: rgba(255,255,255,0.1);
    border-radius: 4px; overflow: hidden; margin-bottom: 10px;
}
.ixbr-progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--ixbr-primary), #74c0fc);
    width: 0%; transition: width 0.2s ease-out;
}
.ixbr-progress-subtext { font-size: 13px; color: #909296 !important; }

/* Result View */
#ixbr-result-view { padding: 20px; }

/* ── Before / After Compare ───────────────────────────────── */
.ixbr-compare-wrap {
    position: relative;
    width: 100%;
    height: 400px;
    border-radius: var(--ixbr-radius);
    overflow: hidden;
    border: 1px solid var(--ixbr-border);
    margin-bottom: 20px;
    cursor: col-resize;
    user-select: none;
    -webkit-user-select: none;
    background-color: #2c2e33;
    background-image:
        linear-gradient(45deg, #373a40 25%, transparent 25%, transparent 75%, #373a40 75%, #373a40),
        linear-gradient(45deg, #373a40 25%, transparent 25%, transparent 75%, #373a40 75%, #373a40);
    background-size: 20px 20px;
    background-position: 0 0, 10px 10px;
}

/* Canvases stacked on top of each other */
.ixbr-canvas {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.ixbr-canvas-original {
    /* clips from the left, revealing original image */
    clip-path: polygon(0 0, 50% 0, 50% 100%, 0 100%);
    z-index: 2;
    /* original has opaque background for clear comparison */
}
.ixbr-canvas-result {
    z-index: 1;
}

/* slider divider line + handle */
.ixbr-compare-handle {
    position: absolute;
    top: 0; bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    pointer-events: none;
    display: flex; flex-direction: column; align-items: center;
    transition: left 0s;
}
.ixbr-handle-line {
    width: 2px;
    height: 100%;
    background: rgba(255,255,255,0.8);
    box-shadow: 0 0 8px rgba(0,0,0,0.5);
}
.ixbr-handle-btn {
    position: absolute;
    top: 50%; transform: translateY(-50%);
    width: 40px; height: 40px;
    border-radius: 50%;
    background: var(--ixbr-primary);
    display: flex; align-items: center; justify-content: center;
    gap: 0;
    box-shadow: 0 2px 12px rgba(0,0,0,0.5);
    border: 2px solid rgba(255,255,255,0.3);
}


/* Before / After labels */
.ixbr-label {
    position: absolute; top: 12px;
    font-size: 11px; font-weight: 700;
    color: #fff !important;
    background: rgba(0,0,0,0.45);
    padding: 3px 10px;
    border-radius: 4px;
    letter-spacing: 1px;
    pointer-events: none;
    z-index: 15;
}
.ixbr-label-before { left: 12px; }
.ixbr-label-after  { right: 12px; }

/* ── Threshold / Edge Panel ──────────────────────────────── */
.ixbr-threshold-panel {
    background: rgba(37, 38, 43, 0.8);
    border: 1px solid var(--ixbr-border);
    border-radius: 10px;
    padding: 18px 22px;
    margin-bottom: 20px;
    text-align: left;
}
.ixbr-threshold-header {
    display: flex; align-items: center; gap: 8px;
    margin-bottom: 12px;
}
.ixbr-threshold-icon { display: flex; }
.ixbr-threshold-title { font-weight: 600; font-size: 14px; color: #fff !important; flex: 1; }
.ixbr-threshold-val {
    font-size: 13px; font-weight: 700;
    color: var(--ixbr-primary) !important;
    background: rgba(51,154,240,0.12);
    padding: 2px 10px; border-radius: 20px;
    min-width: 40px; text-align: center;
}
.ixbr-threshold-track { margin-bottom: 6px; }
.ixbr-threshold-range {
    -webkit-appearance: none; appearance: none;
    width: 100%; height: 6px;
    border-radius: 3px;
    background: linear-gradient(to right, var(--ixbr-primary) 0%, var(--ixbr-primary) 50.2%, rgba(255,255,255,0.1) 50.2%, rgba(255,255,255,0.1) 100%);
    outline: none; cursor: pointer;
}
.ixbr-threshold-range::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none;
    width: 18px; height: 18px;
    border-radius: 50%;
    background: var(--ixbr-primary);
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
    cursor: pointer;
}
.ixbr-threshold-range::-moz-range-thumb {
    width: 18px; height: 18px;
    border-radius: 50%;
    background: var(--ixbr-primary);
    border: 2px solid #fff;
    cursor: pointer;
}
.ixbr-threshold-labels {
    display: flex; justify-content: space-between;
    font-size: 11px; color: #5c5f66 !important;
    margin-top: 5px;
}
.ixbr-threshold-hint {
    font-size: 12px; color: #5c5f66 !important;
    margin: 0; line-height: 1.5;
}

/* Action Row */
.ixbr-action-row {
    display: flex; justify-content: center; gap: 15px; flex-wrap: wrap;
}
@media (max-width: 600px) {
    .ixbr-action-row { flex-direction: column; }
    .ixbr-btn { width: 100%; justify-content: center; }
    .ixbr-compare-wrap { height: 260px; }
}
