/* Stitch UI - Smart Formula Finder Widget */
:root {
    --stitch-glass-bg: rgba(255, 255, 255, 0.7);
    --stitch-glass-border: rgba(255, 255, 255, 0.5);
    --stitch-glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
    --stitch-primary: #166534;
    --stitch-accent: #15803d;
    --stitch-text: #1e293b;
    --stitch-transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.stitch-widget {
    background: var(--stitch-glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--stitch-glass-border);
    box-shadow: var(--stitch-glass-shadow);
    border-radius: 24px;
    padding: 2rem;
    max-width: 600px;
    margin: 2rem auto;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: var(--stitch-transition);
}

.stitch-widget__header h3 {
    margin: 0 0 0.5rem 0;
    color: var(--stitch-primary);
    font-size: 1.5rem;
}

.stitch-widget__header p {
    color: var(--stitch-text);
    margin-bottom: 1.5rem;
    font-size: 1rem;
    opacity: 0.9;
}

/* Steps Container */
.stitch-step {
    display: none;
    animation: stitchFadeIn 0.4s ease-out forwards;
}

.stitch-step.active {
    display: block;
}

/* Options Grid */
.stitch-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.stitch-option-btn {
    background: white;
    border: 2px solid transparent;
    border-radius: 16px;
    padding: 1rem;
    cursor: pointer;
    transition: var(--stitch-transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.stitch-option-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: rgba(22, 101, 52, 0.2);
}

.stitch-option-btn.selected {
    border-color: var(--stitch-primary);
    background: #f0fdf4;
}

.stitch-option-icon {
    font-size: 1.75rem;
    display: block;
}

.stitch-option-label {
    font-weight: 600;
    color: var(--stitch-text);
    font-size: 0.95rem;
}

/* Progress Bar */
.stitch-progress {
    height: 6px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 3px;
    margin-bottom: 2rem;
    overflow: hidden;
}

.stitch-progress-bar {
    height: 100%;
    background: var(--stitch-primary);
    width: 0%;
    transition: width 0.4s ease;
    border-radius: 3px;
}

/* Navigation Buttons */
.stitch-actions {
    margin-top: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stitch-btn-back {
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    font-weight: 500;
    padding: 0.5rem;
}

.stitch-btn-back:hover {
    color: var(--stitch-text);
}

/* Animations */
@keyframes stitchFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile Adjustments */
@media (max-width: 640px) {
    .stitch-widget {
        padding: 1.5rem;
        margin: 1rem;
        border-radius: 20px;
    }

    .stitch-options {
        grid-template-columns: 1fr 1fr;
    }

    .stitch-option-btn {
        padding: 0.75rem;
    }
}