/* ============================================
   AI Background Remover Ultimate - Global Styles
   Version: 15.0.0
   ============================================ */

:root {
    --abr-primary: #6366F1;
    --abr-primary-dark: #4F46E5;
    --abr-secondary: #8B5CF6;
    --abr-success: #10B981;
    --abr-danger: #EF4444;
    --abr-warning: #F59E0B;
    --abr-dark: #1F2937;
    --abr-gray: #6B7280;
    --abr-light: #F9FAFB;
    --abr-border: #E5E7EB;
    --abr-radius: 24px;
    --abr-radius-sm: 16px;
    --abr-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08);
    --abr-shadow-lg: 0 20px 40px -12px rgba(0, 0, 0, 0.15);
    --abr-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base */
.abr-ultimate-wrapper * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.abr-ultimate-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', 'Roboto', sans-serif;
    background: linear-gradient(135deg, #F9FAFB 0%, #F3F4F6 100%);
    min-height: 100vh;
    padding: 48px 24px;
    position: relative;
}

.abr-ultimate-wrapper::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #6366F1, #8B5CF6, #EC4899, #F59E0B, #6366F1);
    background-size: 300% 100%;
    animation: abrGradientMove 4s ease infinite;
    z-index: 1000;
}

@keyframes abrGradientMove {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Container */
.abr-ultimate-container {
    max-width: 1280px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* Hero Section */
.abr-hero {
    text-align: center;
    margin-bottom: 48px;
    animation: abrFadeUp 0.6s ease;
}

@keyframes abrFadeUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.abr-badge {
    display: inline-flex;
    background: linear-gradient(135deg, rgba(99,102,241,0.12), rgba(139,92,246,0.12));
    backdrop-filter: blur(10px);
    padding: 10px 24px;
    border-radius: 60px;
    font-size: 13px;
    font-weight: 700;
    color: var(--abr-primary);
    margin-bottom: 28px;
    border: 1px solid rgba(99,102,241,0.2);
}

.abr-hero h1 {
    font-size: 56px;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #1F2937 0%, #4F46E5 40%, #8B5CF6 70%, #EC4899 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.abr-gradient {
    background: linear-gradient(135deg, #6366F1, #8B5CF6, #EC4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.abr-subtitle {
    color: var(--abr-gray);
    font-size: 18px;
    margin-bottom: 36px;
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

.abr-features-badge {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.abr-features-badge span {
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(4px);
    padding: 8px 18px;
    border-radius: 60px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: var(--abr-shadow);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--abr-transition);
}

.abr-features-badge span:hover {
    transform: translateY(-3px);
    box-shadow: var(--abr-shadow-lg);
}

/* Cards */
.abr-card {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
    border-radius: var(--abr-radius);
    padding: 36px;
    margin-bottom: 28px;
    box-shadow: var(--abr-shadow);
    transition: var(--abr-transition);
    border: 1px solid rgba(255,255,255,0.8);
}

.abr-card:hover {
    box-shadow: var(--abr-shadow-lg);
    transform: translateY(-2px);
}

/* Upload Area */
.abr-upload-area {
    text-align: center;
    padding: 60px 40px;
    border: 3px dashed var(--abr-border);
    border-radius: 20px;
    cursor: pointer;
    transition: var(--abr-transition);
    background: linear-gradient(135deg, #F9FAFB, #FFFFFF);
}

.abr-upload-area.dragover {
    border-color: var(--abr-primary);
    background: linear-gradient(135deg, rgba(99,102,241,0.05), rgba(139,92,246,0.05));
    transform: scale(1.02);
}

.abr-upload-icon svg {
    width: 80px;
    height: 80px;
    stroke: var(--abr-primary);
    margin-bottom: 24px;
    transition: var(--abr-transition);
}

.abr-hint {
    font-size: 13px;
    margin-top: 24px;
    color: var(--abr-gray);
}

/* Buttons */
.abr-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 14px 32px;
    border: none;
    border-radius: 60px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--abr-transition);
    text-decoration: none;
}

.abr-btn-primary {
    background: linear-gradient(135deg, #6366F1, #4F46E5);
    color: white;
    box-shadow: 0 4px 14px rgba(99,102,241,0.4);
}

.abr-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99,102,241,0.5);
}

.abr-btn-success {
    background: linear-gradient(135deg, #10B981, #059669);
    color: white;
}

.abr-btn-outline {
    background: transparent;
    border: 2px solid var(--abr-primary);
    color: var(--abr-primary);
}

.abr-btn-outline:hover {
    background: var(--abr-primary);
    color: white;
}

.abr-btn-warning {
    background: linear-gradient(135deg, #F59E0B, #D97706);
    color: white;
}

.abr-btn-magic-full {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 20px;
    padding: 18px 40px;
    width: 100%;
    justify-content: center;
    font-weight: 700;
}

.abr-btn-small {
    padding: 8px 20px;
    font-size: 13px;
}

/* Settings Header */
.abr-settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    flex-wrap: wrap;
    gap: 16px;
}

.abr-clear-btn {
    background: #F3F4F6;
    border: none;
    padding: 10px 20px;
    border-radius: 40px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: var(--abr-transition);
}

.abr-clear-btn:hover {
    background: var(--abr-danger);
    color: white;
}

/* Preview Grid */
.abr-preview-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
    margin-bottom: 32px;
}

.abr-preview-item {
    text-align: center;
}

.abr-preview-label {
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--abr-dark);
}

.abr-preview-image {
    background: linear-gradient(135deg, #F3F4F6, #E5E7EB);
    border-radius: 20px;
    padding: 24px;
    min-height: 240px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.abr-preview-image img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 12px;
    box-shadow: var(--abr-shadow);
}

.abr-preview-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 6px 12px;
    border-radius: 24px;
    font-size: 11px;
    font-weight: 600;
}

.abr-placeholder {
    color: var(--abr-gray);
    text-align: center;
}

.abr-placeholder span {
    font-size: 48px;
    display: block;
    margin-bottom: 12px;
}

/* Background Changer */
.abr-bg-changer {
    background: linear-gradient(135deg, #F9FAFB, #FFFFFF);
    border-radius: 20px;
    padding: 24px;
    margin-bottom: 28px;
    border: 1px solid var(--abr-border);
}

.abr-bg-tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.abr-bg-tab {
    padding: 10px 24px;
    background: #F3F4F6;
    border: none;
    border-radius: 40px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: var(--abr-transition);
}

.abr-bg-tab.active {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
}

.abr-bg-options {
    margin-top: 16px;
}

.abr-color-presets {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.abr-color-preset {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--abr-transition);
    border: 3px solid transparent;
    box-shadow: var(--abr-shadow);
}

.abr-color-preset:hover {
    transform: scale(1.1);
}

.abr-color-preset.selected {
    border-color: var(--abr-primary);
    transform: scale(1.1);
}

.abr-custom-color {
    display: flex;
    align-items: center;
    gap: 12px;
}

.abr-custom-color input {
    width: 50px;
    height: 44px;
    border: 2px solid var(--abr-border);
    border-radius: 12px;
    cursor: pointer;
}

.abr-custom-bg-input {
    display: flex;
    gap: 12px;
}

.abr-custom-bg-input input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--abr-border);
    border-radius: 40px;
    font-size: 14px;
}

