/* BotBunch Image Optimizer - Modern Glassmorphism Design */

:root {
    --bb-primary: #4f46e5; /* Indigo */
    --bb-primary-hover: #4338ca;
    --bb-bg: #f8fafc;
    --bb-card-bg: rgba(255, 255, 255, 0.95);
    --bb-text: #1e293b;
    --bb-text-muted: #64748b;
    --bb-border: #e2e8f0;
    --bb-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.05);
    --bb-radius: 16px;
    --bb-overlay-bg: linear-gradient(135deg, #e0f2fe 0%, #f0f9ff 100%);
}

#bb-img-opt-wrapper {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    max-width: 600px;
    margin: 40px auto;
    padding: 0;
    color: var(--bb-text);
}

.bb-io-container {
    background: var(--bb-card-bg);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: var(--bb-radius);
    box-shadow: var(--bb-shadow);
    padding: 32px;
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
    transition: height 0.3s ease;
}

/* Header */
.bb-io-header {
    text-align: center;
    margin-bottom: 24px;
}
.bb-io-header h2 {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 8px;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.bb-io-header p {
    margin: 0;
    color: var(--bb-text-muted);
    font-size: 14px;
}

/* Steps */
.bb-io-step {
    display: none;
    animation: fadeIn 0.4s ease;
}
.bb-io-step.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Dropzone */
.bb-io-dropzone {
    border: 2px dashed var(--bb-border);
    border-radius: var(--bb-radius);
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fdfdfd;
}
.bb-io-dropzone:hover, .bb-io-dropzone.dragover {
    border-color: var(--bb-primary);
    background: #f0f5ff;
}
.bb-io-icon {
    font-size: 48px;
    margin-bottom: 16px;
}
.bb-io-dropzone h3 {
    margin: 0 0 8px;
    font-size: 18px;
}
.bb-io-meta {
    font-size: 12px;
    color: var(--bb-text-muted);
    margin-top: 12px;
}

/* Buttons */
.bb-io-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: 12px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 15px;
    width: 100%;
}
.bb-io-btn.primary {
    background: var(--bb-primary);
    color: white;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}
.bb-io-btn.primary:hover {
    background: var(--bb-primary-hover);
    transform: translateY(-1px);
}
.bb-io-btn.secondary {
    background: var(--bb-bg);
    color: var(--bb-text);
    border: 1px solid var(--bb-border);
    margin-top: 12px;
}
.bb-io-btn.secondary:hover {
    background: #eff6ff;
}

/* Settings */
.bb-io-settings-grid {
    display: grid;
    gap: 20px;
    margin: 24px 0;
}
.bb-io-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--bb-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
select, input[type="number"], input[type="text"] {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--bb-border);
    border-radius: 8px;
    font-size: 14px;
    background: white;
    transition: border 0.2s;
}
select:focus, input:focus {
    outline: none;
    border-color: var(--bb-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Pills */
.bb-io-pills {
    display: flex;
    gap: 8px;
    background: var(--bb-bg);
    padding: 4px;
    border-radius: 10px;
}
.bb-io-pill {
    flex: 1;
    border: none;
    background: transparent;
    padding: 8px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--bb-text-muted);
    cursor: pointer;
    transition: all 0.2s;
}
.bb-io-pill.active {
    background: white;
    color: var(--bb-primary);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* Dimensions Row */
.bb-io-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 12px;
    align-items: end;
}
.bb-io-lock-wrap button {
    background: none;
    border: 1px solid var(--bb-border);
    border-radius: 6px;
    padding: 8px;
    cursor: pointer;
    color: var(--bb-text-muted);
}
.bb-io-lock-wrap button.active {
    background: #eff6ff;
    color: var(--bb-primary);
    border-color: var(--bb-primary);
}

/* Processing */
.bb-io-loader {
    text-align: center;
    padding: 40px;
}
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(79, 70, 229, 0.1);
    border-left-color: var(--bb-primary);
    border-radius: 50%;
    margin: 0 auto 16px;
    animation: spin 1s linear infinite;
}
@keyframes spin { 100% { transform: rotate(360deg); } }

/* Results */
.bb-io-success-icon {
    font-size: 50px;
    text-align: center;
    margin-bottom: 16px;
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes popIn {
    from { transform: scale(0); }
    to { transform: scale(1); }
}
.bb-io-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    background: #f1f5f9;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 24px;
}
.bb-io-stat {
    display: flex;
    flex-direction: column;
    text-align: center;
}
.bb-io-stat .label {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--bb-text-muted);
    margin-bottom: 4px;
}
.bb-io-stat .value {
    font-weight: 700;
    font-size: 16px;
}
.bb-io-badge {
    background: #dcfce7;
    color: #15803d;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 4px;
}

.bb-hidden {
    display: none !important;
}

.bb-io-footer {
    text-align: center;
    margin-top: 24px;
    color: var(--bb-text-muted);
    font-size: 12px;
}
.bb-io-preview-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f1f5f9;
    padding: 10px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 13px;
    font-weight: 500;
}
.bb-io-btn-text {
    background: none;
    border: none;
    color: var(--bb-primary);
    cursor: pointer;
    font-weight: 600;
    text-decoration: underline;
}

/* Mobile */
@media (max-width: 480px) {
    .bb-io-container {
        padding: 20px;
    }
}
