:root {
    --bg-color: #f7f8fc;
    --card-bg: #ffffff;
    --text-color: #333745;
    --text-secondary: #70768b;
    --shadow-color: rgba(90, 100, 120, 0.1);
    --border-color: #e8eaf3;
    --accent-gradient: linear-gradient(45deg, #5A8BFF, #69D2E7);
    --accent-color-start: #5A8BFF;
    --transparent-bg: url('data:image/svg+xml;utf8,<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><rect width="10" height="10" x="0" y="0" fill="%23f0f0f0" /><rect width="10" height="10" x="10" y="10" fill="%23f0f0f0" /><rect width="10" height="10" x="10" y="0" fill="%23dcdcdc" /><rect width="10" height="10" x="0" y="10" fill="%23dcdcdc" /></svg>');
}

/* Scoped wrapper */
.aibr-app-wrapper {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    margin: 0;
    padding: 1px 0;
}

.aibr-app-wrapper .container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px;
}

/* Hero Section */
.aibr-app-wrapper .hero-section {
    text-align: center;
    padding: 60px 20px;
}

.aibr-app-wrapper .hero-section h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 20px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.aibr-app-wrapper .hero-section p {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 40px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.aibr-app-wrapper .upload-area {
    border: 3px dashed var(--border-color);
    border-radius: 24px;
    padding: 60px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: var(--card-bg);
    max-width: 800px;
    margin: 0 auto;
    box-shadow: 0 4px 12px var(--shadow-color);
}

.aibr-app-wrapper .upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.aibr-app-wrapper .upload-area.dragover {
    border-color: var(--accent-color-start);
    transform: translateY(-5px);
    box-shadow: 0 10px 20px var(--shadow-color);
}

.aibr-app-wrapper .upload-area svg {
    color: var(--accent-color-start);
    margin-bottom: 20px;
    transition: transform 0.3s;
}

.aibr-app-wrapper .upload-area:hover svg {
    transform: scale(1.1);
}

.aibr-app-wrapper .upload-area p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.aibr-app-wrapper .upload-area p strong {
    color: var(--text-color);
    font-weight: 600;
}

/* General Section Card Style */
.aibr-app-wrapper .section-card {
    background-color: var(--card-bg);
    border-radius: 24px;
    padding: 30px 40px;
    box-shadow: 0 10px 30px var(--shadow-color);
    margin-top: 40px;
}

.aibr-app-wrapper .section-card h2 {
    text-align: center;
    margin-top: 0;
    margin-bottom: 30px;
    font-size: 2rem;
    font-weight: 600;
}

/* Tool Section */
.aibr-app-wrapper .result-container {
    text-align: center;
}

.aibr-app-wrapper .image-preview-wrapper {
    position: relative;
    max-width: 500px;
    min-height: 200px; /* Placeholder height */
    margin: 0 auto 20px;
    border-radius: 12px;
    overflow: hidden;
    background-image: var(--transparent-bg);
    border: 1px solid var(--border-color);
}

.aibr-app-wrapper .image-preview-wrapper img {
    max-width: 100%;
    height: auto;
    display: block;
    position: relative; /* To appear above the background */
}

.aibr-app-wrapper .loader {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.aibr-app-wrapper .loader .spinner {
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--accent-color-start);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

.aibr-app-wrapper .loader p {
    margin-top: 15px;
    font-weight: 500;
    color: var(--text-secondary);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.aibr-app-wrapper .btn-gradient {
    display: inline-block;
    padding: 16px 32px;
    border: none;
    border-radius: 50px;
    background: var(--accent-gradient);
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px color-mix(in srgb, var(--accent-color-start) 40%, transparent);
}

.aibr-app-wrapper .btn-gradient:hover:not(:disabled) {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px color-mix(in srgb, var(--accent-color-start) 50%, transparent);
}

.aibr-app-wrapper .btn-gradient:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Features Section */
.aibr-app-wrapper .features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 30px;
}
.aibr-app-wrapper .feature-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}
.aibr-app-wrapper .feature-card svg {
    width: 48px;
    height: 48px;
    color: var(--accent-color-start);
    margin-bottom: 15px;
}
.aibr-app-wrapper .feature-card h3 {
    margin-bottom: 10px;
    font-size: 1.2rem;
    font-weight: 600;
}
.aibr-app-wrapper .feature-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* FAQ Section */
.aibr-app-wrapper .faq-item {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
    margin-bottom: 15px;
}
.aibr-app-wrapper .faq-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}
.aibr-app-wrapper .faq-question {
    cursor: pointer;
    position: relative;
    margin: 0;
    padding: 10px 0;
    font-size: 1.1rem;
    font-weight: 500;
}
.aibr-app-wrapper .faq-question::after {
    content: '+';
    position: absolute;
    right: 0;
    font-size: 1.5rem;
    transition: transform 0.3s;
    color: var(--accent-color-start);
}
.aibr-app-wrapper .faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    padding-top: 0;
    color: var(--text-secondary);
}
.aibr-app-wrapper .faq-answer p {
    margin: 0;
    padding-bottom: 10px;
}
.aibr-app-wrapper .faq-item.active .faq-answer {
    max-height: 200px;
}
.aibr-app-wrapper .faq-item.active .faq-question::after {
    transform: rotate(45deg);
}

/* Responsive Design */
@media (max-width: 768px) {
    .aibr-app-wrapper .hero-section h1 {
        font-size: 2.2rem;
    }
    .aibr-app-wrapper .section-card h2 {
        font-size: 1.8rem;
    }
    .aibr-app-wrapper .section-card {
        padding: 20px;
    }
}