.abr-small-btn {
    padding: 12px 24px;
    background: var(--abr-primary);
    color: white;
    border: none;
    border-radius: 40px;
    cursor: pointer;
    font-weight: 500;
    transition: var(--abr-transition);
}

/* Settings Grid */
.abr-settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.abr-setting {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.abr-setting label {
    font-weight: 600;
    color: var(--abr-dark);
    font-size: 14px;
}

.abr-setting select {
    padding: 12px 16px;
    border: 1px solid var(--abr-border);
    border-radius: 14px;
    font-size: 14px;
    background: white;
    cursor: pointer;
}

/* Batch Queue */
.abr-batch-queue {
    margin-top: 28px;
    padding-top: 28px;
    border-top: 1px solid var(--abr-border);
}

.abr-batch-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.abr-batch-count {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    padding: 4px 12px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 600;
}

.abr-queue-list {
    max-height: 280px;
    overflow-y: auto;
    margin-bottom: 20px;
}

.abr-queue-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #F9FAFB;
    border-radius: 14px;
    margin-bottom: 8px;
}

.abr-queue-remove {
    background: var(--abr-danger);
    color: white;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
}

.abr-batch-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* Progress */
.abr-progress-header {
    text-align: center;
    margin-bottom: 32px;
}

.abr-ai-animation {
    position: relative;
    display: inline-block;
    margin-bottom: 20px;
}

