.custom-tool-dialog {
    background-color: #222225;
    border-radius: 12px;
    border: 1px solid var(--color-divider-subtle);
    color: #fff;
    min-width: 400px;
    width: 90vw;
    height: 90vh;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
    overflow: hidden;

    form {
        display: flex;
        flex-direction: column;
        height: 100%;
    }

    .dialog-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 1rem;
        border-bottom: 1px solid var(--color-divider-subtle);

        .title {
            margin: 0;
            font-size: 1.125rem;
            font-weight: 600;
            max-width: calc(100% - 40px);
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            color: #fff;
        }

        .close-btn {
            background: none;
            border: none;
            color: #fff;
            cursor: pointer;
            padding: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 6px;
            margin-left: 10px;
            transition: all 0.2s ease;
            opacity: 0.8;

            &:hover {
                opacity: 1;
                transform: scale(1.1);
            }
        }
    }

    .dialog-content {
        flex: 1;
        overflow: hidden;
        min-height: 0;

        .content-split {
            display: flex;
            height: 100%;

            .form-fields {
                width: 640px;
                padding: 1rem;
                overflow-y: auto;
                display: flex;
                flex-direction: column;
                gap: 1rem;
                border-right: 1px solid var(--color-divider-subtle);

                .form-section {
                    .section-header {
                        display: flex;
                        align-items: center;
                        gap: 0.5rem;
                        margin-bottom: 0.5rem;
                    }

                    h3 {
                        margin: 0;
                        font-size: 0.875rem;
                        color: #aaa;
                        font-weight: 500;

                        .required {
                            color: #ff4444;
                            margin-left: 4px;
                        }
                    }

                    .input-container {
                        position: relative;

                        .input-field {
                            width: 100%;
                            padding: 0.5rem 0.75rem;
                            background-color: rgba(30, 30, 30, 0.6);
                            border: 1px solid rgba(255, 255, 255, 0.1);
                            border-radius: 6px;
                            color: #fff;
                            font-size: 0.875rem;
                            outline: none;
                            transition: border-color 0.2s ease;

                            &::placeholder {
                                color: rgba(255, 255, 255, 0.3);
                            }

                            &:focus {
                                border-color: #685fff;
                            }

                            &.textarea {
                                min-height: 100px;
                                resize: vertical;
                            }
                        }

                        .error-message {
                            font-size: 0.75rem;
                            color: #ff4444;
                            margin-top: 0.25rem;
                            display: block;
                        }
                    }

                    .json-editor-wrapper {
                        border: 1px solid rgba(255, 255, 255, 0.1);
                        border-radius: 6px;
                        overflow: hidden;
                    }
                }
            }

            .code-editor-container {
                width: 100%;
                display: flex;
                flex-direction: column;
                overflow: hidden;

                .editor-header {
                    display: flex;
                    align-items: center;
                    gap: 0.5rem;
                    padding: 1rem;
                    border-bottom: 1px solid var(--color-divider-subtle);

                    h3 {
                        margin: 0;
                        font-size: 0.875rem;
                        color: #aaa;
                        font-weight: 500;
                    }
                }
            }
        }
    }

    .dialog-footer {
        border-top: 1px solid var(--color-divider-subtle);
        padding: 1rem;
        display: flex;
        justify-content: flex-end;
        gap: 1rem;
    }
}

/* Spinner Animation */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.spinner {
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
}
