.custom-theme-creator {
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: relative;

    // Pro Banner for free users
    .pro-banner {
        background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
        color: white;
        padding: 20px;
        border-radius: 12px;
        margin-bottom: 20px;
        box-shadow: 0 8px 25px rgba(255, 107, 107, 0.3);

        .pro-banner-content {
            display: flex;
            align-items: center;
            gap: 20px;

            .pro-icon {
                font-size: 32px;
                opacity: 0.9;
            }

            .pro-text {
                flex: 1;

                h3 {
                    margin: 0 0 5px 0;
                    font-size: 18px;
                    font-weight: 600;
                }

                p {
                    margin: 0;
                    opacity: 0.9;
                    font-size: 14px;
                }
            }

            .upgrade-btn {
                background: rgba(255, 255, 255, 0.2);
                color: white;
                border: 2px solid rgba(255, 255, 255, 0.3);
                padding: 12px 24px;
                border-radius: 8px;
                cursor: pointer;
                font-weight: 600;
                transition: all 0.3s ease;
                white-space: nowrap;

                &:hover {
                    background: rgba(255, 255, 255, 0.3);
                    transform: translateY(-2px);
                }
            }
        }

        @media (max-width: 768px) {
            .pro-banner-content {
                flex-direction: column;
                text-align: center;
                gap: 15px;
            }
        }
    }

    // Free user mode styling
    &.free-user-mode {
        .theme-creator-content {
            position: relative;
            opacity: 0.7;
            pointer-events: none;

            &::before {
                content: '';
                position: absolute;
                top: 0;
                left: 0;
                right: 0;
                bottom: 0;
                background: rgba(255, 255, 255, 0.05);
                border-radius: inherit;
                pointer-events: none;
                z-index: 1;
            }
        }

        .control-group select:disabled,
        .control-group input:disabled {
            opacity: 0.6;
            cursor: not-allowed;
        }
    }

    .theme-creator-header {
        margin-bottom: 30px;
        text-align: center;

        h3 {
            color: #333;
            margin-bottom: 10px;
            font-size: 24px;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 15px;

            .demo-badge {
                background: #ffd93d;
                color: #333;
                padding: 4px 12px;
                border-radius: 20px;
                font-size: 12px;
                font-weight: 500;
                text-transform: uppercase;
                letter-spacing: 0.5px;
            }
        }

        p {
            color: #666;
            font-size: 14px;
            margin: 0;
        }
    }

    .theme-creator-content {
        display: grid;
        grid-template-columns: 1fr 400px;
        gap: 30px;
        align-items: start;
        max-height: calc(100vh - 200px);

        @media (max-width: 1024px) {
            grid-template-columns: 1fr;
            gap: 20px;
            max-height: none;
        }
    }

    .theme-controls {
        max-height: calc(100vh - 200px);
        overflow-y: auto;
        padding-right: 10px;

        // Custom scrollbar
        &::-webkit-scrollbar {
            width: 6px;
        }

        &::-webkit-scrollbar-track {
            background: #f1f1f1;
            border-radius: 3px;
        }

        &::-webkit-scrollbar-thumb {
            background: #a177f8;
            border-radius: 3px;

            &:hover {
                background: #8b5cf6;
            }
        }

        .control-section {
            margin-bottom: 25px;
            padding: 20px;
            background: #f8f9fa;
            border-radius: 8px;
            border: 1px solid #e9ecef;

            h4 {
                color: #495057;
                margin-bottom: 15px;
                font-size: 16px;
                font-weight: 600;
                border-bottom: 2px solid #a177f8;
                padding-bottom: 8px;
            }

            .control-group {
                margin-bottom: 15px;

                &:last-child {
                    margin-bottom: 0;
                }

                label {
                    display: block;
                    margin-bottom: 5px;
                    font-weight: 500;
                    color: #495057;
                    font-size: 13px;
                }

                input,
                select {
                    width: 100%;
                    padding: 8px 12px;
                    border: 1px solid #ced4da;
                    border-radius: 4px;
                    font-size: 14px;
                    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;

                    &:focus {
                        outline: none;
                        border-color: #a177f8;
                        box-shadow: 0 0 0 0.2rem rgba(161, 119, 248, 0.25);
                    }

                    &[type="color"] {
                        height: 40px;
                        padding: 2px;
                        cursor: pointer;
                    }
                }

                select {
                    cursor: pointer;
                    background-color: #fff;
                }
            }
        }

        .control-section:last-child {
            position: sticky;
            bottom: 0px;
            opacity: 1;
            visibility: visible;
            transition: opacity 0.3s  ease, visibility 0.3s ease;
            z-index: 100;
        }

        .save-theme-btn {
            width: 100%;
            padding: 12px 24px;
            background: linear-gradient(135deg, #a177f8 0%, #8b5cf6 100%);
            color: white;
            border: none;
            border-radius: 6px;
            font-size: 16px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;

            &:hover {
                transform: translateY(-2px);
                box-shadow: 0 4px 15px rgba(161, 119, 248, 0.4);
            }

            &:active {
                transform: translateY(0);
            }
        }
    }

    .theme-preview {
        position: sticky;
        top: 20px;
        max-height: calc(100vh - 40px);
        overflow-y: auto;

        h4 {
            color: #495057;
            margin-bottom: 15px;
            font-size: 16px;
            font-weight: 600;
            text-align: center;
            position: sticky;
            top: 0;
            background: #fff;
            padding: 10px 0;
            z-index: 10;
            border-bottom: 1px solid #e9ecef;
        }

        .custom-theme-preview {
            border: 2px dashed #dee2e6;
            position: relative;
            background: #fff;
            border-radius: 8px;
            overflow: hidden;

            &::before {
                content: "Live Preview";
                position: absolute;
                top: -6px;
                left: 20px;
                background: #fff;
                padding: 0 10px;
                font-size: 12px;
                color: #6c757d;
                font-weight: 500;
                z-index: 5;
            }

            &::after {
                content: "This is how your form will look";
                position: absolute;
                bottom: -10px;
                right: 20px;
                background: #fff;
                padding: 0 10px;
                font-size: 11px;
                color: #adb5bd;
                font-style: italic;
                z-index: 5;
            }
        }
    }
}

// Animation for smooth transitions
.custom-theme-creator * {
    transition: all 0.2s ease;
}

// Responsive adjustments
@media (max-width: 768px) {
    .custom-theme-creator {
        padding: 15px;

        .theme-creator-content {
            gap: 15px;
        }

        .theme-controls .control-section {
            padding: 15px;
        }
    }
}