.abr-ai-bot {
    font-size: 64px;
    animation: abrPulse 2s ease infinite;
}

@keyframes abrPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.abr-ai-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 80px;
    height: 80px;
    background: rgba(99,102,241,0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: abrRipple 1.5s ease infinite;
}

@keyframes abrRipple {
    0% { width: 60px; height: 60px; opacity: 0.6; }
    100% { width: 140px; height: 140px; opacity: 0; }
}

.abr-progress-bar {
    height: 12px;
    background: var(--abr-border);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 18px;
}

.abr-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #6366F1, #8B5CF6, #EC4899);
    background-size: 300% 100%;
    width: 0%;
    border-radius: 6px;
    animation: abrProgressShine 1.5s ease infinite;
}

@keyframes abrProgressShine {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

.abr-progress-message {
    text-align: center;
    color: var(--abr-gray);
    font-size: 14px;
}

/* Comparison Slider */
.abr-comparison-slider {
    position: relative;
    width: 100%;
    overflow: hidden;
    cursor: ew-resize;
    border-radius: 20px;
    box-shadow: var(--abr-shadow-lg);
    margin: 20px 0;
}

.abr-slider-image {
    position: relative;
    width: 100%;
}

.abr-slider-image img {
    width: 100%;
    display: block;
}

.abr-slider-overlay {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 50%;
    overflow: hidden;
}

.abr-slider-overlay img {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: auto;
    max-width: none;
}

.abr-slider-handle {
    position: absolute;
    top: 0;
    left: 50%;
    width: 4px;
    height: 100%;
    background: white;
    transform: translateX(-50%);
    cursor: ew-resize;
    z-index: 10;
    box-shadow: 0 0 10px rgba(0,0,0,0.3);
}

.abr-slider-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(99,102,241,0.95);
    border-radius: 40px;
    padding: 10px 20px;
    color: white;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

/* Results */
.abr-results-header {
    text-align: center;
    margin-bottom: 32px;
}

.abr-success-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.abr-results-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    margin: 24px 0;
}

/* Batch Results */
.abr-batch-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px;
    margin: 24px 0;
    max-height: 500px;
    overflow-y: auto;
}

.abr-batch-result-item {
    text-align: center;
    padding: 12px;
    background: #F9FAFB;
    border-radius: 16px;
    transition: var(--abr-transition);
}

.abr-batch-result-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--abr-shadow);
}

.abr-batch-result-item img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 10px;
}

.abr-batch-download-all {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-top: 24px;
}

/* Error Card */
.abr-error-card {
    text-align: center;
    border-color: #FEE2E2;
}

.abr-error-icon {
    font-size: 56px;
    margin-bottom: 16px;
}

.abr-error-card h4 {
    color: var(--abr-danger);
    margin-bottom: 12px;
}

.abr-error-solution {
    background: #FEF3C7;
    border-radius: 12px;
    padding: 14px;
    margin: 16px 0;
    font-size: 13px;
    color: #92400E;
}

/* Donation */
.abr-donation {
    text-align: center;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--abr-border);
}

.abr-donation-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #FF6B6B, #EE5A24);
    color: white;
    padding: 14px 32px;
    border-radius: 60px;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    transition: var(--abr-transition);
    box-shadow: 0 4px 15px rgba(238,90,36,0.3);
}

.abr-donation-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(238,90,36,0.4);
}

