/* =============================================
   Free Image Background Remover v2.0
   Author: Rouf xr | aitoolszen.com
============================================= */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

.fibgr-wrap {
    font-family: 'Plus Jakarta Sans', sans-serif;
    max-width: 900px;
    margin: 0 auto;
    padding: 0;
    color: #1e1b4b;
}

/* ---- HEADER ---- */
.fibgr-header {
    display: flex;
    align-items: center;
    gap: 16px;
    background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
    padding: 28px 32px;
    border-radius: 18px 18px 0 0;
    color: #fff;
}
.fibgr-logo { flex-shrink: 0; }
.fibgr-title {
    margin: 0 0 4px;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: #fff;
}
.fibgr-subtitle {
    margin: 0;
    font-size: 13px;
    opacity: 0.85;
    color: #e0d7ff;
}
.fibgr-subtitle a { color: #fbbf24; text-decoration: none; font-weight: 600; }
.fibgr-subtitle a:hover { text-decoration: underline; }

/* ---- INSTRUCTIONS ---- */
.fibgr-instructions {
    background: #faf5ff;
    border: 1px solid #e9d5ff;
    border-top: none;
}
.fibgr-inst-toggle {
    width: 100%;
    background: none;
    border: none;
    padding: 14px 24px;
    text-align: left;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    color: #6d28d9;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}
.fibgr-inst-toggle:hover { background: #f5f3ff; }
.fibgr-caret { margin-left: auto; transition: transform 0.3s; font-size: 11px; }
.fibgr-caret.open { transform: rotate(180deg); }
.fibgr-inst-body {
    padding: 0 20px 20px;
    display: none;
}
.fibgr-inst-body.open { display: block; }
.fibgr-inst-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}
@media (max-width: 700px) {
    .fibgr-inst-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 420px) {
    .fibgr-inst-grid { grid-template-columns: 1fr; }
}
.fibgr-inst-card {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    border: 1px solid #ede9fe;
    box-shadow: 0 2px 8px rgba(124,58,237,0.06);
}
.fibgr-ic-icon { font-size: 28px; margin-bottom: 8px; }
.fibgr-inst-card h4 {
    margin: 0 0 10px;
    font-size: 13px;
    font-weight: 700;
    color: #5b21b6;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.fibgr-inst-card ul,
.fibgr-inst-card ol {
    margin: 0;
    padding-left: 18px;
    font-size: 12.5px;
    line-height: 1.8;
    color: #4b5563;
}
.fibgr-inst-card li { margin-bottom: 2px; }

/* ---- UPLOAD ZONE ---- */
.fibgr-upload-area {
    background: #fff;
    border: 2.5px dashed #c4b5fd;
    border-top: none;
    border-radius: 0 0 4px 4px;
    transition: border-color 0.2s, background 0.2s;
    cursor: pointer;
}
.fibgr-upload-area.drag-over {
    border-color: #7c3aed;
    background: #faf5ff;
}
.fibgr-upload-inner {
    padding: 48px 20px;
    text-align: center;
}
.fibgr-upload-icon { margin-bottom: 16px; }
.fibgr-upload-text {
    margin: 0 0 6px;
    font-size: 17px;
    font-weight: 700;
    color: #3730a3;
}
.fibgr-upload-sub {
    margin: 0 0 10px;
    font-size: 14px;
    color: #6b7280;
}
.fibgr-link { color: #7c3aed; font-weight: 600; cursor: pointer; }
.fibgr-upload-formats {
    margin: 0;
    font-size: 12px;
    color: #9ca3af;
    background: #f3f0ff;
    display: inline-block;
    padding: 5px 14px;
    border-radius: 20px;
}

/* ---- PREVIEW AREA ---- */
.fibgr-preview-area {
    background: #fff;
    border: 1px solid #ede9fe;
    border-top: none;
    padding: 28px;
    border-radius: 0 0 18px 18px;
}
.fibgr-preview-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}
@media (max-width: 600px) {
    .fibgr-preview-cols { grid-template-columns: 1fr; }
}
.fibgr-preview-label {
    margin: 0 0 10px;
    font-size: 13px;
    font-weight: 700;
    color: #5b21b6;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.fibgr-img-box {
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid #ede9fe;
    min-height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #faf5ff;
}
.fibgr-img-box img {
    max-width: 100%;
    max-height: 320px;
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
}
/* Checker transparency background */
.fibgr-checker {
    background-image:
        linear-gradient(45deg, #ddd6fe 25%, transparent 25%),
        linear-gradient(-45deg, #ddd6fe 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #ddd6fe 75%),
        linear-gradient(-45deg, transparent 75%, #ddd6fe 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    background-color: #f5f3ff;
}
.fibgr-img-meta {
    margin: 8px 0 0;
    font-size: 11.5px;
    color: #9ca3af;
    text-align: center;
}

/* ---- ACTIONS ---- */
.fibgr-actions {
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.fibgr-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 13px 28px;
    border-radius: 50px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
}
.fibgr-btn:hover { transform: translateY(-2px); }
.fibgr-btn:active { transform: translateY(0); }

.fibgr-btn-primary {
    background: linear-gradient(135deg, #7c3aed, #4f46e5);
    color: #fff;
    box-shadow: 0 4px 18px rgba(124,58,237,0.35);
}
.fibgr-btn-primary:hover { box-shadow: 0 8px 24px rgba(124,58,237,0.45); }
.fibgr-btn-primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.fibgr-btn-secondary {
    background: #f3f0ff;
    color: #5b21b6;
    border: 2px solid #c4b5fd;
}
.fibgr-btn-secondary:hover { background: #ede9fe; }

.fibgr-btn-success {
    background: linear-gradient(135deg, #059669, #0d9488);
    color: #fff;
    box-shadow: 0 4px 14px rgba(5,150,105,0.3);
    width: 100%;
    justify-content: center;
    margin-top: 10px;
    font-size: 14px;
    padding: 11px 20px;
}
.fibgr-btn-success:hover { box-shadow: 0 6px 20px rgba(5,150,105,0.4); }

/* ---- PROGRESS ---- */
.fibgr-progress-wrap { text-align: center; }
.fibgr-progress-bar {
    height: 8px;
    background: #ede9fe;
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 10px;
}
.fibgr-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #7c3aed, #4f46e5, #7c3aed);
    background-size: 200% 100%;
    border-radius: 20px;
    animation: fibgrShimmer 1.5s infinite;
    transition: width 0.5s ease;
}
@keyframes fibgrShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.fibgr-progress-text {
    font-size: 13px;
    color: #6d28d9;
    font-weight: 600;
    margin: 0;
}

/* ---- ALERT ---- */
.fibgr-alert {
    margin: 12px 0 0;
    padding: 14px 18px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
}
.fibgr-alert.success { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.fibgr-alert.error   { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.fibgr-alert.info    { background: #e0f2fe; color: #0c4a6e; border: 1px solid #7dd3fc; }

/* ---- SPINNER ---- */
.fibgr-spinner {
    width: 18px; height: 18px;
    border: 3px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: fibgrSpin 0.7s linear infinite;
    display: inline-block;
}
@keyframes fibgrSpin { to { transform: rotate(360deg); } }

/* ---- FOOTER ---- */
.fibgr-footer {
    text-align: center;
    padding: 14px;
    border-top: 1px solid #ede9fe;
    margin-top: 16px;
}
.fibgr-footer p { margin: 0; font-size: 12px; color: #9ca3af; }
.fibgr-footer a { color: #7c3aed; text-decoration: none; font-weight: 600; }

/* ---- PREVIEW SINGLE COL ---- */
.fibgr-preview-area.single-col .fibgr-preview-cols {
    grid-template-columns: 1fr;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}
