/**
 * RemoveBG AI - Frontend Tool v2 CSS
 * Clean, minimal, mobile-first design
 */

/* ===== VARIABLES ===== */
:root {
    --primary: #1a1a1a;
    --primary-dark: #000000;
    --success: #10b981;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --border: #e2e8f0;
    --bg-light: #f8fafc;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== RESET ===== */
.removebg-tool-v2 * {
    box-sizing: border-box;
}

.removebg-tool-v2 {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* ===== HERO ===== */
.removebg-hero {
    display: flex;
    align-items: center;
    gap: 30px;
    margin-bottom: 40px;
    padding: 30px;
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.removebg-hero-logo {
    flex-shrink: 0;
    animation: fadeInScale 0.8s ease-out;
}

.removebg-hero-logo img {
    width: 200px;
    height: 200px;
    filter: drop-shadow(0 4px 12px rgba(59, 130, 246, 0.15));
    transition: transform 0.3s ease;
}

.removebg-hero-logo img:hover {
    transform: scale(1.05);
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.removebg-hero-content {
    flex: 1;
    min-width: 0;
}

.removebg-hero-title {
    font-size: clamp(28px, 5vw, 42px);
    font-weight: 900;
    background: linear-gradient(135deg, #1a1a1a 0%, #000000 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0 0 16px 0;
    line-height: 1.1;
}

.removebg-hero-description {
    font-size: clamp(14px, 2vw, 16px);
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.6;
}

.removebg-hero-intro {
    font-size: clamp(15px, 2vw, 18px);
    color: var(--text-primary);
    margin: 0 0 14px 0;
    line-height: 1.6;
}

.removebg-hero-intro strong {
    color: var(--primary);
    font-weight: 700;
}

.removebg-hero-free {
    font-size: clamp(14px, 1.9vw, 16px);
    color: #059669;
    margin: 0 0 6px 0;
    padding: 10px 14px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), rgba(5, 150, 105, 0.08));
    border-radius: 8px;
    border-left: 3px solid #10b981;
    line-height: 1.5;
}

.removebg-hero-free strong {
    color: #059669;
    font-weight: 700;
}

.removebg-hero-features {
    font-size: clamp(13px, 1.7vw, 14px);
    color: var(--text-secondary);
    margin: 0 0 8px 0;
    line-height: 1.5;
}

.removebg-hero-formats {
    font-size: clamp(12px, 1.5vw, 13px);
    color: var(--text-secondary);
    margin: 0 0 12px 0;
    line-height: 1.4;
    opacity: 0.8;
}

.removebg-hero-bonus {
    font-size: clamp(14px, 1.9vw, 16px);
    color: #1a1a1a;
    margin: 0 0 12px 0;
    padding: 10px 14px;
    background: linear-gradient(135deg, rgba(26, 26, 26, 0.08), rgba(0, 0, 0, 0.08));
    border-radius: 8px;
    border-left: 3px solid #1a1a1a;
    line-height: 1.5;
}

.removebg-hero-bonus strong {
    color: #000000;
    font-weight: 700;
}

.removebg-hero-features strong,
.removebg-hero-formats strong {
    color: var(--text-primary);
    font-weight: 700;
}

.removebg-hero-intro strong {
    color: var(--color-primary);
    font-weight: 700;
}

/* ===== MAIN TOOL ===== */
.removebg-main {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: clamp(20px, 4vw, 40px);
    margin-bottom: 60px;
    position: relative;
}

/* ===== VIEWER (Canvas) ===== */
.removebg-viewer {
    margin-bottom: 32px;
    display: flex;
    justify-content: center; /* Center the canvas */
}

.removebg-canvas {
    position: relative;
    /* Width removed - controlled by .removebg-canvas-container */
    max-width: 100%;
    margin: 0 auto;
    border-radius: var(--radius);
    overflow: hidden;
    background:
        linear-gradient(45deg, #f0f0f1 25%, transparent 25%),
        linear-gradient(-45deg, #f0f0f1 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #f0f0f1 75%),
        linear-gradient(-45deg, transparent 75%, #f0f0f1 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

.removebg-canvas-container {
    position: relative;
    width: 100%; /* Will be overridden by JS to match image aspect ratio */
    height: 450px;
    max-height: 70vh;
    max-width: 100%;
    margin: 0 auto; /* Center the canvas */
    overflow: hidden;
}

/* ===== SIDES ===== */
.removebg-side {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.removebg-side img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.removebg-side img[src=""],
.removebg-side img:not([src]) {
    display: none;
}

.removebg-side img[src=""] + *,
.removebg-side img:not([src]) + * {
    display: none;
}

/* Empty state placeholder */
.removebg-canvas-container:not(.has-image)::before {
    content: 'Click "Upload Your Image" to get started';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 18px;
    font-weight: 600;
    color: var(--text-secondary);
    text-align: center;
    z-index: 1;
    pointer-events: none;
}

.removebg-canvas-container:not(.has-image)::after {
    content: '↑';
    position: absolute;
    top: 60%;
    left: 50%;
    transform: translate(-50%, 0);
    font-size: 48px;
    color: var(--primary);
    opacity: 0.3;
    animation: bounceUpload 2s ease-in-out infinite;
    z-index: 1;
    pointer-events: none;
}

@keyframes bounceUpload {
    0%, 100% {
        transform: translate(-50%, 0);
    }
    50% {
        transform: translate(-50%, -10px);
    }
}

.removebg-side-original {
    z-index: 2;
    background: #ffffff;
    clip-path: inset(0 50% 0 0);
    transition: clip-path 0.05s ease-out;
}

.removebg-side-result {
    z-index: 1;
}

.removebg-side-result.processing {
    position: relative;
}

.removebg-side-result.processing img {
    filter: blur(8px) brightness(0.8) saturate(0.8);
}

.removebg-side-result.processing::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 5;
}

.removebg-side-result.processing::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(26, 26, 26, 0.2) 50%,
        transparent 100%
    );
    transform: translateX(-100%);
    animation: scanEffect 2s ease-in-out infinite;
    z-index: 6;
}

@keyframes scanEffect {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ===== LABELS ===== */
.removebg-label {
    position: absolute;
    bottom: 16px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

.removebg-side-original .removebg-label {
    left: 16px;
}

.removebg-side-result .removebg-label {
    right: 16px;
}

/* ===== SLIDER ===== */
.removebg-slider {
    position: absolute;
    top: 0;
    left: 50%;
    width: 4px;
    height: 100%;
    background: white;
    transform: translateX(-50%);
    cursor: ew-resize;
    z-index: 10;
    transition: left 0.05s ease-out;
}

.removebg-slider-handle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
}

.removebg-slider-handle svg {
    width: 16px;
    height: 16px;
    color: var(--primary);
}

.removebg-slider:hover .removebg-slider-handle,
.removebg-slider:active .removebg-slider-handle {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
    transform: translate(-50%, -50%) scale(1.1);
}

/* ===== PROCESSING OVERLAY ===== */
.removebg-processing {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 1000;
    animation: fadeInScale 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.removebg-processing-card {
    background: linear-gradient(135deg, #1a1a1a 0%, #000000 100%);
    border-radius: 50px;
    padding: 12px 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 180px;
    animation: gentleBounce 2s ease-in-out infinite;
    position: relative;
    overflow: visible;
}

@keyframes gentleBounce {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-5px); }
}

.removebg-processing-text {
    font-size: 13px;
    font-weight: 600;
    color: white;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.removebg-processing-text::before {
    content: '✨';
    font-size: 18px;
    animation: rotate 2s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.removebg-processing-percent {
    font-size: 16px;
    font-weight: 700;
    color: white;
    font-variant-numeric: tabular-nums;
    min-width: 40px;
    text-align: right;
    margin: 0;
}

.removebg-processing-bar {
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    overflow: hidden;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
}

.removebg-processing-fill {
    height: 100%;
    background: linear-gradient(90deg, #fbbf24 0%, #f59e0b 50%, #fbbf24 100%);
    background-size: 200% 100%;
    border-radius: 10px;
    width: 0;
    transition: width 0.3s ease;
    position: relative;
    animation: shimmer 1.5s ease-in-out infinite;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.removebg-processing-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.6) 50%,
        transparent 100%
    );
    animation: progressShine 1s ease-in-out infinite;
}

@keyframes progressShine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ===== MAIN WRAPPER ===== */
.removebg-main-wrapper {
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: relative;
}

/* ===== CONTROLS ===== */
.removebg-controls {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.removebg-buttons-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
}

/* ===== BUTTONS ===== */
.removebg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 32px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
}

.removebg-btn svg {
    flex-shrink: 0;
}

.removebg-btn-upload {
    background: var(--primary);
    color: white;
    box-shadow: var(--shadow-md);
}

.removebg-btn-upload:hover {
    background: var(--primary-dark);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.removebg-btn-download {
    background: var(--success);
    color: white;
    box-shadow: var(--shadow-md);
}

.removebg-btn-download:hover {
    background: #059669;
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

/* ===== CREDITS INFO BOX ===== */
.removebg-credits-info-box {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
}

.removebg-info-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--text-secondary);
}

.removebg-info-item svg {
    flex-shrink: 0;
    color: var(--primary);
}

.removebg-info-item strong {
    color: var(--text-primary);
}

.removebg-buy-credits-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--primary);
    color: white;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: var(--transition);
    margin-top: 4px;
}

.removebg-buy-credits-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    color: white;
    text-decoration: none;
}

.removebg-buy-credits-btn svg {
    flex-shrink: 0;
}

/* ===== BACKGROUND SELECTOR ===== */
.removebg-bg-selector {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.removebg-bg-selector label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.removebg-bg-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(48px, 1fr));
    gap: 8px;
}

.removebg-bg-btn {
    width: 100%;
    aspect-ratio: 1;
    border: 2px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    padding: 0;
    position: relative;
    overflow: hidden;
}

.removebg-bg-btn:hover {
    border-color: var(--primary);
    transform: scale(1.05);
}

.removebg-bg-btn.active {
    border-color: var(--primary);
    border-width: 3px;
    box-shadow: 0 0 0 4px rgba(26, 26, 26, 0.1);
}

/* Background colors */
.removebg-bg-transparent {
    background:
        linear-gradient(45deg, #ccc 25%, transparent 25%),
        linear-gradient(-45deg, #ccc 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #ccc 75%),
        linear-gradient(-45deg, transparent 75%, #ccc 75%);
    background-size: 10px 10px;
    background-position: 0 0, 0 5px, 5px -5px, -5px 0px;
}

.removebg-bg-white { background: #ffffff; }
.removebg-bg-black { background: #000000; }
.removebg-bg-blue { background: #3b82f6; }
.removebg-bg-green { background: #10b981; }
.removebg-bg-purple { background: #8b5cf6; }
.removebg-bg-red { background: #ef4444; }

.removebg-bg-custom {
    background: linear-gradient(135deg, #1a1a1a 0%, #000000 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.removebg-bg-custom.has-image {
    background-size: cover;
    background-position: center;
}

.removebg-bg-custom.has-image svg {
    display: none;
}

/* ===== FEATURES ===== */
.removebg-features {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
    margin-bottom: 40px;
}

@media (min-width: 768px) {
    .removebg-features {
        grid-template-columns: repeat(2, 1fr);
    }
}

.removebg-feature {
    text-align: center;
    padding: 24px;
}

.removebg-feature svg {
    color: var(--primary);
    margin-bottom: 16px;
}

.removebg-feature h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 8px 0;
}

.removebg-feature p {
    font-size: 16px;
    color: var(--text-secondary);
    margin: 0;
}

/* ===== FOOTER ===== */
.removebg-footer {
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 40px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 767px) {
    .removebg-hero {
        flex-direction: column;
        text-align: center;
        padding: 20px;
        gap: 20px;
    }

    .removebg-hero-logo img {
        width: 150px;
        height: 150px;
    }
}

@media (min-width: 768px) {
    .removebg-tool-v2 {
        padding: 40px 20px;
    }

    .removebg-main-wrapper {
        flex-direction: row;
        align-items: flex-start;
        gap: 30px;
    }

    .removebg-main {
        flex: 1;
        min-width: 0;
    }

    .removebg-bg-selector {
        width: 100%;
    }

    .removebg-buttons-group {
        flex-direction: column;
        gap: 15px;
        width: auto;
        flex: 0 0 auto;
    }

    .removebg-btn-upload,
    .removebg-btn-download,
    .removebg-btn-download-hd {
        width: auto;
        min-width: 220px;
        flex: 0 0 auto;
    }

    .removebg-bg-grid {
        grid-template-columns: repeat(8, 1fr);
    }
}

@media (min-width: 1024px) {
    .removebg-canvas-container {
        height: 500px;
    }
}

/* ===== LOADING STATE ===== */
.removebg-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ===== CREDITS BAR ===== */
.removebg-credits-bar {
    background: linear-gradient(135deg, #1a1a1a 0%, #000000 100%);
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0 30px 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.removebg-credits-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
    color: white;
}

.removebg-credits-icon {
    font-size: 28px;
}

.removebg-credits-text {
    flex: 1;
    font-size: 16px;
    line-height: 1.4;
}

.removebg-credits-text strong {
    font-size: 24px;
    font-weight: 700;
}

.removebg-credits-text small {
    display: block;
    font-size: 13px;
    opacity: 0.9;
    margin-top: 3px;
}

.removebg-credits-buy {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.removebg-credits-register {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 700;
    font-size: 15px;
    transition: all 0.3s ease;
    border: none;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.removebg-credits-buy:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.removebg-credits-register:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
    color: white;
    text-decoration: none;
}

.removebg-credits-register svg {
    flex-shrink: 0;
}

a.removebg-credits-register.openLoginPopup {
    width: 260px;
}

.removebg-credits-free {
    /* Same style as logged users */
}

@media (max-width: 767px) {
    .removebg-credits-info {
        justify-content: center;
        text-align: center;
    }
    
    .removebg-credits-text {
        flex-basis: 100%;
        order: 2;
    }
    
    .removebg-credits-icon {
        order: 1;
    }
    
    .removebg-credits-buy,
    .removebg-credits-register {
        order: 3;
    }
}

/* ===== DOWNLOAD HD BUTTON ===== */
.removebg-btn-download-hd {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    margin-top: 10px;
}

.removebg-btn-download-hd:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-2px);
}

.removebg-btn-download-hd small {
    font-weight: 400;
    color: rgba(255, 255, 255, 0.9);
}

.removebg-btn-download-hd strong {
    font-weight: 600;
}

@media (min-width: 768px) {
    .removebg-btn-download-hd {
        margin-top: 0;
        margin-left: 0;
    }
}

/* ===== EXAMPLES SECTION ===== */
.removebg-examples-section {
    margin-top: 60px;
    padding-top: 60px;
    border-top: 1px solid var(--border);
}

.removebg-examples-header {
    text-align: center;
    margin-bottom: 40px;
}

.removebg-examples-header h3 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 12px 0;
}

.removebg-examples-header p {
    font-size: 16px;
    color: var(--text-secondary);
    margin: 0;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.removebg-examples-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    margin-top: 40px;
}

@media (min-width: 768px) {
    .removebg-examples-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .removebg-examples-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
    }
}

.removebg-example-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.removebg-example-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.removebg-example-header {
    padding: 16px;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
}

.removebg-example-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.removebg-example-description {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.removebg-example-comparison {
    position: relative;
    background: var(--pattern-bg);
    aspect-ratio: 4/3;
    overflow: hidden;
}

.removebg-example-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.removebg-example-original,
.removebg-example-result {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.removebg-example-result {
    z-index: 1;
}

.removebg-example-original {
    z-index: 2;
    clip-path: inset(0 50% 0 0);
}

.removebg-example-original img,
.removebg-example-result img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.removebg-example-label {
    position: absolute;
    bottom: 12px;
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    color: white;
    font-size: 12px;
    font-weight: 600;
    border-radius: 6px;
    z-index: 10;
}

.removebg-example-label-before {
    left: 12px;
}

.removebg-example-label-after {
    right: 12px;
}

.removebg-example-slider {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 100%;
    background: white;
    z-index: 5;
    cursor: ew-resize;
}

.removebg-example-slider::before {
    content: '';
    position: absolute;
    top: 0;
    left: -2px;
    width: 8px;
    height: 100%;
}

.removebg-example-slider-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    cursor: ew-resize;
    transition: transform 0.2s ease;
}

.removebg-example-slider-button:hover {
    transform: translate(-50%, -50%) scale(1.1);
}

.removebg-example-slider-button svg {
    width: 24px;
    height: 24px;
    color: var(--primary);
}

/* Animation on hover */
.removebg-example-item:hover .removebg-example-slider-button {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.05);
    }
}

/* ===== CUSTOM MODAL POPUPS ===== */
.removebg-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.removebg-modal {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 100%;
    animation: slideUp 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    overflow: hidden;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.removebg-modal-header {
    padding: 24px 24px 16px 24px;
    border-bottom: 1px solid var(--border);
}

.removebg-modal-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.removebg-modal-title-icon {
    font-size: 24px;
}

.removebg-modal-body {
    padding: 24px;
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-secondary);
    white-space: pre-line;
}

.removebg-modal-footer {
    padding: 16px 24px 24px 24px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.removebg-modal-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 100px;
}

.removebg-modal-btn-primary {
    background: var(--primary);
    color: white;
}

.removebg-modal-btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.removebg-modal-btn-secondary {
    background: var(--bg-light);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.removebg-modal-btn-secondary:hover {
    background: #e2e8f0;
    color: var(--text-primary);
}

.removebg-modal-btn-danger {
    background: #ef4444;
    color: white;
}

.removebg-modal-btn-danger:hover {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* Alert-specific styles */
.removebg-modal.alert-type .removebg-modal-header {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-bottom: none;
}

.removebg-modal.alert-type .removebg-modal-title {
    color: #92400e;
}

/* Confirm-specific styles */
.removebg-modal.confirm-type .removebg-modal-header {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border-bottom: none;
}

.removebg-modal.confirm-type .removebg-modal-title {
    color: #1e40af;
}

/* Error-specific styles */
.removebg-modal.error-type .removebg-modal-header {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border-bottom: none;
}

.removebg-modal.error-type .removebg-modal-title {
    color: #991b1b;
}

@media (max-width: 480px) {
    .removebg-modal {
        max-width: 100%;
        margin: 10px;
    }

    .removebg-modal-footer {
        flex-direction: column-reverse;
    }

    .removebg-modal-btn {
        width: 100%;
    }
}

/* ===== SUCCESS CHECKMARK ===== */
.removebg-success-checkmark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    z-index: 999999999;
    font-size: 140px;
    color: #10b981;
    text-shadow: 0 0 60px rgba(16, 185, 129, 0.9),
                 0 0 30px rgba(16, 185, 129, 0.7),
                 0 0 15px rgba(16, 185, 129, 0.5);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    pointer-events: none;
    font-weight: bold;
    user-select: none;
}

.removebg-success-checkmark.show {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    animation: checkmarkPulse 0.8s ease-in-out;
}

@keyframes checkmarkPulse {
    0% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 0;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.15);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

/* ===== ZOOM FUNCTIONALITY ===== */
.removebg-canvas-container {
    will-change: transform;
    transition: transform 0.3s ease-out;
}

/* Prevent scrollbars during zoom */
.removebg-canvas {
    overflow: hidden !important;
}