/* Features Section */
.abr-features-section {
    text-align: center;
    margin-top: 56px;
}

.abr-features-section h2 {
    font-size: 32px;
    margin-bottom: 40px;
    color: var(--abr-dark);
}

.abr-features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.abr-feature {
    background: white;
    border-radius: 24px;
    padding: 32px 24px;
    transition: var(--abr-transition);
    box-shadow: var(--abr-shadow);
}

.abr-feature:hover {
    transform: translateY(-8px);
    box-shadow: var(--abr-shadow-lg);
}

.abr-feature-icon {
    font-size: 48px;
    margin-bottom: 18px;
}

.abr-feature h4 {
    font-size: 20px;
    margin-bottom: 12px;
    color: var(--abr-dark);
}

.abr-feature p {
    font-size: 14px;
    color: var(--abr-gray);
    line-height: 1.6;
}

/* Footer */
.abr-footer {
    text-align: center;
    margin-top: 56px;
    padding-top: 32px;
    border-top: 1px solid rgba(0,0,0,0.08);
}

.abr-footer p {
    margin-bottom: 10px;
    color: var(--abr-gray);
    font-size: 13px;
}

.abr-footer a {
    color: var(--abr-primary);
    text-decoration: none;
    font-size: 14px;
}

.abr-footer a:hover {
    text-decoration: underline;
}

/* Toast Notifications */
.abr-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: white;
    padding: 14px 24px;
    border-radius: 60px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 100000;
    font-weight: 500;
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0;
}

.abr-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.abr-toast-success {
    background: linear-gradient(135deg, #10B981, #059669);
    color: white;
}

.abr-toast-error {
    background: linear-gradient(135deg, #EF4444, #DC2626);
    color: white;
}

.abr-toast-warning {
    background: linear-gradient(135deg, #F59E0B, #D97706);
    color: white;
}

.abr-toast-info {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
}

/* Responsive Design */
@media (max-width: 768px) {
    .abr-ultimate-wrapper {
        padding: 32px 16px;
    }
    
    .abr-hero h1 {
        font-size: 36px;
    }
    
    .abr-card {
        padding: 24px 20px;
    }
    
    .abr-upload-area {
        padding: 40px 24px;
    }
    
    .abr-preview-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .abr-features-badge {
        gap: 8px;
    }
    
    .abr-features-badge span {
        font-size: 11px;
        padding: 5px 12px;
    }
    
    .abr-slider-circle {
        padding: 6px 12px;
        font-size: 10px;
    }
    
    .abr-results-actions {
        flex-direction: column;
    }
    
    .abr-results-actions .abr-btn {
        width: 100%;
        justify-content: center;
    }
    
    .abr-features-section h2 {
        font-size: 26px;
    }
    
    .abr-features-grid {
        grid-template-columns: 1fr;
    }
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
    :root {
        --abr-dark: #F9FAFB;
        --abr-gray: #9CA3AF;
        --abr-border: #374151;
    }
    
    .abr-ultimate-wrapper {
        background: linear-gradient(135deg, #111827 0%, #1F2937 100%);
    }
    
    .abr-card {
        background: rgba(31, 41, 55, 0.95);
    }
    
    .abr-features-badge span {
        background: #374151;
        color: #F9FAFB;
    }
    
    .abr-upload-area {
        background: linear-gradient(135deg, #1F2937, #374151);
    }
    
    .abr-feature {
        background: #1F2937;
    }
    
    .abr-bg-changer {
        background: #1F2937;
    }
    
    .abr-bg-tab {
        background: #374151;
        color: #F9FAFB;
    }
    
    .abr-queue-item {
        background: #1F2937;
    }
    
    .abr-batch-result-item {
        background: #1F2937;
    }
    
    .abr-setting select {
        background: #374151;
        color: #F9FAFB;
        border-color: #4B5563;
    }
    
    .abr-clear-btn {
        background: #374151;
        color: #F9FAFB;
    }
    
    .abr-custom-bg-input input {
        background: #374151;
        color: #F9FAFB;
        border-color: #4B5563;
    }
}